Updated readme

This commit is contained in:
Anton Babenko 2018-01-24 15:46:37 +01:00
commit c6f81e3730
2 changed files with 3 additions and 4 deletions

View file

@ -5,7 +5,9 @@
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. This is an optional check, because it will not work if variables are being set dynamically (eg, when using [Terragrunt](https://github.com/gruntwork-io/terragrunt)). Use `terraform_validate_no_variables` hook instead.
* `terraform_validate_with_variables` - Validates all Terraform configuration files and checks whether all required variables were specified.
Note that `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.
An example `.pre-commit-config.yaml`:
@ -13,7 +15,6 @@ An example `.pre-commit-config.yaml`:
- repo: git://github.com/antonbabenko/pre-commit-terraform
sha: v1.4.0
hooks:
- id: terraform_validate_no_variables
- id: terraform_fmt
```

View file

@ -10,8 +10,6 @@ for file_with_path in "$@"; do
done
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
echo "Working dir => $path_uniq"
pushd "$path_uniq" > /dev/null
terraform validate -check-variables=false