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

modularize github codeowners parsing code #102

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

dfrankland
Copy link
Member

@dfrankland dfrankland commented Sep 23, 2024

This sets us up to create a common interface to each CODEOWNERS provider that we implement

@dfrankland dfrankland changed the title modularize github parsing code modularize github codeowners parsing code Sep 23, 2024
Copy link

trunk-staging-io bot commented Sep 23, 2024

✅ 25 passed ⋅ (learn more)

settingsdocs ⋅ learn more about trunk.io

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much exactly the same code from lib.rs. Moved here to better split up code for each CODEOWNERS provider e.g. GitHub vs GitLab vs Bitbucket

Comment on lines +7 to +8
pub trait OwnersOfPath {
type Owner;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split primary public interface of this crate into traits to allow implementing a similar interface for each CODEOWNERS provider

Comment on lines -112 to +11
pub fn of<P>(&self, path: P) -> Option<&Vec<Owner>>
fn of<P>(&self, path: P) -> Option<Vec<Self::Owner>>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this reference in favor of an owned Vec since it makes the interface more flexible to implement for each CODEOWNERS provider

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from inside of tests since this added a lot of noise

@dfrankland dfrankland marked this pull request as ready for review September 23, 2024 22:27
Copy link
Contributor

@riya-n riya-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@dfrankland dfrankland merged commit a5f0557 into main Sep 24, 2024
6 checks passed
@dfrankland dfrankland deleted the dylan/modularize-github-codeowners-parsing branch September 24, 2024 14:39
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.

2 participants