Skip to content
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

Merged
merged 11 commits into from
Apr 17, 2024
Merged

Update CLI to parse code owners #53

merged 11 commits into from
Apr 17, 2024

Conversation

Copy link

trunk-staging-io bot commented Apr 16, 2024

💊 0 quarantined ✅ 10 passed 🕐 10 new ⋅ (learn more)

docs ⋅ learn more about trunk.io

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()));
Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Base automatically changed from riya/codeowners to main April 17, 2024 00:25
@riya-n riya-n merged commit cd2e2d5 into main Apr 17, 2024
5 checks passed
@riya-n riya-n deleted the riya/owners branch April 17, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants