mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
fix: Change terraform_validate hook functionality for subdirectories with terraform files (#100)
* Update terraform_validate.sh:
-Change to the directory before running terraform validate to use the Terraform
configuration for the appropriate working directory.
* Neglected to change the terraform validate call to use the default of the
current directory.
* Several changes to improve functionality:
- Switch to checking the path for '*.tf' instead of always checking the current
directory.
- Try to find a '.terraform' directory (which indicates a `terraform init`) and
change to that directory before running `terraform validate`.
* Fix the description for the terraform_validate hook to reflect changes that were
made in:
35e0356188
* - Clean up comments.
- Adjust variable names to better reflect what they are holding.
This commit is contained in:
parent
8cbcd8ea2b
commit
7694fb9b9a
2 changed files with 23 additions and 3 deletions
|
|
@ -35,7 +35,7 @@
|
|||
exclude: \.terraform\/.*$
|
||||
|
||||
- id: terraform_validate
|
||||
name: Terraform validate without variables
|
||||
name: Terraform validate
|
||||
description: Validates all Terraform configuration files.
|
||||
entry: terraform_validate.sh
|
||||
language: script
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue