-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
241 lines (240 loc) · 5.58 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
minimum_pre_commit_version: 2.20.0
fail_fast: false
default_stages:
- commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
exclude: .gitleaks.toml
- id: no-commit-to-branch
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-json
- id: check-toml
- id: check-xml
- id: pretty-format-json
args:
- --autofix
- --no-sort-keys
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: forbid-binary
- id: git-check
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args:
- --mapping
- '2'
- --sequence
- '2'
- --offset
- '0'
- --width
- '300'
- --implicit_start
- --preserve_null
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
name: Lint YAML files
args:
- --strict
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.28.0
hooks:
- id: check-jsonschema
name: Validate GitHub Workflows
files: ^\.github/workflows/.*\.yml
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/github-workflow.json
- id: check-jsonschema
name: Validate GitHub Actions
files: >
(?x)^(
.*/action\.(yml|yaml)|
\.github/actions/.*
)$
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/github-action
- id: check-jsonschema
name: Validate DependaBot
files: ^\.github/dependabot\.yml
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/dependabot-2.0.json
- id: check-jsonschema
name: Validate MarkdownLint
files: .*\.markdownlint\.yaml
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/markdownlint.json
- id: check-jsonschema
name: Validate YamlLint
files: .*\.yamllint\.yaml
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/yamllint.json
- id: check-jsonschema
name: Validate Pre-commit
files: .*\.pre-commit-config\.yaml
types:
- yaml
args:
- --schemafile
- https://json.schemastore.org/pre-commit-config.json
- id: check-jsonschema
name: Validate Docker-Compose
files: .*docker-compose\.yml
types:
- yaml
args:
- --schemafile
- https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
- id: check-jsonschema
name: Validate Renovate
files: ^\.github/renovate\.json
types:
- json
args:
- --schemafile
- https://docs.renovatebot.com/renovate-schema.json
- --disable-formats
- '*'
- id: check-jsonschema
name: Validate Prettier
files: ^\.prettierrc(\.(json|yaml|yml|json5))?
types_or:
- json
- yaml
args:
- --schemafile
- https://json.schemastore.org/prettierrc
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.16.0
hooks:
- id: commitizen
name: Lint commit message
stages:
- commit-msg
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
name: Check sh files (and patch)
entry: bash -eo pipefail -c 'shellcheck $@ -f diff | patch -p 1' --
- id: shellcheck
name: Check sh files (and print violations)
- repo: meta
hooks:
- id: check-hooks-apply
stages:
- manual
- id: check-useless-excludes
- id: identity
stages:
- manual
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint-fix
name: Lint Markdown files
args:
- --disable=MD013 # line-length
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.7.0.1
hooks:
- id: shfmt
name: Format sh files
args:
- -w
- -s
- -i
- '2'
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
additional_dependencies:
- prettier
exclude: CHANGELOG.md # managed by semantic-release
stages:
- manual
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 37.227.1
hooks:
- id: renovate-config-validator
name: Validate Renovate configuration
- repo: local
hooks:
- id: hadolint
name: Lint Dockerfiles
language: docker_image
entry: hadolint/hadolint:v2.10.0
args:
- hadolint
types:
- dockerfile
- id: gitleaks
name: Protect hardcoded secrets
language: docker_image
entry: zricethezav/gitleaks:v8.15.0
args:
- protect
- --staged
- --redact
- --verbose
- id: gitleaks-ci
name: Detect hardcoded secrets
language: docker_image
entry: zricethezav/gitleaks:v8.15.0
stages:
- manual
args:
- detect
- --redact
- --verbose
- --log-opts
- --left-right --cherry-pick --pretty=format:"%H" remotes/origin/master...
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.56.0
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types:
- file
additional_dependencies:
- '@typescript-eslint/[email protected]'
- '@typescript-eslint/[email protected]'
args:
- --fix