Skip to content

Conversation

@dianed-square
Copy link
Contributor

@dianed-square dianed-square commented Feb 3, 2026

Summary

This PR documents negation pattern support in .gooseignore files.

Documentation updates:

  • documentation/docs/guides/using-gooseignore.md:
    • Add "Negation Patterns" section explaining ! prefix syntax and cross-file negation capability
    • Update "Ignore File Types and Priority" section to clarify pattern processing order (global → local)
    • Add concrete example showing how local .gooseignore can override global patterns (e.g., !.env.example overriding **/.env*)
    • Clarify that default patterns only apply when no .gooseignore files exist
    • Update tip box to explain that local patterns can override global ones using negation

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Manual testing:

  • ✅ Verified cross-file negation works (local !.env.example overrides global **/.env*)
  • ✅ Verified default patterns only apply when no ignore files exist

@dianed-square dianed-square requested a review from a team as a code owner February 3, 2026 21:16
Copilot AI review requested due to automatic review settings February 3, 2026 21:16
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-03 22:57 UTC

Copy link
Contributor

Copilot AI left a 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 .gooseignore files exist, with an explicit info callout.


# Ignore the entire config directory
config/

Copy link

Copilot AI Feb 3, 2026

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.

Suggested change
# Re-allow the config directory so specific files can be included
!config/

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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>
Copilot AI review requested due to automatic review settings February 3, 2026 22:09
Copy link
Contributor

Copilot AI left a 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.

@dianed-square dianed-square added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit adc7732 Feb 3, 2026
20 checks passed
@dianed-square dianed-square deleted the docs/gooseignore-negation-patterns branch February 3, 2026 22:54
zanesq added a commit that referenced this pull request Feb 4, 2026
* 'main' of github.com:block/goose:
  docs: ovhcloud provider (#6932)
  Allow building with CUDA as the candle backend (#6914)
  docs: gooseignore negation patterns (#6929)
stebbins pushed a commit to stebbins/goose that referenced this pull request Feb 4, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Harrison <hcstebbins@gmail.com>
kuccello pushed a commit to kuccello/goose that referenced this pull request Feb 7, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants