@@ -94,61 +94,13 @@ consider:
9494 ` upstream ` refers to the original BIDS validator repository on GitHub
9595 - you can use ` upstream ` to always stay up to date with changes that are
9696 being made on the original BIDS validator. For that, simply navigate to
97- the ` master ` branch of ** your** repository using ` git checkout master ` ,
98- and then run ` git pull upstream master `
97+ the ` main ` branch of ** your** repository using ` git checkout main ` ,
98+ and then run ` git pull upstream main `
99991 . When you get completely stuck with your repository and you just want to
100100 reset it to be an exact mirror of the original BIDS validator, you can
101101 run the following command (Note: this will discard all current changes):
102- - first checkout your master: ` git checkout master `
103- - then run: ` git reset --hard upstream/master `
104-
105- ## Extending the BIDS validator for a BIDS Extension Proposal (BEP)
106-
107- ### Regular expressions
108-
109- A lot of validation of BIDS files and directories is happening through
110- [ regular expressions] ( https://en.wikipedia.org/wiki/Regular_expression ) .
111- You can see the regular expressions
112- [ here] ( https://github.com/bids-standard/bids-validator/tree/master/bids-validator/bids_validator/rules ) .
113-
114- Changing the regular expressions can be a delicate thing, so we recommend
115- testing your regular expressions exhaustively. A helpful website for that can
116- be [ https://regex101.com/ ] ( https://regex101.com/ ) , where you can test regular
117- expressions in your browser, and even save and share them.
118-
119- ### JSON schemas
120-
121- Another big chunk of BIDS validation is happening through [ JSON schemas] ( https://json-schema.org/ ) .
122- In BIDS, a lot of metadata is saved in JSON files, which are very well defined
123- and readable by a computer. With these properties, we can make requirements of
124- how a JSON ought to look like. You can find our JSON schemas
125- [ here] ( https://github.com/bids-standard/bids-validator/tree/master/bids-validator/validators/json/schemas ) .
126-
127- As with regular expressions, we recommend lots of testing on the JSON schemas.
128- You can easily have a first try of that using a website like
129- [ https://www.jsonschemavalidator.net/ ] ( https://www.jsonschemavalidator.net/ ) .
130- Simply copy over a schema from BIDS validator to the left field, and try to
131- comply to the schema, or trigger an error by typing in a JSON to the right
132- field.
133-
134- ### Writing tests
135-
136- For every change you make it is important to include a test. That way, we can
137- make sure that the behavior of BIDS validator is as expected, and furthermore
138- we will be notified whenever a contributor makes a change in the code that
139- breaks the expected behavior of the BIDS validator.
140-
141- A test usually provides some known data, and let's the software run over it ...
142- just to check whether the output is as we know it should be (because we know
143- the data, after all).
144-
145- You can get a good impression using the following links:
146-
147- - [ How regular expressions are tested] ( https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/type.spec.js )
148- - [ How JSON schemas are tested] ( https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/json.spec.js )
149- - [ How TSV files are tested] ( https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/tsv.spec.js )
150-
151- For more information on how to run the tests check the [ testing section] ( ./README.md#testing ) of the README.
102+ - first checkout your main: ` git checkout main `
103+ - then run: ` git reset --hard upstream/main `
152104
153105[ link_git ] : https://git-scm.com/
154106[ link_handbook ] : https://guides.github.com/introduction/git-handbook/
0 commit comments