bids-validator
bids-validator copied to clipboard
Enforce uniqueness of data files in a directory.
https://bids-specification.readthedocs.io/en/stable/common-principles.html#uniqueness-of-data-files fixes #1107
Added in src/valdiators/filenameValidate.ts. This check sees if another file exists in the parent directory of the context that has the contexts exact entities and sufiix but a different valid (non-sidecar) extension from the rules.files.* rule that the context matched.
Unfortunately there is a problem with relying on the rules.files.*. It does not state which extensions are mutually exclusive. One ieeg format for instance states Each recording consists of a .vhdr, .vmrk, .eeg file triplet as valid:
https://bids-specification.readthedocs.io/en/stable/modality-specific-files/intracranial-electroencephalography.html#ieeg-recording-data
https://github.com/bids-standard/bids-specification/blob/master/src/schema/rules/files/raw/ieeg.yaml
Maintaing list of sidecar extensions in filenameValidate.ts is no good and should probably be pulled from the schema if possible.