Skip to content

Files

Latest commit

 Cannot retrieve latest commit at this time.

History

History
99 lines (76 loc) · 4.66 KB

command-line.md

File metadata and controls

99 lines (76 loc) · 4.66 KB

Using the command line

The BIDS Validator may be run with the Deno runtime. For detailed installation instructions, see Deno - Installation. Deno is also available as a conda-forge package.

Installation

In general, there is no need to install Deno applications. deno run allows running from the Javascript Repository:

deno run -ERWN jsr:@bids/validator <dataset>

However, you can also install a lightweight script (into $HOME/.deno/bin):

deno install -ERWN -g -n bids-validator jsr:@bids/validator

Or compile a bundled binary:

deno compile -ERWN -o bids-validator jsr:@bids/validator

Usage

The BIDS Validator takes a single dataset as input:

::::{tab-set} :sync-group: run-method

:::{tab-item} Deno run :sync: run

deno run -ERWN jsr:@bids/validator <dataset>

::: :::{tab-item} Installed :sync: install

bids-validator <dataset>

::: ::::

Options

Option Description
-v, --verbose Log more extensive information about issues
-s URL, --schema URL Specify an alternative BIDS Schema for validation
-c FILE, --config FILE Provide a configuration file
-r, --recursive Validate datasets found in derivatives/ subdirectories, recursively
-o FILE, --outfile FILE Write validation results to file.
--json Output results in machine-readable JSON
--ignoreWarnings Do not report warnings
--ignoreNiftiHeaders Do not open NIfTI files, skipping any checks that rely on NIfTI header data
--filenameMode Perform filename checks only on newline-separated filenames read from stdin
--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.
--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.
--color, --no-color Enable/disable color. The validator also respects the NO_COLOR and FORCE_COLOR environment variables.

Configuration file

The schema validator accepts a JSON configuration file that reclassifies issues as warnings, errors or ignored.

{
  "ignore": [
    { "code": "JSON_KEY_RECOMMENDED", "location": "/T1w.json" }
  ],
  "warning": [],
  "error": [
    { "code": "NO_AUTHORS" }
  ]
}

When a configuration specifies location without leading / it is interpreted as a glob pattern following gitignore syntax. The issues are partial matches of the Issues that the validator accumulates. Pass the --json flag to see the issues in detail.