-
Notifications
You must be signed in to change notification settings - Fork 88
Mergeable if statements should be combined - RSPEC-S1066
#734
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
base: main
Are you sure you want to change the base?
Mergeable if statements should be combined - RSPEC-S1066
#734
Conversation
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.
Great to see @olwispe ! Added some light polish and I've been looking at the changes at scale.
Looking at these two examples I wonder if perhaps we should move the inner if conditional to a new line, and keep the comments in more of their original position.
I've pushed a quick test update that shows a comment lost. What are your thoughts to the above proposal?
|
Thanks for your comments. |
src/main/java/org/openrewrite/staticanalysis/CombineMergeableIfStatements.java
Outdated
Show resolved
Hide resolved
…fStatements.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What's changed?
This PR implements RSPEC-S1066 which was requested in :
ifstatements should be merged.RSPEC-1066#45What's your motivation?
Among others, help migrate to pattern matching for
instanceofwhen combined withorg.openrewrite.staticanalysis.InstanceOfPatternMatch:Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
@timtebeek
Have you considered any alternatives or workarounds?
Any additional context
Checklist