-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
50 lines (48 loc) · 1.52 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/terraform-docs/terraform-docs
rev: v0.19.0
hooks:
- id: terraform-docs-system
args: ["."]
- repo: local
hooks:
- id: tfsort
name: Sort Terraform variables
language: system
types: [terraform]
entry: bash -c 'for f in $@; do tfsort "$f"; done' --
files: ^variables|outputs\.tf$
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: "v1.96.1"
hooks:
- id: terraform_fmt
- id: terraform_tflint
exclude: ^(examples|tests)/
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- --hook-config=--delegate-chdir
- id: terraform_tflint
alias: terraform_tflint_examples
name: Terraform validate examples with tflint
files: ^examples/
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.examples.hcl
- --hook-config=--delegate-chdir
- id: terraform_tflint
alias: terraform_tflint_tests
name: Terraform validate tests with tflint
files: ^tests/
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.tests.hcl
- --hook-config=--delegate-chdir
- id: terraform_trivy
exclude: ^(examples|tests)/
args:
- --args=--skip-dirs="examples/"
- --args=--skip-dirs="tests/"