mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
Initial commit
This commit is contained in:
parent
f454b08495
commit
8c2226857e
4 changed files with 31 additions and 2 deletions
8
.pre-commit-config.yaml
Normal file
8
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
- repo: git://github.com/pre-commit/pre-commit-hooks
|
||||
sha: v0.4.2
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
16
README.md
16
README.md
|
|
@ -1,2 +1,14 @@
|
|||
# pre-commit-terraform
|
||||
pre-commit git hook for Terraform
|
||||
# pre-commit-terraform hooks
|
||||
|
||||
Single [pre-commit](http://pre-commit.com/) hook which runs `terraform fmt` on `*.tf` files.
|
||||
|
||||
An example `.pre-commit-config.yaml`:
|
||||
|
||||
```yaml
|
||||
- repo: git@github.com:antonbabenko/pre-commit-terraform
|
||||
sha: HEAD
|
||||
hooks:
|
||||
- id: terraform_fmt
|
||||
```
|
||||
|
||||
Enjoy the clean code!
|
||||
6
hooks.yaml
Normal file
6
hooks.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
- id: terraform_fmt
|
||||
name: Terraform fmt
|
||||
description: Rewrites all Terraform configuration files to a canonical format.
|
||||
entry: tffmthook.sh
|
||||
language: script
|
||||
files: \.tf$
|
||||
3
tffmthook.sh
Executable file
3
tffmthook.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
[[ -z $(terraform fmt "$@") ]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue