Skip to content

Document gitignore inputs that raise despite being accepted by Git - #148

Closed
rupayon123 wants to merge 1 commit into
cpburnz:masterfrom
rupayon123:contribution/document-invalid-patterns-20260922
Closed

rupayon123 wants to merge 1 commit into
cpburnz:masterfrom
rupayon123:contribution/document-invalid-patterns-20260922

Conversation

@rupayon123

Copy link
Copy Markdown

Document the GitIgnorePatternError boundary on both supported pattern_to_regex methods: a bare ! (including trailing unescaped spaces) and an unmatched trailing backslash raise rather than producing a no-op. Git accepts these lines without a diagnostic, so a caller cannot assume that a Git-readable ignore file is exception-free for pathspec.

This addresses the documentation-only request in #146 and its follow-up, preserving runtime behavior and the existing exception contract. It does not overlap #143's proposed behavior change.

Validation:

  • Executed each example against both current parser classes and checked blank/comment controls.
  • Verified Git accepts the examples without diagnostics using git check-ignore --no-index in an isolated repository.
  • python -m unittest discover -t . -s tests/ succeeds: 221 tests run, 379 skipped cases/subtests for unavailable optional backends/platform conditions.
  • Strict Sphinx HTML build (-aWEnqb html) passes; both API sections contain the new text and exception links.
  • git diff --check passes. Optional native regex backends were not installed or tested.

Prepared with OpenAI Codex assistance.

@cpburnz cpburnz added the To-Do Planned feature that needs to be done. label Sep 25, 2026
@cpburnz

cpburnz commented Sep 27, 2026

Copy link
Copy Markdown
Owner

#143 and #146 have been fixed. In the course of fixing those, I've lightly documented when exceptions are raised in pattern_to_regex().

@cpburnz cpburnz closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To-Do Planned feature that needs to be done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants