codeowners icon indicating copy to clipboard operation
codeowners copied to clipboard

Support for sections (Gitlab flavor)

Open neiser opened this issue 2 years ago • 2 comments

The Gitlab documentation allows to introduce sections into the CODEOWNERS such as

[README Owners]
README.md @user1 @user2
internal/README.md @user2

That enables Gitlab to show the code ownership within the UI a little bit nicer. Currently, running this tool (version 1.1.1) on such a file leads to the following error:

$ codeowners
line 1: unexpected character '[' at position 1

Would you be willing to allow support for this? Would you accept a PR for that (I haven't looked into the code yet though)

neiser avatar Nov 18 '22 13:11 neiser

I'd be open to this, but as long as it's only enabled by passing in a flag (or by detecting the CODEOWNERS file in the .gitlab directory, perhaps). As this package is designed primarily to work with GitHub CODEOWNERS files, I'd rather it defaults to erroring loudly when it encounters invalid syntax.

hmarr avatar Nov 22 '22 17:11 hmarr

Just mentioning: came here for the same reason as the author of this issue. I would be also interested in a gitlab compatible solution (supporting/ignoring these sections).

oonoo avatar Jan 12 '23 08:01 oonoo