When running precommit (e.g. pre-commit run --all-files) it reports an error as the intermediate folder is not existing (or similar)
Terraform docs...........................................................Failed
- hook id: terraform_docs
**Error: stat modules/aws: no such file or directory**
That folder is containing no file, but only the two folders for the ecr and amp modules.
This error should not appear (if I understand correctly how it should work).
Environment information
OS:
OS: MacOS
$ uname -a
Darwin PMIPLKRAL87212 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
Tools availability and versions:
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)
pre-commit 2.20.0
Terraform v1.2.6
python SKIPPED
Python 3.10.6
checkov 2.1.270
terraform-docs version v0.16.0 darwin/arm64
terragrunt version v0.38.12
terrascan terrascan SKIPPED
TFLint version 0.40.0
+ ruleset.terraform (0.1.0-bundled)
tfsec v1.27.6
tfupdate tfupdate SKIPPED
hcledit hcledit SKIPPED
Context
Terraform modules structure: ./modules/aws/amp ./modules/aws/ecr
pre-commit-config.yaml (just relevant part)
Source: https://github.com/antonbabenko/pre-commit-terraform#terraform_docs
rev: v1.76.0 hooks:
When running precommit (e.g. pre-commit run --all-files) it reports an error as the intermediate folder is not existing (or similar)
That folder is containing no file, but only the two folders for the ecr and amp modules.
This error should not appear (if I understand correctly how it should work).
Environment information
OS: MacOS
.pre-commit-config.yaml
:file content
```bash repos: - repo: https://github.com/antonbabenko/pre-commit-terraform # Source: https://github.com/antonbabenko/pre-commit-terraform#terraform_docs rev: v1.76.0 hooks: - id: terraform_fmt - id: terraform_docs args: - '--args=--recursive' - '--args=--output-file=README.md' - '--args=--recursive-path=/modules/' - id: terraform_validate - id: terraform_checkov ```