diff --git a/parse.go b/parse.go index 4d33150..dedc19a 100644 --- a/parse.go +++ b/parse.go @@ -175,7 +175,7 @@ func isAlphanumeric(ch rune) bool { // isPatternChar matches characters that are allowed in patterns func isPatternChar(ch rune) bool { switch ch { - case '*', '?', '.', '/', '@', '_', '+', '-', '\\': + case '*', '?', '.', '/', '@', '_', '+', '-', '\\', '(', ')': return true } return isAlphanumeric(ch) diff --git a/parse_test.go b/parse_test.go index 8f4ac8f..9a2d283 100644 --- a/parse_test.go +++ b/parse_test.go @@ -208,6 +208,15 @@ func TestParseRule(t *testing.T) { trailingComment: "", }}, }, + { + name: "pattern with parentheses (Next.js route groups)", + rule: "src/app/(nonauth)/forgot/**/* @user", + expected: []Rule{{ + SourceLine: 1, + pattern: mustBuildPattern(t, "src/app/(nonauth)/forgot/**/*"), + Owners: []string{"@user"}, + }}, + }, // Error cases