Skip to content

Conversation

@perryqh
Copy link
Contributor

@perryqh perryqh commented Dec 19, 2024

rubyatscale/code_ownership#109

The problem

The special characters * and ( default sort order is ( and then *.

The last matching pattern in the CODEOWNERS file is used to determine file ownership.

Example from our super-large-mono-repo:

/directory/owner/(my_folder)/**/** has an assigned order of foo
/directory/owner/** has an assigned order of bar

Default sorting would place the /directory/owner/** line last giving it precedence, but /directory/owner/(my_folder)/**/** is more specific and should have precedence.

Fix

Customize CODEOWNERS line sorting to have a special case for lines containing ** characters.

Copy link

@ashleywillard ashleywillard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perryqh perryqh merged commit 361cda6 into main Dec 19, 2024
9 checks passed
@perryqh perryqh deleted the ph/sorting-parity branch September 9, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants