Enforce uniqueness of data files in a directory. #2071
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 statesEach 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.