Open
Description
Problem
CODEOWNERS patterns fail to match file paths containing square brackets, which are commonly used in modern web frameworks (Next.js, Nuxt.js) for dynamic routes.
Minimal Reproduction
Example 1: File with square brackets
project/
├── pages/
│ ├── index.js
│ └── users/
│ └── [userId].js
└── CODEOWNERS
CODEOWNERS file:
/pages/users/[userId].js @team
Expected Behavior:
The file /pages/users/[userId].js should be owned by @team
Error Produced:
$ codeowners
line 1: unexpected character '[' at position 13
Example 2: Directory with square brackets:
project/
├── pages/
│ ├── index.js
│ └── [userId]/
│ ├── index.js
│ └── details.js
└── CODEOWNERS
CODEOWNERS file:
pages/[userId]/index.js @team1
pages/[userId]/details.js @team2
Expected Behavior:
The file pages/[userId]/index.js should be owned by @team1
The file pages/[userId]/details.js should be owned by @team2
Error Produced:
$ codeowners
line 1: unexpected character '[' at position 7
Metadata
Metadata
Assignees
Labels
No labels