-
Notifications
You must be signed in to change notification settings - Fork 349
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 HCL FindAndReplaceLiteral Recipe #4362
Add HCL FindAndReplaceLiteral Recipe #4362
Conversation
…recipe handles literals of other types as well
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-gradle/src/main/groovy/RewriteSettings.groovy
- lines 31-36
rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java
Outdated
Show resolved
Hide resolved
rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java
Outdated
Show resolved
Hide resolved
rewrite-hcl/src/test/java/org/openrewrite/hcl/search/FindAndReplaceLiteralTest.java
Outdated
Show resolved
Hide resolved
Hi & welcome, thanks for the immediate PR. I'll have a closer look over the weekend, but for now we have some automated code suggestions to conform to our coding standards. Great start already! To simplify review, would you mind sharing is you copied parts from elsewhere such that we can compare and review only the changes? |
Hi! I copied the existing FindAndReplace recipe as a starting point and then modified it to scope to HCL literals |
…/github.com/l-ferguson/rewrite into feature/find-and-replace-hcl-literal-recipe
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-gradle/src/main/groovy/RewriteSettings.groovy
- lines 31-36
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.
Thanks again @l-ferguson ; I've added some polishing commits to start with the bare minimum of what we need. Hope you agree with the choices I made. We can always add options later, or work with preconditions to limit what files to apply to.
What's changed?
Adding a new recipe to find and replace literal values in HCL files.
What's your motivation?
This recipe provides an HCL language-specific alternative to the existing FindAndReplace recipe that parses files as plaintext. This recipe will find and replace literal values in HCL files and allow you to execute additional HCL language-specific recipes afterwards in a single recipe run.