You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform_tflint.sh still throws "command not found"
Expected: This behavior was expected to be fixed by PR #251
Observed: When intentionally changing a terraform file to cause a linting failure observed the following
$ pre-commit
Terraform fmt............................................................Passed
Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 127
ERROR in terraform/:
$HOME/.cache/pre-commit/repohu82fesd/terraform_tflint.sh: line 70: tflint: command not found
How can we reproduce it?
Well, interestingly this error is observed even when there is a formatting error detected by terraform_fmt.
The relevant section of the .pre-commit-config.yaml used when trying to add terraform_tflint is:
Then the observed behavior is that terraform_fmt will catch and fix the formatting error, but the terraform_tflint.sh script will will return "file not found".
If I intentionally cause a linting error, for example changing the keyword source in a module to source_
Ahh, looks like dependencies indicated TFLint is required for the terraform_tflint hook. After install of TFLint the "command not found" is no longer observed.
MaxymVlasov
changed the title
terraform_tflint.sh still throws "command not found"
[3rd party: tflint] terraform_tflint.sh still throws "command not found"
Nov 5, 2021
terraform_tflint.sh still throws "command not found"
Expected: This behavior was expected to be fixed by PR #251
Observed: When intentionally changing a terraform file to cause a linting failure observed the following
How can we reproduce it?
Well, interestingly this error is observed even when there is a formatting error detected by terraform_fmt.
The relevant section of the
.pre-commit-config.yaml
used when trying to add terraform_tflint is:So, for example, if I have the following terraform:
And I change the formatting to cause terraform_fmt to catch and reformat due to expressions no longer aligning on the equals operator, ex:
Then the observed behavior is that terraform_fmt will catch and fix the formatting error, but the
terraform_tflint.sh
script will will return "file not found".If I intentionally cause a linting error, for example changing the keyword
source
in a module tosource_
The same error is observed:
Environment information
uname -a
and/orsysteminfo | Select-String "^OS"
output:$ uname -a Linux shoofcrash01 5.13.0-20-generic #20-Ubuntu SMP Fri Oct 15 14:21:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
.pre-commit-config.yaml
:file content
The text was updated successfully, but these errors were encountered: