bids-standard / bids-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/bids-validator/
MIT License
177 stars 107 forks source link

deno validator: --filenameMode still wants dataset path and then seems to do more than just paths validation #2010

Open yarikoptic opened 1 week ago

yarikoptic commented 1 week ago
(deno) yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ git ls-tree -r --name-only HEAD | /home/yoh/proj/bids/bids-validator/bids-validator/./bids-validator-deno --filenameMode
A new release of Deno is available: 1.44.3 → 1.44.4 Run `deno upgrade` to install it.

Usage:   bids-validator <dataset_directory>
Version: v1.14.7-dev.0-68-g53fdba69

Description:

  This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about
  Brain Imaging Data Structure visit http://bids.neuroimaging.io

Options:

  -h, --help                    - Show this help.
  -V, --version                 - Show the version number for this program.
  --json                        - Output machine readable JSON
  -s, --schema          <type>  - Specify a schema version to use for validation                          (Default: "latest")
  -v, --verbose                 - Log more extensive information about issues
  --ignoreNiftiHeaders          - Disregard NIfTI header content during validation
  --debug               <type>  - Enable debug output                                                     (Default: "ERROR", Values: "NOTSET", "DEBUG", "INFO",
                                                                                                          "WARN", "ERROR", "CRITICAL")
  --filenameMode                - Enable filename checks for newline separated filenames read from stdin

  error: Missing argument(s): dataset_directory

and from the --filenameMode - Enable filename checks for newline separated filenames read from stdin it sounds like it should not require dataset path. MAy be I also misunderstood the purpose -- is this option to restrict the set of files to validate for? or operate only on file names? (@effigies mentioned that mode)

nellh commented 1 week ago

We use the filename mode to implement the OpenNeuro git hook but it does look broken in the Deno validator. It should skip reading local files and validate filenames from stdin.