Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Do explicitly "allow" for having dotfiles and explicitly ignore them #1992

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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