-
Notifications
You must be signed in to change notification settings - Fork 2.8k
docs: gooseignore negation patterns #6929
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
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Documents negation (!) pattern support in .gooseignore, including how local ignore files can override global rules and when default ignore patterns apply.
Changes:
- Adds a “Negation Patterns” section with examples and guidance on pattern order.
- Clarifies global → local pattern application order and how local rules can override global ones via negation.
- Explains that default ignore patterns apply only when no
.gooseignorefiles exist, with an explicit info callout.
|
|
||
| # Ignore the entire config directory | ||
| config/ | ||
|
|
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example config/ then !config/template.json is likely to still prevent discovery during directory traversal because the config/ directory itself remains ignored; to make the exception work reliably, also unignore the directory (e.g., add a !config/ rule) or adjust the example text to clarify the limitation.
| # Re-allow the config directory so specific files can be included | |
| !config/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During testing, we found that directory-based negation patterns (e.g., config/ followed by !config/template.json) don't work in the current implementation. The is_ignored() function always passes false for the is_dir parameter when checking paths, so directory patterns are never properly matched. We use file glob patterns (like config/*.json) instead
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Harrison <hcstebbins@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This PR documents negation pattern support in
.gooseignorefiles.Documentation updates:
documentation/docs/guides/using-gooseignore.md:!prefix syntax and cross-file negation capability.gooseignorecan override global patterns (e.g.,!.env.exampleoverriding**/.env*).gooseignorefiles existType of Change
AI Assistance
Testing
Manual testing:
!.env.exampleoverrides global**/.env*)