fix(ignore): fallback matcher ignores nested build dirs (refs #271 Group D) - #285
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…y depth (refs #271) _FnmatchMatcher (used when pathspec is absent) only matched non-anchored dir patterns (target/, build/, dist/) at the workspace root, so nested build dirs like src/target/debug were not ignored. Match non-anchored dir patterns against every sub-path at segment boundaries — whole-segment, so build/ still does not match build-tools/. Fixes test_actual_target_dir_is_ignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
4 tasks
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.



Mengapa (subset #271 Group D)
test_codelensignore.py::TestBackwardCompat::test_actual_target_dir_is_ignoredgagal (Windows+Linux):is_ignored("src/target/debug/binary.o")→ False, harusnya True. Root cause di_FnmatchMatcher(matcher fallback saatpathspecTIDAK terinstall):_match_dir_prefixhanya cek ancestor root-relative, jadi pola dir non-anchored builtin (target/,build/,dist/) cuma match di ROOT, tak match nestedsrc/target/. Rust workspace dgn nested crate → artefak build tak ter-ignore.Catatan: hanya jalur fallback yang kena — kalau
pathspecterinstall (_PathspecMatcher), gitignore-semantics sudah benar.Perbaikan
_match_dir_prefixsekarang terima flaganchored. Untuk pola non-anchored: match kalau ada sub-path (di batas segmen) yang cocok — menangani single-segment (target/→src/target/x) DAN multi-segment (build/keep/→build/keep/x). Whole-segment, jadibuild/TETAP tak matchbuild-tools/,dist/tak matchdist-app/(guard tests existing).Verifikasi
test_codelensignore.py→ 83 passed (target test lolos; negation/override/build-tools/dist-app guards TETAP lolos). Iterasi pertama (segment-only) sempat merusak 3 test negasi multi-segment — ketahuan suite, diperbaiki jadi sub-path-at-boundary.Menutup 1 item test-design/bug #271 Group D.