-
-
Notifications
You must be signed in to change notification settings - Fork 540
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_docs
hook broken in v1.92.2
#699
Comments
(everything is working as expected with v1.92.1) |
Yep, here you go: ---
# This file is automatically maintained within this module repository -- DO NOT EDIT
formatter: "markdown"
settings:
anchor: false
lockfile: false
output:
file: "README.md"
sections:
hide: [requirements]
content: |-
## Global versioning rule for Claranet Azure modules
| Module version | Terraform version | AzureRM version |
| -------------- | ----------------- | --------------- |
| >= 7.x.x | 1.3.x | >= 3.0 |
| >= 6.x.x | 1.x | >= 3.0 |
| >= 5.x.x | 0.15.x | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | >= 2.0 |
| >= 3.x.x | 0.12.x | >= 2.0 |
| >= 2.x.x | 0.12.x | < 2.0 |
| < 2.x.x | 0.11.x | < 2.0 |
## Contributing
If you want to contribute to this repository, feel free to use our [pre-commit](https://pre-commit.com/) git hook configuration
which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.
More details are available in the [CONTRIBUTING.md](./CONTRIBUTING.md#pull-request-process) file.
## Usage
This module is optimized to work with the [Claranet terraform-wrapper](https://github.com/claranet/terraform-wrapper) tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the `terraform-wrapper` available in the [documentation](https://github.com/claranet/terraform-wrapper#environment).
```hcl
{{ include "examples/main/modules.tf" }}
```
{{ .Providers }}
{{ .Modules }}
{{ .Resources }}
{{ .Inputs }}
{{ .Outputs }}
... |
@Shr3ps Thank you. @MaxymVlasov Need your brain here 🤷🏻 |
As you used wrong bug template, @Shr3ps please provide info about environment. pre-commit-terraform/.github/ISSUE_TEMPLATE/bug_report_local_install.md Lines 74 to 101 in f809e53
Because currently, I can't reproduce this issue. But I found a minor issue that if output.file specified, warning always shown |
Hello, some steps to reproduce my issue: $ git clone https://github.com/claranet/terraform-azurerm-rg/
$ cd terraform-azurerm-rg
$ pre-commit install
$ sed -i 's/>= 1.32/>= 1.33/g' versions.tf
$ sed -i 's/Resource group name/Resource group name./g' outputs.tf
$ git add .
$ pre-commit run
$ git commit -m 'chore: test pre-commit' the bug is that pre-commit outputs:
but should fail on tfdoc step instead because of the changes done on .tf files. Setting back Environment information
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
pre-commit 3.7.0
OpenTofu v1.8.1
Terraform v1.5.3
python SKIPPED
Python 3.10.12
checkov SKIPPED
infracost SKIPPED
terraform-docs version v0.18.0 228c7a7 linux/amd64
terragrunt SKIPPED
terrascan version: v1.1.0
TFLint version 0.44.1
+ ruleset.terraform (0.2.2-bundled)
tfsec v1.28.1
trivy Version: 0.54.1
tfupdate SKIPPED
hcledit SKIPPED
|
Also, check #701 |
Thanks @MaxymVlasov , I can confirm adding the param |
@Shr3ps v1.93.0 should work without |
Describe the bug
Using the latest version of the hook (v1.92.2), pre-commit is always in "PASSED" state even if we change variables, outputs or versions constrains.
How can we reproduce it?
vim versions.tf sed -i 's/version = "~> 3.80"/version = "~> 3.86"/g' versions.tf pre-commit run -a Terraform fmt...........................................................................Passed Terraform docs..........................................................................Passed
It should failed and update README.md file.
Environment information
OS: Win11 with Ubuntu 20.04 on WSL2
OS: Ubuntu 20.04
Docker image tag/git commit: v1.92.2
.pre-commit-config.yaml
:file content
The text was updated successfully, but these errors were encountered: