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

Improve RemoveAnnotationVisitor to remove unused imports from annotation parameters #980

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ammachado
Copy link
Contributor

No description provided.

@ammachado ammachado changed the title Improve RemoveAnnotationVisitor to remove unused types from annotation parameters Improve RemoveAnnotationVisitor to remove unused imports from annotation parameters Oct 19, 2023
@ammachado
Copy link
Contributor Author

I also submitted a PR to fix OpenRewrite: openrewrite/rewrite#3638

Copy link
Contributor

@fabapp2 fabapp2 left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution @ammachado 🚀

I was looking at the tests but couldn't see any tests that proves that the change in RemoveAnnotationVisitor is required.
Could you provide a test that proves your change?
Thank you for improving the quality of the code.
I hope you keep contributing. Could you provide future cleanups in a separate PR (or at least commit), that makes it easier to follow and understand the changes.
(I know I am not a role model here) ;)


public void requiresNewFromType() {}

\s
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also remove these \ss, please?

if (!run.getResults().isEmpty()) {
result = (J.CompilationUnit) run.getResults().get(0).getAfter();
}
}

assertThat(result.print()).isEqualTo(expected);
assertThat(result.print()).isEqualToNormalizingNewlines(expected);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please reset this after removing \s.

String expected = """
import org.mockito.junit.jupiter.MockitoExtension;
import org.junit.jupiter.api.Disabled;

Copy link
Contributor

Choose a reason for hiding this comment

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

Now that this is getting cleaned up a bit, could you remove the blank line too?

@fabapp2 fabapp2 assigned fabapp2 and ammachado and unassigned fabapp2 Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants