Skip to content

fix(ignore): fallback matcher ignores nested build dirs (refs #271 Group D) - #285

Merged
Wolfvin merged 1 commit into
mainfrom
fix/codelensignore-nested-dir-fallback
Jul 14, 2026
Merged

fix(ignore): fallback matcher ignores nested build dirs (refs #271 Group D)#285
Wolfvin merged 1 commit into
mainfrom
fix/codelensignore-nested-dir-fallback

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Mengapa (subset #271 Group D)

test_codelensignore.py::TestBackwardCompat::test_actual_target_dir_is_ignored gagal (Windows+Linux): is_ignored("src/target/debug/binary.o") → False, harusnya True. Root cause di _FnmatchMatcher (matcher fallback saat pathspec TIDAK terinstall): _match_dir_prefix hanya cek ancestor root-relative, jadi pola dir non-anchored builtin (target/, build/, dist/) cuma match di ROOT, tak match nested src/target/. Rust workspace dgn nested crate → artefak build tak ter-ignore.

Catatan: hanya jalur fallback yang kena — kalau pathspec terinstall (_PathspecMatcher), gitignore-semantics sudah benar.

Perbaikan

_match_dir_prefix sekarang terima flag anchored. 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, jadi build/ TETAP tak match build-tools/, dist/ tak match dist-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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Wolfvin
Wolfvin merged commit 14eecf7 into main Jul 14, 2026
0 of 6 checks passed
@Wolfvin
Wolfvin deleted the fix/codelensignore-nested-dir-fallback branch July 14, 2026 08:09
…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>
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant