pre-commit-terraform icon indicating copy to clipboard operation
pre-commit-terraform copied to clipboard

Support tflint modules with differing module dependencies

Open davidjb opened this issue 1 year ago β€’ 5 comments

What problem are you facing?

In my configuration, I have a number of different modules in the same repo but each module has differing dependencies (either local or published). At present, I'm linting by running cd {dir} && terraform get && tflint for each module directory to ensure all dependencies are available and installed. When trying to use the terraform_tflint hook, it fails for modules with dependencies.

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

Have the ability to automatically invoke terraform get per-directory when running the tflint hook, either by default or with a flag. Whilst terraform get is a noop when nothing needs to be done, it still takes time to be invoked so an opt-in hook flag may be the better option.

Happy to help craft a PR if this is something that could be incorporated.

davidjb avatar Jun 20 '23 04:06 davidjb