Skip to content
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

Conversation

l-ferguson
Copy link
Contributor

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.

Copy link
Contributor

@github-actions github-actions bot left a 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

@timtebeek
Copy link
Contributor

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?

@l-ferguson
Copy link
Contributor Author

Hi! I copied the existing FindAndReplace recipe as a starting point and then modified it to scope to HCL literals

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

Copy link
Contributor

@github-actions github-actions bot left a 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

Copy link
Contributor

@timtebeek timtebeek left a 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.

@timtebeek timtebeek merged commit 52c87ad into openrewrite:main Jul 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants