File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 5858 files : (\.hcl)$
5959 exclude : \.terraform\/.*$
6060
61+ - id : terragrunt_validate
62+ name : Terragrunt validate
63+ description : Validates all Terragrunt configuration files.
64+ entry : terragrunt_validate.sh
65+ language : script
66+ files : (\.hcl)$
67+ exclude : \.terraform\/.*$
68+
6169- id : terraform_tfsec
6270 name : Terraform validate with tfsec
6371 description : Static analysis of Terraform templates to spot potential security issues.
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform
7474| ` terraform_docs_replace ` | Runs ` terraform-docs ` and pipes the output directly to README.md |
7575| ` terraform_tflint ` | Validates all Terraform configuration files with [ TFLint] ( https://github.com/terraform-linters/tflint ) . |
7676| ` terragrunt_fmt ` | Rewrites all [ Terragrunt] ( https://github.com/gruntwork-io/terragrunt ) configuration files (` *.hcl ` ) to a canonical format. |
77+ | ` terragrunt_validate ` | Validates all [ Terragrunt] ( https://github.com/gruntwork-io/terragrunt ) configuration files (` *.hcl ` ) |
7778| ` terraform_tfsec ` | [ TFSec] ( https://github.com/liamg/tfsec ) static analysis of terraform templates to spot potential security issues. |
7879
7980Check the [ source file] ( https://github.com/antonbabenko/pre-commit-terraform/blob/master/.pre-commit-hooks.yaml ) to know arguments used for each hook.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ declare -a paths
6+
7+ index=0
8+
9+ for file_with_path in " $@ " ; do
10+ file_with_path=" ${file_with_path// / __REPLACED__SPACE__} "
11+
12+ paths[index]=$( dirname " $file_with_path " )
13+
14+ let " index+=1"
15+ done
16+
17+ for path_uniq in $( echo " ${paths[*]} " | tr ' ' ' \n' | sort -u) ; do
18+ path_uniq=" ${path_uniq// __REPLACED__SPACE__/ } "
19+
20+ pushd " $path_uniq " > /dev/null
21+ terragrunt validate
22+ popd > /dev/null
23+ done
You can’t perform that action at this time.
0 commit comments