In order for this to work without having to tell the plugin where the root is, I detect the root by recursively going up a level until a file CODEOWNERS or docs/CODEOWNERS or .gitlab/CODEOWNERS is found then stop. According to gitlab's rule, if multiple are found, it will use only the first one in the order I wrote.
Problem is if you are in docs/ and run this in a repo with /docs/CODEOWNERS, the plugin will wrongly assume that the root is /docs/ instead of the intended / (with docs/CODEOWNERS) and messes up everything. Rules that should apply to files in docs might not work now.
In order for this to work without having to tell the plugin where the root is, I detect the root by recursively going up a level until a file
CODEOWNERSordocs/CODEOWNERSor.gitlab/CODEOWNERSis found then stop. According to gitlab's rule, if multiple are found, it will use only the first one in the order I wrote.Problem is if you are in
docs/and run this in a repo with/docs/CODEOWNERS, the plugin will wrongly assume that the root is/docs/instead of the intended/(withdocs/CODEOWNERS) and messes up everything. Rules that should apply to files in docs might not work now.