docs: gooseignore negation patterns#6929
Conversation
|
There was a problem hiding this comment.
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/ | ||
|
|
There was a problem hiding this comment.
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.
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>
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*)