mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
Upgraded to work with Terraform >= 0.12 (#44)
This commit is contained in:
parent
9300d0f194
commit
35e0356188
5 changed files with 35 additions and 74 deletions
|
|
@ -48,8 +48,7 @@ pre-commit run -a
|
|||
|
||||
There are several [pre-commit](http://pre-commit.com/) hooks to keep Terraform configurations (both `*.tf` and `*.tfvars`) in a good shape:
|
||||
* `terraform_fmt` - Rewrites all Terraform configuration files to a canonical format.
|
||||
* `terraform_validate_no_variables` - Validates all Terraform configuration files without checking whether all required variables were set.
|
||||
* `terraform_validate_with_variables` - Validates all Terraform configuration files and checks whether all required variables were specified.
|
||||
* `terraform_validate` - Validates all Terraform configuration files.
|
||||
* `terraform_docs` - Inserts input and output documentation into `README.md`. Recommended.
|
||||
* `terraform_docs_without_aggregate_type_defaults` - Inserts input and output documentation into `README.md` without aggregate type defaults.
|
||||
* `terraform_docs_replace` - Runs `terraform-docs` and pipes the output directly to README.md
|
||||
|
|
@ -58,8 +57,6 @@ Check the [source file](https://github.com/antonbabenko/pre-commit-terraform/blo
|
|||
|
||||
## Notes about hooks
|
||||
|
||||
1. `terraform_validate_no_variables` and `terraform_validate_with_variables` will not work if variables are being set dynamically (eg, when using [Terragrunt](https://github.com/gruntwork-io/terragrunt)). Use `terragrunt validate` command instead.
|
||||
|
||||
1. `terraform_docs` and `terraform_docs_without_aggregate_type_defaults` will insert/update documentation generated by [terraform-docs](https://github.com/segmentio/terraform-docs) between markers - `<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->` and `<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->` if they are present in `README.md`. Make sure that `terraform-docs` is installed.
|
||||
|
||||
1. `terraform_docs_replace` replaces the entire README.md rather than doing string replacement between markers. Put your additional documentation at the top of your `main.tf` for it to be pulled in. The optional `--dest` argument lets you change the name of the file that gets created/modified.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue