-
Notifications
You must be signed in to change notification settings - Fork 16
Description
It was my understanding that the .bidsignore follows .gitignore syntax, but the behavior is different regarding trailing slashes. IMO it would be nice if it followed the .gitignore syntax exactly, but I think we would be sufficient if we just document the behavior as-is.
Should it be in this repo or one of the others (maybe https://github.com/bids-standard/bids-specification)?
tldr:
.bidsignore does NOT work with trailing slashes (different from .gitignore)
.bidsignore does NOT work with trailing slashes+wildcard (this might make sense, because git wouldnt track empty dirs but bids-validation does?)
Current docs
I saw a mention of bidsignore as "following the .gitignore rules" on non-official sites
https://neuroimaging-core-docs.readthedocs.io/en/latest/pages/bids-validator.html#creating-a-bidsignore
I didn't see anything in the official docs
- current: https://bids-specification.readthedocs.io/en/stable/
- legacy: https://bids.neuroimaging.io/index.html
- bids-validator: https://bids-validator.readthedocs.io/en/stable/index.html
However I was surprised to discover that .bidsignore does NOT follow .gitignore syntax, though it is similar.
.gitignore
/leadingslash
trailingslash/
/leadingandtrailingslash/
regulardir
regulardircontents/*
.bidsignore
/leadingslash
trailingslash/
/leadingandtrailingslash/
regulardir
regulardircontents/*
I also created a fake dataset description.
Result
bids-validator-deno . -v
<snip>...
[ERROR] NOT_INCLUDED Files with such naming scheme are not part of BIDS specification. This error is most commonly caused by typos in file names that make them not BIDS compatible. Please consult the specification and make sure your files are named correctly. If this is not a file naming issue (for example when including files not yet covered by the BIDS specification) you should include a ".bidsignore" file in your dataset (see https://github.com/bids-standard/bids-validator#bidsignore for details). Please note that derived (processed) data should be placed in /derivatives folder and source data (such as DICOMS or behavioural logs in proprietary formats) should be placed in the /sourcedata folder.
/trailingslash/
/leadingandtrailingslash/
/regulardircontents/
Note: I found it a little surprising/confusing that the error includes a leading slash.
git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
.bidsignore
.gitignore
dataset_description.json
logs/