antonbabenko / pre-commit-terraform

pre-commit git hooks to take care of Terraform configurations 🇺🇦
MIT License
3.16k stars 535 forks source link

terraform-docs issue in v1.93.0: invalid command code R #702

Closed BeneHa closed 3 weeks ago

BeneHa commented 3 weeks ago

Describe the bug

When I run pre-commit run -a terraform_docs with version 1.93.0 I always get the error:

❯ pre-commit run -a terraform_docs --verbose
Terraform docs...........................................................Failed
- hook id: terraform_docs
- duration: 1.1s
- exit code: 1

sed: 1: "README.md": invalid command code R

How can we reproduce it?

It happens no matter if a README.md already exists or not.

Environment information

GNU bash, version 5.2.32(1)-release (aarch64-apple-darwin23.4.0)
pre-commit 3.8.0
zsh: command not found: tofu
Terraform v1.9.5
Python 3.10.11
Python 3.10.11
checkov SKIPPED
infracost SKIPPED
terraform-docs version v0.18.0 228c7a7 darwin/arm64
terragrunt SKIPPED
terrascan SKIPPED
TFLint version 0.53.0
+ ruleset.terraform (0.9.1-bundled)
tfsec SKIPPED
trivy SKIPPED
tfupdate SKIPPED
hcledit SKIPPED
file content ```yaml ``` --- repos: - repo: https://github.com/antonbabenko/pre-commit-terraform.git rev: v1.93.0 hooks: - id: terraform_docs args: - --hook-config=--create-file-if-not-exist=true ``` ```
BeneHa commented 3 weeks ago

Duplicate to https://github.com/antonbabenko/pre-commit-terraform/issues/703, where a fix is already suggested.