mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
parent
37dfe9ab4b
commit
bd50003bd7
5 changed files with 29 additions and 28 deletions
|
|
@ -1,5 +1,6 @@
|
|||
repos:
|
||||
- repo: git://github.com/pre-commit/pre-commit-hooks
|
||||
sha: v0.6.0
|
||||
sha: v1.2.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
description: Rewrites all Terraform configuration files to a canonical format.
|
||||
entry: terraform_fmt.sh
|
||||
language: script
|
||||
files: \.tf$
|
||||
exclude: \.+.terraform\/.*$
|
||||
files: (\.tf|\.tfvars)$
|
||||
exclude: \.terraform\/.*$
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[](https://www.codetriage.com/antonbabenko/pre-commit-terraform)
|
||||
|
||||
Single [pre-commit](http://pre-commit.com/) hook which runs `terraform fmt` on `*.tf` files.
|
||||
Single [pre-commit](http://pre-commit.com/) hook which runs `terraform fmt` on Terraform configuration files (both `*.tf` and `*.tfvars`).
|
||||
|
||||
An example `.pre-commit-config.yaml`:
|
||||
|
||||
```yaml
|
||||
- repo: git://github.com/antonbabenko/pre-commit-terraform
|
||||
sha: v1.2.0
|
||||
sha: v1.3.0
|
||||
hooks:
|
||||
- id: terraform_fmt
|
||||
```
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
description: Rewrites all Terraform configuration files to a canonical format.
|
||||
entry: terraform_fmt.sh
|
||||
language: script
|
||||
files: \.tf$
|
||||
exclude: \.+.terraform\/.*$
|
||||
files: (\.tf|\.tfvars)$
|
||||
exclude: \.terraform\/.*$
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for file in "$@"; do
|
||||
terraform fmt `dirname $file`
|
||||
terraform fmt "$file"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue