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

Two quoted format verb parameters on the same line do not both get replaced #46

Open
gdavison opened this issue Apr 19, 2021 · 0 comments

Comments

@gdavison
Copy link
Contributor

When a configuration with format verbs has two quoted values on the same line, only the first is replaced.

For example, in https://github.com/hashicorp/terraform-provider-aws/blob/38319aa13aea65d3e946450c1f881d8fef12e734/aws/resource_aws_ecs_capacity_provider_test.go#L438-L448

resource "aws_ecs_capacity_provider" "test" {
  name = %[1]q

  tags = {
    %[2]q = %[3]q,
  }

  auto_scaling_group_provider {
    auto_scaling_group_arn = aws_autoscaling_group.test.arn
  }
}

Expected Result

the line%[2]q = %[3]q, should be replaced with "@@_@@ TFMT:%[2]q:TFMT @@_@@" = "@@_@@ TFMT:%[3]q:TFMT @@_@@", or something similar

Actual Result

the line%[2]q = %[3]q, is replaced with "@@_@@ TFMT:%[2]q:TFMT @@_@@" = %[3]q,, and terrafmt fmt fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant