-
Notifications
You must be signed in to change notification settings - Fork 12
/
.pre-commit-config.yaml
65 lines (61 loc) · 1.92 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-executables-have-shebangs
exclude: |
(?x)^(
components/terraform/aws/ec2/userdata/.*|
components/terraform/aws/github-runners/.*|
.*\.tftmpl$
)$
- id: check-shebang-scripts-are-executable
exclude: |
(?x)^(
components/terraform/aws/ec2/userdata/.*|
components/terraform/aws/github-runners/.*|
.*\.tftmpl$
)$
- id: check-json
exclude: |
(?x)^(
\.vscode/.*\.json
)$
- id: check-yaml
- id: sort-simple-yaml
- id: check-symlinks
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: detect-private-key
- hooks:
- id: avmfix
name: autofix terraform
entry: /usr/bin/env bash -c 'for dir in $(git diff --cached --name-only --diff-filter=ACM | grep ".tf$" | xargs -n1 dirname | sort -u); do avmfix --folder "$dir"; done'
language: script
files: \.tf$
repo: local
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.3
hooks:
# avmfix does a better job of formatting and linting terraform
# - id: terraform_fmt
# - id: terraform_validate
# - id: terraform_tflint
# - id: terraform_trivy
# name: trivy security scan
# args:
# - >
# --args=--tf-exclude-downloaded-modules
# --severity=HIGH,CRITICAL
# --skip-dirs="**/.terraform"
# --format table
# --quiet
- id: terraform_docs
name: update terraform documentation
args:
- --args=--config=.terraform-docs.yaml
- --hook-config=--create-file-if-not-exist=true