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

terraform: command not found #445

Closed
WurmD opened this issue Nov 4, 2022 · 4 comments · Fixed by #447
Closed

terraform: command not found #445

WurmD opened this issue Nov 4, 2022 · 4 comments · Fixed by #447
Labels
documentation Improvements or additions to documentation question

Comments

@WurmD
Copy link

WurmD commented Nov 4, 2022

Describe the bug

After following the README.md for MacOS, and running pre-commit run -a we get

terraform: command not found

Does terraform require separate installation, and thus a mention in the README.md saying just that? (if not even the actual brew commands)

How can we reproduce it?

brew install pre-commit terraform-docs tflint tfsec checkov terrascan infracost tfupdate minamijoyo/hcledit/hcledit jq
DIR=~/.git-template
git config --global init.templateDir ${DIR}
pre-commit init-templatedir -t pre-commit ${DIR}
git init
cat <<EOF > .pre-commit-config.yaml
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
  rev: <VERSION> # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
  hooks:
    - id: terraform_fmt
    - id: terraform_docs
EOF
pre-commit run -a

Environment information

  • OS: MacOS

  • uname -a and/or systeminfo | Select-String "^OS" output:

Darwin OM-C02ZQ84NMD6T 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
  • Tools availability and versions:
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
pre-commit 2.20.0
bash: line 3: terraform: command not found
python SKIPPED
Python 3.10.8
checkov 2.2.15
terraform-docs version v0.16.0 darwin/amd64
terragrunt SKIPPED
terrascan version: v1.16.0
TFLint version 0.42.2
+ ruleset.terraform (0.2.1-bundled)
tfsec v1.28.1
tfupdate 0.6.7
hcledit 0.2.6
  • .pre-commit-config.yaml:
file content
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
  rev: <VERSION> # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
  hooks:
    - id: terraform_fmt
    - id: terraform_docs
@WurmD WurmD added area/local_installation bug Something isn't working labels Nov 4, 2022
@yermulnik
Copy link
Collaborator

I guess this is implied that terraform is required for people who work on creating/updating Terraform code 😉
Please see https://developer.hashicorp.com/terraform/downloads on how to install Terraform.

Also please feel free to contribute by creating PR to README with respective statement that terraform binary is required for some of pre-commit-terraform hooks. Thanks.

@MaxymVlasov
Copy link
Collaborator

No way, @antonbabenko we totally need to return first line from https://github.com/antonbabenko/pre-commit-terraform/tree/v1.52.0#1-install-dependencies ! :D

@MaxymVlasov MaxymVlasov added question 3rd party Issues not related to `pre-commit-terraform` documentation Improvements or additions to documentation and removed bug Something isn't working area/local_installation 3rd party Issues not related to `pre-commit-terraform` labels Nov 4, 2022
@WurmD
Copy link
Author

WurmD commented Nov 5, 2022

That's actually great @MaxymVlasov :), it's funny for those who know, and informative for the very much existing large part of the population that does not know

Take my example, I have no clue what terraform is, and I still need to have this pre-commit-hook running in the repo I'm using at work, ergo, this issue

Just to underline my point, I do not know what terraform is, and I will not use it, ergo I will not learn what it is, and yet, this issue

@antonbabenko
Copy link
Owner

This issue has been resolved in version 1.76.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants