-
Notifications
You must be signed in to change notification settings - Fork 90
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
base: main
Are you sure you want to change the base?
Improve RemoveAnnotationVisitor
to remove unused imports from annotation parameters
#980
Conversation
RemoveAnnotationVisitor
to remove unused types from annotation parametersRemoveAnnotationVisitor
to remove unused imports from annotation parameters
I also submitted a PR to fix OpenRewrite: openrewrite/rewrite#3638 |
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.
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 |
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.
Can you also remove these \s
s, please?
if (!run.getResults().isEmpty()) { | ||
result = (J.CompilationUnit) run.getResults().get(0).getAfter(); | ||
} | ||
} | ||
|
||
assertThat(result.print()).isEqualTo(expected); | ||
assertThat(result.print()).isEqualToNormalizingNewlines(expected); |
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.
Please reset this after removing \s
.
String expected = """ | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.junit.jupiter.api.Disabled; | ||
|
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.
Now that this is getting cleaned up a bit, could you remove the blank line too?
No description provided.