From 62a2e214349b9847fd32a85c8b706e7ca8f96c8e Mon Sep 17 00:00:00 2001 From: Bortlesboat <169967362+Bortlesboat@users.noreply.github.com> Date: Sun, 25 Oct 2026 22:27:19 -0400 Subject: [PATCH 1/2] Match paths with a leading ./ --- match.go | 3 +++ testdata/patterns.json | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/match.go b/match.go index 69fcd05..71176e0 100644 --- a/match.go +++ b/match.go @@ -35,6 +35,9 @@ func (p pattern) match(testPath string) (bool, error) { // Normalize Windows-style path separators to forward slashes testPath = filepath.ToSlash(testPath) + // Paths are relative to the repository root, so "./foo" is the same as "foo" + testPath = strings.TrimPrefix(testPath, "./") + if p.leftAnchoredLiteral { prefix := p.pattern diff --git a/testdata/patterns.json b/testdata/patterns.json index 1006cea..c7c41c2 100644 --- a/testdata/patterns.json +++ b/testdata/patterns.json @@ -331,5 +331,22 @@ "vllm/v1/worker/^cpu": true, "vllm/v1/worker/cpu": false } + }, + { + "name": "paths with leading dot-slash", + "pattern": "/foo/", + "paths": { + "./foo/bar": true, + "./bar/foo/baz": false + } + }, + { + "name": "unanchored pattern with leading dot-slash path", + "pattern": "*.txt", + "paths": { + "./foo.txt": true, + "./foo/bar.txt": true, + "./foo.go": false + } } ] \ No newline at end of file From 3e0d9e5810aeecf5e32b504ad2c12242d580c5eb Mon Sep 17 00:00:00 2001 From: Bortlesboat <169967362+Bortlesboat@users.noreply.github.com> Date: Mon, 26 Oct 2026 08:40:00 -0400 Subject: [PATCH 2/2] Test anchored wildcard pattern with leading dot-slash --- testdata/patterns.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testdata/patterns.json b/testdata/patterns.json index c7c41c2..d4cc9c3 100644 --- a/testdata/patterns.json +++ b/testdata/patterns.json @@ -341,12 +341,11 @@ } }, { - "name": "unanchored pattern with leading dot-slash path", - "pattern": "*.txt", + "name": "anchored wildcard pattern with leading dot-slash path", + "pattern": "/src/*.go", "paths": { - "./foo.txt": true, - "./foo/bar.txt": true, - "./foo.go": false + "./src/a.go": true, + "./lib/src/a.go": false } } ] \ No newline at end of file