-
Notifications
You must be signed in to change notification settings - Fork 8
/
.pre-commit-config.yaml
106 lines (98 loc) · 2.91 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: mixed-line-ending
- id: check-executables-have-shebangs
- repo: https://github.com/awslabs/cfn-python-lint
rev: v1.11.1
hooks:
- id: cfn-python-lint
exclude: ^(ci|.github)/.*|docker-compose.*|.pre-commit-config.yaml|orchestration-canary-alarms.template.yaml|.*.approved.json|checkov-policies.*|.terraform-docs.yml$
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.92.1
hooks:
- id: terraform_fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 1ee2e387938ec90ec10a64f85fc0b4be527ade6a # v0.5.5
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: a23f6b85d0fdd5bb9d564e2579e678033debbdff # v0.10.0.1 # pragma: allowlist secret
hooks:
- id: shellcheck
exclude: ./gradlew|./pre-commit.sh
- repo: https://github.com/rhysd/actionlint
rev: v1.7.0
hooks:
- id: actionlint
- repo: https://github.com/terraform-docs/terraform-docs
rev: "v0.19.0"
hooks:
- id: terraform-docs-go
types_or:
- hcl
- terraform
types: []
files: ^ci/terraform/modules/
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.3.2"]
pass_filenames: true
# ignore all readme files in the ci/terraform directory as they are generated by terraform-docs
exclude: ^ci/terraform/.*/README.md$
- 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