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

Adding ReplaceLegacyAttributeIndexSyntax #4944

Merged

Conversation

greg-at-moderne
Copy link
Contributor

@greg-at-moderne greg-at-moderne commented Jan 24, 2025

What's changed?

Adding a new recipe for HCL called ReplaceLegacyAttributeIndexSyntax.
This is to migrate from this syntax which HCL considers legacy (which BTW we have recently added support for in the parser - see #4901):

aws_acm_certificate.google_dot_com.0.resource_record_name

to the "modern" one doing effectively the same:

aws_acm_certificate.google_dot_com[0].resource_record_name

What's your motivation?

To enable HCL users of OpenRewrite to migrate their code to new syntax.

@greg-at-moderne greg-at-moderne added enhancement New feature or request parser-hcl labels Jan 24, 2025
@greg-at-moderne greg-at-moderne self-assigned this Jan 24, 2025
@greg-at-moderne greg-at-moderne marked this pull request as ready for review January 24, 2025 09:53
Copy link
Contributor

@knutwannheden knutwannheden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

…ributeIndexSyntax.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@greg-at-moderne greg-at-moderne merged commit d71f13c into main Jan 24, 2025
2 checks passed
@greg-at-moderne greg-at-moderne deleted the recipe-to-migrate-from-legacy-attribute-index-syntax branch January 24, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser-hcl
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants