-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.pre-commit-config.yaml
130 lines (121 loc) · 3.35 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
default_language_version:
golang: 1.23.6
exclude: |
(?x)^(
.*/test/.*/.*\.approved.json
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: mixed-line-ending
- id: check-executables-have-shebangs
- id: check-symlinks
- id: destroyed-symlinks
- repo: https://github.com/aws-cloudformation/cfn-lint
rev: v1.25.1
hooks:
- id: cfn-lint
exclude: ^(ci|.github|http)/.*|docker-compose.*|.pre-commit-config.yaml|orchestration-canary-alarms.template.yaml|.*.approved.json|checkov-policies.*|.terraform-docs.yml|package.json|http-client.env.json|package-lock.json|.*provider.json$
files: ^.*\.(json|yml|yaml)$
- repo: https://github.com/govuk-one-login/pre-commit-hooks.git
rev: 0.0.1
hooks:
- id: gradle-spotless-apply
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.97.3
hooks:
- id: terraform_fmt
- repo: local
hooks:
- id: tflint
name: Run tflint (terraform linter)
files: ^ci/terraform/
require_serial: true
types_or:
- hcl
- terraform
language: golang
additional_dependencies:
- github.com/terraform-linters/[email protected]
entry: scripts/tflint.py
args:
- --minimum-failure-severity=warning
- --fix
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
exclude: ./gradlew|./pre-commit.sh
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/terraform-docs/terraform-docs
rev: "v0.19.0"
hooks:
- id: terraform-docs-go
types_or:
- hcl
- terraform
- yaml
types: []
files: ^ci/terraform/modules/|ci/terraform/.terraform-docs.yml$
args:
- ci/terraform
- repo: local
hooks:
- id: shfmt
name: shfmt (shell scripts)
language: golang
additional_dependencies:
- mvdan.cc/sh/v3/cmd/[email protected]
entry: shfmt
types:
- file
- shell
exclude_types:
- zsh
args:
- -w # write
- -s # simplify
- -l # list files that differ
- id: prettier
name: Run prettier
language: node
types: [text]
entry: prettier --write --ignore-unknown
additional_dependencies: ["prettier@^3.5.1"]
pass_filenames: true
- id: tfupdate-lock
name: Update terraform provider locks
files: "/versions.tf$"
pass_filenames: false
types:
- file
language: golang
additional_dependencies:
- github.com/minamijoyo/[email protected]
entry: tfupdate lock
args:
- --platform
- linux_amd64
- --platform
- linux_arm64
- --platform
- darwin_amd64
- --platform
- darwin_arm64
- --platform
- windows_amd64
- -r
- ci/terraform