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

Introduce AddTeamToCodeowners Recipe #34

Merged
merged 3 commits into from
Aug 19, 2023
Merged

Introduce AddTeamToCodeowners Recipe #34

merged 3 commits into from
Aug 19, 2023

Conversation

sghill
Copy link
Collaborator

@sghill sghill commented Aug 18, 2023

What's changed?

A new recipe has been introduced.

What's your motivation?

Closes #19.

Anything in particular you'd like reviewers to focus on?

The style-matching implementation is done in-recipe, there may be a better way to do this.

Anyone you would like to review specifically?

@timtebeek @basil

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've added the license header to any new files through ./gradlew licenseFormat
  • I've used the IntelliJ auto-formatter on affected files
  • I've updated the documentation (if applicable)

@sghill sghill force-pushed the feature/codeowners branch from 393c6e8 to 7b652fc Compare August 18, 2023 20:49
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Looks good to me!

return new TreeVisitor<Tree, ExecutionContext>() {
@Override
public Tree visit(@Nullable Tree tree, ExecutionContext executionContext, Cursor parent) {
SourceFile sourceFile = (SourceFile) requireNonNull(tree);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not quite sure when tree would ever be null here; we can hope we don't find out. Did you see this pattern elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe so, though I don't recall where. I think it's mainly for telling the IDE to not highlight tree since that's marked @Nullable in the superclass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Found it in CreateTextFile

@timtebeek timtebeek added the recipe Requests for new automated code changes label Aug 18, 2023
@sghill sghill merged commit 9b800f5 into main Aug 19, 2023
@sghill sghill deleted the feature/codeowners branch August 19, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Requests for new automated code changes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add CODEOWNERS if needed
2 participants