codeowners
codeowners copied to clipboard
Invalid codeowners should be filtered out
e.g. if a file has a codeowners like:
a/** cool-team # TODO: change
this library spits out 4 code owners: cool-team
, #
, TODO:
and change
. While nothing can be done for change
at least #
is a known invalid codeowner
afaik, You can't have comments on rule lines, so this would actually be invalid. You'd have to write:
# TODO: change
a/** @cool-team
Further more, you'd need the @ sign for GitHub and GitLab to handle the team/username correctly.
See:
- https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
- https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
For invalid syntax, perhaps the library should indicate that and/or fail rather than continuing to parse the invalid data and generating invalid codeowners.