Skip to content

Need terraform_tflint option to not find more paths to run in. #300

Description

@grimm26

I need a way for terraform_tflint to not descend into subdirectories. I only want it to check the current directory.

Use case

I am using this with terraform module repositories. The module has a test/ directory that has a test invocation of the module that people can use to verify that their changes will plan out fine. This causes an error when running the pre-commit check.

Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 1


TFLint in test/:
Failed to load configurations. 1 error(s) occurred:

Error: `test` module is not found. Did you run `terraform init`?

  on test/test.tf line 27, in module "test":
  27: module "test" {

I ran a terraform init in both direcotories, but I think since tflint is being run from ./ it doesn't see that the module is loaded in ./test.

How could pre-commit-terraform help solve your problem?

Add an option to disable searching for paths to run the tflint check in. Just run it in ./

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions