diff --git a/README.md b/README.md index b9bf0c8..8b621bc 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/terraform_validate_no_variables.sh b/terraform_validate_no_variables.sh index 385b3f3..8aaa140 100755 --- a/terraform_validate_no_variables.sh +++ b/terraform_validate_no_variables.sh @@ -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