-
Notifications
You must be signed in to change notification settings - Fork 339
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
Add RegExp support to ChangeTagValue recipe #4733
base: main
Are you sure you want to change the base?
Add RegExp support to ChangeTagValue recipe #4733
Conversation
Plus some refactoring
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.
Some suggestions could not be made:
- rewrite-core/src/main/java/org/openrewrite/internal/AdaptiveRadixTree.java
- lines 594-594
- rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNull.java
- lines 18-18
- lines 43-43
- rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValueVisitor.java
- lines 98-98
rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValue.java
Outdated
Show resolved
Hide resolved
rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValueVisitor.java
Outdated
Show resolved
Hide resolved
rewrite-xml/src/test/java/org/openrewrite/xml/ChangeTagValueTest.java
Outdated
Show resolved
Hide resolved
rewrite-xml/src/test/java/org/openrewrite/xml/ChangeTagValueTest.java
Outdated
Show resolved
Hide resolved
) | ||
); | ||
} | ||
} |
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.
} | |
} |
Impl. SAST suggestions
@timtebeek / @gadams00 Can you kindly help with this change? Thanks! |
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.
Some suggestions could not be made:
- rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValueVisitor.java
- lines 97-97
new ChangeTagValue("/dependency/version", | ||
"SNAPSHOT", "RELEASE", Boolean.TRUE) | ||
), | ||
xml(""" |
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.
xml(""" | |
xml( | |
""" |
new ChangeTagValue("/dependency/version", | ||
"$", "-RELEASE", Boolean.TRUE) | ||
), | ||
xml(""" |
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.
xml(""" | |
xml( | |
""" |
new ChangeTagValue("/dependency/version", | ||
"(\\d).(\\d).(\\d)", "$1.$3.4", Boolean.TRUE) | ||
), | ||
xml(""" |
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.
xml(""" | |
xml( | |
""" |
) | ||
); | ||
} | ||
} |
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.
} | |
} |
) | ||
); | ||
} | ||
} |
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.
} | |
} |
What's changed?
Allows ChangeTagValue to take in regex in
oldValue
parameter.What's your motivation?
Anything in particular you'd like reviewers to focus on?
Please leave your thoughts here or on the issue #4731.
Anyone you would like to review specifically?
@timtebeek? - Because I see you actively replying ;)
@gadams00 - Because, history.
Have you considered any alternatives or workarounds?
Not really. I found this to be more appealing.
Checklist