Skip to content

Linting tftest.hcl files #2128

Description

@wyardley

Summary

It sounds from #2030 like tftest.hcl files should be able to be linted.

It seems, however, as if tflint may not be parsing *.tftest.hcl files (it should also recurse into subdirectories when in recursive mode if there are directories with no .tf files but with .tftest.hcl files).

Taking a look at the code, including here, seems like some adjustments and tests might be needed for this to work?

In the example below, if the file is renamed to .tf, tflint will correctly flag google_storage_bucket.foo.bar.0.main_page_suffix vs google_storage_bucket.foo.bar[0].main_page_suffix being used.

Terraform Configuration

provider "google" {
  project = "foo-testproject"
}
variables {
  name    = "test-me"
}
run "basic" {
  command = plan
  plan_options {
    refresh = false
  }

  assert {
    condition     = google_storage_bucket.foo.bar.0.main_page_suffix == "index.html"
    error_message = "Incorrect website main page suffix."
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions