enumerate: include globs ignore ** (mismatch with exclude semantics) #32

Open
opened 2026-06-08 16:38:26 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-06-08 16:38:26 +00:00 (Migrated from github.com)

Found during full-codebase review (see docs/review/02-audit-policy-resolve.md). Blocker for #29 (the init wizard teaches glob authoring and must validate against the real matcher).

[HIGH] internal/enumerate/enumerate.go (~268-282): includes use filepath.Match, which has no ** support, while excludes use go-gitignore (which does). So include: ["src/**"] matches src/x.go but not src/sub/x.go, and **/generated/** matches nothing — yet the config layer documents and round-trips these exact patterns. TestMatchesIncludes asserts the broken single-segment behavior, locking in the bug.

Fix: make includes use the same gitignore-style matcher as excludes; remove the test that enshrines the broken behavior.

Found during full-codebase review (see docs/review/02-audit-policy-resolve.md). **Blocker for #29** (the init wizard teaches glob authoring and must validate against the real matcher). **[HIGH]** `internal/enumerate/enumerate.go` (~268-282): includes use `filepath.Match`, which has no `**` support, while excludes use go-gitignore (which does). So `include: ["src/**"]` matches `src/x.go` but not `src/sub/x.go`, and `**/generated/**` matches nothing — yet the config layer documents and round-trips these exact patterns. `TestMatchesIncludes` asserts the broken single-segment behavior, locking in the bug. Fix: make includes use the same gitignore-style matcher as excludes; remove the test that enshrines the broken behavior.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/license-tool#32