diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ce1f5a6..669a4a6 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -24,7 +24,7 @@ - id: tflint name: tflint description: TFLint is a Terraform linter focused on possible errors, best practices, etc. (Terraform >= 0.12) - entry: hooks/tflint.sh + entry: pre_commit_hooks/tflint.sh language: script files: \.tf$ exclude: \.+.terraform\/.*$ diff --git a/README.adoc b/README.adoc index 7156109..2983609 100644 --- a/README.adoc +++ b/README.adoc @@ -56,3 +56,12 @@ pre-commit run terraform-validate --all-files pre-commit run --all-files ``` + +=== Contribute + +All `*.sh` files inside pre_commit_hooks need to be marked as executable. Otherwise the pre-commot hooks won't be executable +by default. You apply the flag to all `*.sh` files with the following command: + +``` +find pre_commit_hooks/ -type f -iname "*.sh" -exec chmod +x {} \; +``` diff --git a/pre_commit_hooks/terraform/fmt.sh b/pre_commit_hooks/terraform/fmt.sh old mode 100644 new mode 100755 diff --git a/pre_commit_hooks/terraform/tflint.sh b/pre_commit_hooks/terraform/tflint.sh old mode 100644 new mode 100755 diff --git a/pre_commit_hooks/terraform/validate.sh b/pre_commit_hooks/terraform/validate.sh old mode 100644 new mode 100755