bids-standard / bids-validator

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

CLI --config flag does not find relative paths? #1165

Open sappelhoff opened 3 years ago

sappelhoff commented 3 years ago

Came up in https://github.com/bids-standard/bids-examples/issues/229#issuecomment-774096886 related: https://github.com/bids-standard/bids-validator/issues/1129

Trying to run bids-validator eeg_matchingpennies/ -c bidsconfig.json from the root of a cloned bids-examples repository results in an error.

Same issue if I specify ./bidsconfig.json

Running bids-validator eeg_matchingpennies/ -c $PWD/bidsconfig.json however works. (See the prepended $PWD)

I feel like all of the options I named here should work.


separate question: Didn't we have the option once to even specify a string? Something like bids-validator eeg_matchingpennies/ --config '{ "ignore": [99] }' ? I think that'd be helpful sometimes.

sappelhoff commented 3 years ago

separate question: Didn't we have the option once to even specify a string? Something like bids-validator eeg_matchingpennies/ --config '{ "ignore": [99] }' ? I think that'd be helpful sometimes.

aah found it:

https://github.com/bids-standard/bids-validator/blob/970921cbf2e3e85df195ca16f63ee460c588e596/bids-validator/README.md#L241-L248

but it's annoying because one MUST specify at least two "ignores" to end up with an array, seems like an easy to solve issue.

See: https://github.com/bids-standard/bids-validator/issues/802

yarikoptic commented 5 days ago

interestingly, for me legacy one does not care at all about the absent config file -- e.g.

 ~/datasets/1076_spacetop  master !1 ▓▒░──
❯ podman run -it --rm -v "${HOME}:${HOME}:ro" -v "${PWD}:${PWD}:ro" -w "${PWD}" bids/validator --config nonexisting .
bids-validator@1.14.13
(node:1) Warning: Closing directory handle on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
    1: [ERR] A json sidecar file was found without a corresponding data file (code: 90 - SIDECAR_WITHOUT_DATAFILE)
        ./sub-0001/ses-01/fmap/sub-0001_ses-01_acq-96dirX6b0Xmb_dir-ap_epi.json
        ./sub-0001/ses-01/func/sub-0001_ses-01_task-alignvideo_acq-mb8_run-01_bold.json
...