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

Does not detect blocks where all resource names contain format verbs #45

Closed
gdavison opened this issue Mar 11, 2021 · 1 comment
Closed

Comments

@gdavison
Copy link
Contributor

In Go source files, a heuristic is used to identify if a block looks like Terraform before running tooling against it. It currently requires at least one line matching a resource or data source block or variable or output block.

In most cases this works, but if a reusable Terraform segment allows all names to be replaced, it is not detected. For example, the following is not detected:

func testAccAvailableAZsNoOptInConfigWithProvider(name, provider string) string {
	return fmt.Sprintf(`
data "aws_availability_zones" "%[1]s" {
  provider = %[2]s

  state = "available"

  filter {
    name   = "opt-in-status"
    values = ["opt-in-not-required"]
  }
}
`, name, provider)
}

When format verbs are enabled, the pattern matching should also match resource names contains format verbs.

@gdavison
Copy link
Contributor Author

This error only exists in #44, fixing it there

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