|
| 1 | +.. _dandi_validate: |
| 2 | + |
1 | 3 | :program:`dandi validate` |
2 | 4 | ========================= |
3 | 5 |
|
4 | 6 | :: |
5 | 7 |
|
6 | | - dandi [<global options>] validate [<path> ...] |
| 8 | + dandi [<global options>] validate [<options>] [<path> ...] |
7 | 9 |
|
8 | 10 | Validate files for data standards compliance. |
9 | 11 |
|
10 | 12 | Exits with non-zero exit code if any file is not compliant. |
11 | 13 |
|
| 14 | +The validation results are automatically saved as a JSON Lines companion file |
| 15 | +next to the dandi-cli log file (unless :option:`--output` is used or |
| 16 | +:option:`--load` is active). Use :option:`--load` to re-render saved results |
| 17 | +later with different grouping, filtering, or format options. |
| 18 | + |
12 | 19 | Options |
13 | 20 | ------- |
14 | 21 |
|
15 | | -.. option:: -g, --grouping [none|path] |
| 22 | +.. option:: -g, --grouping [none|path|severity|id|validator|standard|dandiset] |
16 | 23 |
|
17 | | - Set how to group reported errors & warnings: by path or not at all |
18 | | - (default) |
| 24 | + How to group the reported results. Repeat the option for hierarchical |
| 25 | + nesting, e.g., ``-g severity -g id``. [default: ``none``] |
19 | 26 |
|
20 | 27 | .. option:: --ignore REGEX |
21 | 28 |
|
22 | | - Ignore any validation errors & warnings whose ID matches the given regular |
| 29 | + Ignore any validation results whose ID matches the given regular |
23 | 30 | expression |
24 | 31 |
|
25 | | -.. option:: --min-severity [HINT|WARNING|ERROR] |
| 32 | +.. option:: --min-severity [INFO|HINT|WARNING|ERROR|CRITICAL] |
| 33 | + |
| 34 | + Only display results with severities at or above this level [default: |
| 35 | + ``HINT``] |
| 36 | + |
| 37 | +.. option:: -f, --format [text|json|json_pp|json_lines|yaml] |
| 38 | + |
| 39 | + Output format [default: ``text``] |
| 40 | + |
| 41 | +.. option:: -o, --output <file> |
| 42 | + |
| 43 | + Write the output to the given file instead of standard output. This |
| 44 | + requires a structured :option:`--format`; if none is given, the format is |
| 45 | + inferred from the file's extension (``.json``, ``.jsonl``, ``.yaml``, or |
| 46 | + ``.yml``). :option:`--grouping` cannot be combined with the ``json_lines`` |
| 47 | + format. |
| 48 | + |
| 49 | +.. option:: --summary, --no-summary |
| 50 | + |
| 51 | + Whether to show summary statistics (counts of results by severity, |
| 52 | + validator, and standard) after the results [default: ``--no-summary``] |
| 53 | + |
| 54 | +.. option:: --max-per-group N |
| 55 | + |
| 56 | + Limit the number of results shown per group (or in total when not |
| 57 | + grouping); the excess is replaced by a count of omitted results |
| 58 | + |
| 59 | +.. option:: --missing-file-content [error|only-non-data|skip] |
| 60 | + |
| 61 | + How to handle files whose content is unavailable, such as the broken |
| 62 | + symbolic links of a DataLad_ dataset (a git-annex_ repository) whose |
| 63 | + content has not been fetched: |
| 64 | + |
| 65 | + ``error`` |
| 66 | + Emit a concise ``DANDI.FILE_CONTENT_MISSING`` error for each such file |
| 67 | + (default) |
| 68 | + |
| 69 | + ``skip`` |
| 70 | + Skip each such file, emitting a warning |
| 71 | + |
| 72 | + ``only-non-data`` |
| 73 | + Skip content-dependent validators (pynwb, nwbinspector, ...) for each |
| 74 | + such file but still validate its path layout |
| 75 | + |
| 76 | +.. option:: --load <file> |
| 77 | + |
| 78 | + Instead of running validation, load previously saved results from the |
| 79 | + given JSON Lines file (e.g., an automatically saved companion file) and |
| 80 | + render them. Can be specified multiple times; cannot be combined with |
| 81 | + paths. |
26 | 82 |
|
27 | | - Only display issues with severities above this level (HINT by default) |
| 83 | +.. _DataLad: https://www.datalad.org |
| 84 | +.. _git-annex: https://git-annex.branchable.com |
28 | 85 |
|
29 | 86 |
|
30 | 87 | Development Options |
|
0 commit comments