Skip to content

Commit 7362964

Browse files
committed
fix: Ensure dotfiles are always filtered
1 parent 882aaa3 commit 7362964

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bids/layout/validation.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@
3232

3333
DEFAULT_LOCATIONS_TO_IGNORE = {
3434
re.compile(r"^/(code|models|sourcedata|stimuli)"),
35-
re.compile(r'/\.'),
3635
}
3736

37+
ALWAYS_IGNORE = (
38+
re.compile(r'/\.'), # dotfiles should never be indexed
39+
)
40+
3841
def absolute_path_deprecation_warning():
3942
warnings.warn("The absolute_paths argument will be removed from PyBIDS "
4043
"in 0.14. You can easily access the relative path of "
@@ -160,6 +163,8 @@ def validate_indexing_args(ignore, force_index, root):
160163
DEFAULT_LOCATIONS_TO_IGNORE - set(force_index or [])
161164
)
162165

166+
ignore.extend(ALWAYS_IGNORE)
167+
163168
# root has already been validated to be a directory
164169
ignore = _sort_patterns(ignore, root)
165170
force_index = _sort_patterns(force_index or [], root)

0 commit comments

Comments
 (0)