Ready, probably :)

This commit is contained in:
Anton Babenko 2016-09-27 20:01:11 +02:00
commit 587d4420a5
5 changed files with 10 additions and 7 deletions

View file

@ -1,5 +1,5 @@
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v0.4.2
sha: v0.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer

View file

@ -1,4 +1,4 @@
# pre-commit-terraform hooks
# pre-commit-terraform hook
Single [pre-commit](http://pre-commit.com/) hook which runs `terraform fmt` on `*.tf` files.
@ -11,4 +11,4 @@ An example `.pre-commit-config.yaml`:
- id: terraform_fmt
```
Enjoy the clean code!
Enjoy the clean code!

View file

@ -1,6 +1,7 @@
- id: terraform_fmt
name: Terraform fmt
description: Rewrites all Terraform configuration files to a canonical format.
entry: tffmthook.sh
entry: terrraform_fmt.sh
language: script
files: \.tf$
exclude: \.terraform\/.*$

5
terrraform_fmt.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
for file in "$@"; do
terraform fmt `dirname $file`
done

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
[[ -z $(terraform fmt "$@") ]]