codeowners icon indicating copy to clipboard operation
codeowners copied to clipboard

Does not show correct results for file path including leading ./

Open jeffgran-dox opened this issue 1 year ago • 3 comments

Title says it all.

If you run codeowners ./src/file.go it will always hit a * rule, or just (unowned) if there is no * rule.

Whereas codeowners src/file.go will correctly match a rule that covers this file/directory.

jeffgran-dox avatar Mar 23 '23 18:03 jeffgran-dox

I'm seeing this too. First rule in my CODEOWNERS is a * rule. Succeeding rules have more specific rules and override the first rule.

jhaxon avatar Feb 23 '24 16:02 jhaxon

from the docs

Order is important; the last matching pattern takes the most precedence. When someone opens a pull request that only modifies JS files, only @js-owner and not the global owner(s) will be requested for a review.

I will take a stab at this

rwese avatar May 31 '24 08:05 rwese

There is an issue with how * and /... paths are handled.

Fixing the * is easy, but I need to readup on the path handling for gitignores to not break the intended compatibility, since I assume there is a reason for the current solution.

rwese avatar May 31 '24 12:05 rwese