|
1 | 1 | # Using the command line |
| 2 | + |
| 3 | +The BIDS Validator may be run with the [Deno] runtime. |
| 4 | +For detailed installation instructions, see [Deno - Installation][]. |
| 5 | +Deno is also available as a [conda-forge package](https://anaconda.org/conda-forge/deno). |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +In general, there is no need to install Deno applications. |
| 10 | +`deno run` allows running from the Javascript Repository: |
| 11 | + |
| 12 | +```sh |
| 13 | +deno run -ERN jsr:@bids/validator <dataset> |
| 14 | +``` |
| 15 | + |
| 16 | +However, you can also install a lightweight script (into `$HOME/.deno/bin`): |
| 17 | + |
| 18 | +```sh |
| 19 | +deno install -ERN -g -n bids-validator jsr:@bids/validator |
| 20 | +``` |
| 21 | + |
| 22 | +Or compile a bundled binary: |
| 23 | + |
| 24 | +```sh |
| 25 | +deno compile -ERN -o bids-validator jsr:@bids/validator |
| 26 | +``` |
| 27 | + |
| 28 | +## Usage |
| 29 | + |
| 30 | +The BIDS Validator takes a single dataset as input: |
| 31 | + |
| 32 | +::::{tab-set} |
| 33 | +:sync-group: run-method |
| 34 | + |
| 35 | +:::{tab-item} Deno run |
| 36 | +:sync: run |
| 37 | + |
| 38 | +```sh |
| 39 | +deno run -ERN jsr:@bids/validator <dataset> |
| 40 | +``` |
| 41 | + |
| 42 | +::: |
| 43 | +:::{tab-item} Installed |
| 44 | +:sync: install |
| 45 | + |
| 46 | +```sh |
| 47 | +bids-validator <dataset> |
| 48 | +``` |
| 49 | + |
| 50 | +::: |
| 51 | +:::: |
| 52 | + |
| 53 | +### Options |
| 54 | + |
| 55 | +| Option | Description | |
| 56 | +| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 57 | +| `-v`, `--verbose` | Log more extensive information about issues | |
| 58 | +| `-s URL`, `--schema URL` | Specify an alternative [BIDS Schema] for validation | |
| 59 | +| `-c FILE`, `--config FILE` | Provide a [configuration file](#configuration-file) | |
| 60 | +| `-r`, `--recursive` | Validate datasets found in `derivatives/` subdirectories, recursively | |
| 61 | +| `-o FILE`, `--outfile FILE` | Write validation results to file. | |
| 62 | +| `--json` | Output results in machine-readable [JSON] | |
| 63 | +| `--ignoreWarnings` | Do not report warnings | |
| 64 | +| `--ignoreNiftiHeaders` | Do not open NIfTI files, skipping any checks that rely on NIfTI header data | |
| 65 | +| `--filenameMode` | Perform filename checks only on newline-separated filenames read from [stdin] | |
| 66 | +| `--blacklistModalities MOD...` | Raise error if passed modalities are detected in the dataset. Modalities may be any of `mri`, `eeg`, `ieeg`, `meg`, `beh`, `pet`, `micr`, `motion`, `nirs`, or `mrs`. | |
| 67 | +| `--debug LEVEL` | Enable logging at the specified level. Default level is `ERROR`. Levels include (from most to least verbose): `NOTSET`, `DEBUG`, `INFO`, WARN`, `ERROR`, `CRITICAL`. | |
| 68 | +| `--color`, `--no-color` | Enable/disable color. The validator also respects the [NO_COLOR] and [FORCE_COLOR] environment variables. | |
| 69 | + |
| 70 | +## Configuration file |
| 71 | + |
| 72 | +The schema validator accepts a JSON configuration file that reclassifies issues as |
| 73 | +warnings, errors or ignored. |
| 74 | + |
| 75 | +```json |
| 76 | +{ |
| 77 | + "ignore": [ |
| 78 | + { "code": "JSON_KEY_RECOMMENDED", "location": "/T1w.json" } |
| 79 | + ], |
| 80 | + "warning": [], |
| 81 | + "error": [ |
| 82 | + { "code": "NO_AUTHORS" } |
| 83 | + ] |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +The issues are partial matches of the [Issues] that the validator accumulates. |
| 88 | +Pass the `--json` flag to see the issues in detail. |
| 89 | + |
| 90 | +[Deno]: https://deno.com/ |
| 91 | +[Deno - Installation]: https://docs.deno.com/runtime/getting_started/installation/ |
| 92 | +[JSON]: https://www.json.org/json-en.html |
| 93 | +[BIDS Schema]: https://bidsschematools.readthedocs.io |
| 94 | +[stdin]: https://en.wikipedia.org/wiki/Standard_streams |
| 95 | +[NO_COLOR]: https://no-color.org |
| 96 | +[FORCE_COLOR]: https://force-color.org |
| 97 | +[Issues]: https://jsr.io/@bids/validator/doc/issues/~/Issue |
0 commit comments