-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CLI to parse code owners #53
Conversation
💊 0 quarantined ✅ 10 passed 🕐 10 new ⋅ (learn more) |
src/scanner.rs
Outdated
@@ -58,6 +58,9 @@ impl FileSet { | |||
glob_path.clone() | |||
}; | |||
|
|||
// Parse codeowners. | |||
let codeowners = codeowners::locate(".").map(|path| codeowners::from_path(path.as_path())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to have a list of possible directories for the CODEOWNERS
file (e.g., .github/
) instead of searching through everything - not great for big repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For GitHub CODEOWNERS file location: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location
Bitbucket: https://confluence.atlassian.com/bitbucketserver/code-owners-1296171116.html
GitLab: https://docs.gitlab.com/ee/user/project/codeowners/#codeowners-file
Given the docs above, we could first try searching for the CODEOWNERS
file in a list of directories like .github/
, .bitbucket/
, .gitlab/
, docs/
and only searching in "."
if we haven't found a file as yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's look in those 4 directories and have a manual override if you are doing something else. I want to avoid scanning the file system as much as possible.
https://linear.app/trunk/issue/TRUNK-10994/update-cli-to-parse-code-owners
tested here: https://github.com/trunk-io/analytics-cli/actions/runs/8700187796/job/23860008954