Skip to content

Keep folders open when the ignore file takes a path back out - #3448

Merged
nojaf merged 2 commits into
fsprojects:mainfrom
nojaf:fix-ignore-thing
Aug 28, 2026
Merged

Keep folders open when the ignore file takes a path back out#3448
nojaf merged 2 commits into
fsprojects:mainfrom
nojaf:fix-ignore-thing

Conversation

@nojaf

@nojaf nojaf commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

A .fantomasignore that matches a folder has that folder closed rather than opened and rejected file by file, which is what the pattern means and is not what it can mean when a later line negates something. sub/* followed by !sub/keep is how .gitignore spells "all of it but that one", and closing sub decides that sub/keep is not there, so the line taking it back out is never reached. The files were not reported as ignored, they were never found, so --check covered a smaller scope than the ignore file describes while doctor, which asks about one file and answers correctly, disagreed with the run about that same file.

An ignore file that negates anything now leaves every folder open, which is what every version up to 8.0.0-alpha-015 did. One with no ! line in it still closes the folders it names. The question is about the file as a whole, so it is asked once per ignore file rather than once per folder the walk meets.

Fixes #3447

nojaf added 2 commits August 28, 2026 18:16
A `.fantomasignore` that matches a folder has that folder closed rather
than opened and rejected file by file, which is what the pattern means
and is not what it can mean when a later line negates something. `sub/*`
followed by `!sub/keep` is how `.gitignore` spells "all of it but that
one", and closing `sub` decides that `sub/keep` is not there, so the
line taking it back out is never reached. The files were not reported as
ignored, they were never found, so `--check` covered a smaller scope
than the ignore file describes while `doctor`, which asks about one file
and answers correctly, disagreed with the run about that same file.

An ignore file that negates anything now leaves every folder open, which
is what every version up to 8.0.0-alpha-015 did. One with no `!` line in
it still closes the folders it names. The question is about the file as
a whole, so it is asked once per ignore file rather than once per folder
the walk meets.
@nojaf
nojaf merged commit b78fb9c into fsprojects:main Aug 28, 2026
6 checks passed
@nojaf
nojaf deleted the fix-ignore-thing branch August 28, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.fantomasignore negation is ignored when an earlier pattern excludes the parent directory

1 participant