mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
Ready, probably :)
This commit is contained in:
parent
8c2226857e
commit
587d4420a5
5 changed files with 10 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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
5
terrraform_fmt.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for file in "$@"; do
|
||||
terraform fmt `dirname $file`
|
||||
done
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
[[ -z $(terraform fmt "$@") ]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue