Skip to content

fix: enforce literal path separator in coverage_exclude globs#1

Open
AACasado wants to merge 1 commit into
aescariom:developfrom
AACasado:fix/coverage-exclude-glob-separator
Open

fix: enforce literal path separator in coverage_exclude globs#1
AACasado wants to merge 1 commit into
aescariom:developfrom
AACasado:fix/coverage-exclude-glob-separator

Conversation

@AACasado
Copy link
Copy Markdown

@AACasado AACasado commented May 21, 2026

glob::Pattern::matches() uses MatchOptions::default() where
require_literal_separator is false, so '' silently crosses '/'
boundaries. A pattern like 'foo/
.java' was matching files in
foo/bar/, foo/bar/baz/, etc., silently excluding entire subtrees.

Introduces a glob_match_strict() helper used by all six coverage_exclude
call sites (selector, exclusion counter, cleanup pass, retry pass,
per-file safety net, and worktree parallel path).

Reproduced on a Java repo where 'com/package/name/model/*.java'
swallowed model/enums/, model/dto/, model/name/, leaving 0 candidates
when ~56 were expected.

glob::Pattern::matches() uses MatchOptions::default() where
require_literal_separator is false, so '*' silently crosses '/'
boundaries. A pattern like 'foo/*.java' was matching files in
foo/bar/, foo/bar/baz/, etc., silently excluding entire subtrees.

Introduces a glob_match_strict() helper used by all six coverage_exclude
call sites (selector, exclusion counter, cleanup pass, retry pass,
per-file safety net, and worktree parallel path).

Reproduced on a Java repo where 'com/package/name/model/*.java'
swallowed model/enums/, model/dto/, model/name/, leaving 0 candidates
when ~56 were expected.
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