Skip to content

Commit

Permalink
Merge pull request #1992 from yarikoptic/enh-dotfiles
Browse files Browse the repository at this point in the history
[ENH] Do explicitly "allow" for having dotfiles and explicitly ignore them
  • Loading branch information
effigies authored Dec 18, 2024
2 parents 448b37d + add68fc commit ce0dca0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ as the labels would collide on a case-insensitive filesystem.
Additionally, because the suffix `eeg` is defined,
then the suffix `EEG` will not be added to future versions of the standard.

### Dotfiles

Files and directories starting with a dot (`.`) are reserved for system use and no valid recognized BIDS file or directory can start with a `.`.
Any file or directory starting with a `.` present in a BIDS dataset is considered hidden and not subject to BIDS validation.

## Uniqueness of data files

Data files MUST be uniquely identified by BIDS path components
Expand Down
4 changes: 3 additions & 1 deletion tools/schemacode/src/bidsschematools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def pre_receive_hook(schema, input_, output):
logger.debug("Validating files, first file: %s", filename)
any_files = True
filename = filename.strip()
if any(_bidsignore_check(pattern, filename, "") for pattern in ignore):
if filename.startswith(".") or any(
_bidsignore_check(pattern, filename, "") for pattern in ignore
):
continue
if not any(re.match(regex, filename) for regex in regexes):
print(filename, file=output)
Expand Down

0 comments on commit ce0dca0

Please sign in to comment.