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_tfsec hook always runs on all files #569

Closed
devholland opened this issue Sep 13, 2023 · 1 comment · Fixed by #571
Closed

terraform_tfsec hook always runs on all files #569

devholland opened this issue Sep 13, 2023 · 1 comment · Fixed by #571
Assignees
Labels
bug Something isn't working estimate/1h Need 1 hour to be done hook/terraform_tfsec Bash hook

Comments

@devholland
Copy link

Describe the bug

The terraform_tfsec hook always runs on all Terraform files, even though none of them were modified or staged.

I would expect the hook to only run if I explicitly use pre-commit run --all-files or if there were any Terraform files modified and staged.

How can we reproduce it?

What I did to produce the bug:

$ touch test.py
$ git add test.py
$ pre-commit run

My .pre-commit-config.yaml contains:

repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.83.2
    hooks:
      - id: terraform_tfsec

Environment information

  • OS: Ubuntu 22.04
  • uname -a and/or systeminfo | Select-String "^OS" output:
Linux Yggdrasil 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Tools availability and versions:
pre-commit 3.4.0
  • .pre-commit-config.yaml:
file content
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.83.2
    hooks:
      - id: terraform_tfsec
@antonbabenko
Copy link
Owner

This issue has been resolved in version 1.83.3 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working estimate/1h Need 1 hour to be done hook/terraform_tfsec Bash hook
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants