Repository navigation
fix: include-list review fixes — last-match negation, empty file, shared helper - #349
Merged
Merged
Conversation
…red helper Review findings on the .codesearchinclude feature (PR #346): - !-rules were dead under a decisively-included ancestor: the component loop returned at the FIRST decisive match, so src/ + !src/gen.rs still indexed gen.rs while the docs promise last-match-wins. The loop now tracks the last decisive match and decides after it. - a present-but-empty (comments-only) .codesearchinclude built a matcher with zero rules and indexed NOTHING, contradicting the shipped 'absent or empty = historical behavior' claim. A zero-rule build is now inactive (num_ignores + num_whitelists both zero). - the include semantics existed as two ~45-line copies (walker + watcher); the watcher now delegates to the shared pub(crate) helpers in file/mod.rs so the two gates cannot drift. - two new pins: ancestor+negation un-includes, present-but-empty indexes everything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three review findings on the .codesearchinclude feature (PR #346), all confirmed against the code:
!-rules were dead under a decisively-included ancestor. The component loop returned at the FIRST decisive match, sosrc/+!src/gen.rsstill indexedgen.rs— while the code comments, the CHANGELOG bullet and the commit message all promise "last match along the component chain wins". The loop now tracks the last decisive match and decides after it (root-level negation already worked; ancestor+negation is now pinned by a new test)..codesearchincludeindexed NOTHING. A zero-rule matcher answersMatch::Nonefor every path, silently emptying the index — contradicting the shipped "absent or empty list keeps the historical behavior" claim. A zero-rule build is now treated as inactive (num_ignores()+num_whitelists()both zero), pinned by a new test.pub(crate)helpers infile/mod.rs— the two gates can no longer drift.Validation: fmt clean, clippy
--all-targets -D warningsclean,cargo test --lib --binsgreen (941 tests, incl. the 2 new pins).