-
Notifications
You must be signed in to change notification settings - Fork 201
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
[PiranhaJava] Deleting statements containing specific Mockito API patterns #155
[PiranhaJava] Deleting statements containing specific Mockito API patterns #155
Conversation
" when(experimentation.isToggleDisabled(\"STALE_FLAG\")).thenReturn(false);", | ||
" when(experimentation.isToggleEnabled(\"STALE_FLAG\")).thenThrow(new RuntimeException());", | ||
" when(experimentation.isToggleDisabled(\"STALE_FLAG\")).thenCallRealMethod();", | ||
" when(experimentation.isToggleEnabled(\"STALE_FLAG\")).then(ans);", |
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 we also add a non stale flag in the mix?
if (enclosingNode(MOCKITO_UNNECESSARY_MOCKING_PATTERN).matches(tree, state)) { | ||
StatementTree stmt = ASTHelpers.findEnclosingNode(state.getPath(), StatementTree.class); | ||
if (stmt != null) { | ||
return buildDescription(stmt).addFix(SuggestedFix.delete(stmt)).build(); |
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 the changes happen in updateCode? If not, maybe update the startPos
and endPos
here?
90e2577
to
079f33d
Compare
Fixed the Swift CI issue Addressed the issues mentioned in the PR and offline Added support for then* pattern Added delete statement logic for specific patterns menntioned in issue uber#104
079f33d
to
4ac47a7
Compare
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.
lgtm. thanks for the PR.
when(...).then*()
pattern.