Open kinseii opened 3 weeks ago
Issue was already fixed in 1.96.1 https://github.com/antonbabenko/pre-commit-terraform/releases/tag/v1.96.1
Issue was already fixed in 1.96.1 https://github.com/antonbabenko/pre-commit-terraform/releases/tag/v1.96.1
This problem persists on v1.96.1 as well. Please reopen.
@MaxymVlasov
Interesting, looks like there is an issue with --hook-config=--path-to-file=README.md
which is obsolete when it provided by terraform-docs.yaml
, but it shouldn't silently fail for sure.
Try
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.1
hooks:
- id: terraform_docs
args:
# - --hook-config=--path-to-file=README.md
- --hook-config=--add-to-existing-file=true
- --hook-config=--create-file-if-not-exist=true
- --hook-config=--use-standard-markers=true
- --args=--config=.terraform-docs.yml
Also, compact version will looks like
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.1
hooks:
- id: terraform_docs
args:
- --hook-config=--add-to-existing-file=true
- --hook-config=--create-file-if-not-exist=true
- --args=--config=.terraform-docs.yml
@MaxymVlasov
Yes, with the line - --hook-config=--path-to-file=README.md
removed, everything worked!
No error output was given with this line.
So, I can confirm that removing the line with - --hook-config=--path-to-file=README.md
helped and README.md started generating. With this line, the generation did not start and no errors were displayed.
I will not close the Issue, as I can see that obviously work will be done on it. Thank you so much for your help!
For me it doesn't work even without the - --hook-config=--path-to-file=README.md
. Reverting to v1.94.3
works though.
Doesn't work where also :(
❯ pre-commit clean
Cleaned /Users/u/.cache/pre-commit.
❯ pre-commit uninstall
pre-commit uninstalled
❯ pre-commit run --all-files
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/antonbabenko/pre-commit-terraform.
[ERROR] `terraform-docs` is not present in repository https://github.com/antonbabenko/pre-commit-terraform. Typo? Perhaps it is introduced in a newer version? Often `pre-commit autoupdate` fixes this.
❯ pre-commit autoupdate
[https://github.com/astral-sh/ruff-pre-commit] already up to date!
[https://github.com/pre-commit/pre-commit-hooks] already up to date!
[https://github.com/antonbabenko/pre-commit-terraform] Cannot update because the update target is missing these hooks: terraform-docs
[https://github.com/PyCQA/bandit] already up to date!
Doesn't work where also :(
❯ pre-commit clean Cleaned /Users/u/.cache/pre-commit. ❯ pre-commit uninstall pre-commit uninstalled ❯ pre-commit run --all-files [INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit. [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://github.com/antonbabenko/pre-commit-terraform. [ERROR] `terraform-docs` is not present in repository https://github.com/antonbabenko/pre-commit-terraform. Typo? Perhaps it is introduced in a newer version? Often `pre-commit autoupdate` fixes this. ❯ pre-commit autoupdate [https://github.com/astral-sh/ruff-pre-commit] already up to date! [https://github.com/pre-commit/pre-commit-hooks] already up to date! [https://github.com/antonbabenko/pre-commit-terraform] Cannot update because the update target is missing these hooks: terraform-docs [https://github.com/PyCQA/bandit] already up to date!
@davidaparicio Your issue is unrelated. Please install dependencies: https://github.com/antonbabenko/pre-commit-terraform?tab=readme-ov-file#1-install-dependencies
The workaround doesn't work for me either. I had to revert to v1.94.2
.
The code: .pre-commit-config.yaml .terraform-docs.yml
I can confirm that I had the same issue and reverting to v1.94.2
fixed it.
The version description says that terraform-doc versions less than v0.12 are no longer supported. However, I have terraform-docs v0.19 in $PATH and README.md is not generated. If I revert pre-commit-terraform to v1.94.3 everything works.
.pre-commit-config.yaml:
.terraform-docs.yml:
Environment information
OS: Win11 with Ubuntu 24.04 on WSL2
Tools availability and versions:
ruleset.terraform (0.9.1-bundled) tfsec SKIPPED trivy SKIPPED tfupdate SKIPPED hcledit SKIPPED