-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
307 lines (278 loc) · 7.3 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
---
exclude: docs/|fibonacci/
repos:
# General
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
language: python
- id: check-json
language: python
- id: end-of-file-fixer
language: python
- id: trailing-whitespace
language: python
- id: check-docstring-first
language: python
- id: requirements-txt-fixer
language: python
- id: check-merge-conflict
language: python
- id: check-toml
language: python
- id: check-xml
language: python
- id: check-ast
language: python
- id: check-builtin-literals
language: python
- repo: https://github.com/crate-ci/typos
rev: v1.27.3
hooks:
- id: typos
args: []
# Python specific
- repo: https://github.com/JanEricNitschke/pymend
rev: "v1.1.0"
hooks:
- id: pymend
language: python
args: ["--write", "--check", "--output-style=google"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff
args:
- "--fix"
- "--exit-non-zero-on-fix"
- id: ruff-format
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright -p tictactoe_python/pyproject.toml tictactoe_python/tictactoe/
language: system
types: [python]
pass_filenames: false
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint tictactoe_python/tictactoe/
language: system
types: [python]
pass_filenames: false
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile",
"tictactoe_python/pyproject.toml",
]
# golang specific
- repo: https://github.com/golangci/golangci-lint
rev: v1.62.0
hooks:
- id: golangci-lint
entry: bash -c 'cd tictactoe_go && golangci-lint run --new-from-rev HEAD --fix'
# rust specific
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format files with cargo fmt.
entry: bash -c 'cd tictactoe_rust && cargo fmt'
language: system
types: [rust]
- id: cargo-check
name: cargo check
description: Check the package for errors.
entry: bash -c 'cd tictactoe_rust && cargo check'
language: system
types: [rust]
pass_filenames: false
- id: clippy
name: clippy
description: Lint rust sources
entry: bash -c 'cd tictactoe_rust && cargo clippy -- -D warnings'
language: system
types: [rust]
pass_filenames: false
# - repo: meta
# hooks:
# - id: identity
# files: ^tictactoe_cpp/|^tictactoe_c/
# types_or: [c, c++]
# c/cpp specific
- repo: https://github.com/cpplint/cpplint
rev: 2.0.0 # Use the ref you want to point at
hooks:
- id: cpplint
files: ^tictactoe_cpp/
types: [c++]
args: ["--filter=-build/include_subdir"]
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args: ["--style=Google", "-i"]
types: [c]
files: ^tictactoe_c/
- id: clang-format
args: ["--style=file", "-i"]
types: [c++]
files: ^tictactoe_cpp/
# I want to enforce JPL 10 rules in the C version only
- id: clang-tidy
args:
[
"-warnings-as-errors=*",
-header-filter=.*",
"--",
"-Itictactoe_c/include/",
"-isystemC:/Users/Jan-Eric/AppData/Local/Programs/Python/Python311/include/",
]
types: [c]
files: ^tictactoe_c/
- id: cppcheck
types: [c++]
files: ^tictactoe_cpp/
args:
["--std=c++23", "--enable=all", "--language=c++", "--inline-suppr"]
- id: cppcheck
types_or: [c]
files: ^tictactoe_c/
args:
[
"--enable=all",
"--language=c",
"--inline-suppr",
"-Itictactoe_c/include/",
]
# dart specific
- repo: https://github.com/dluksza/flutter-analyze-pre-commit
rev: "4afcaa82fc368d40d486256bf4edba329bf667bb"
hooks:
- id: dart-format
- id: flutter-analyze
# java specific
- repo: local
hooks:
- id: checkstyle
name: checkstyle
description: Check java style
entry: bash -c 'cd tictactoe_java && mvn checkstyle:check'
language: system
types: [java]
pass_filenames: false
# javascript specific
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.15.0
hooks:
- id: eslint
files: ^tictactoe_javascript/
args:
- --fix
additional_dependencies:
- "@babel/[email protected]"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [css, javascript]
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
hooks:
- id: csslint
# ruby specific
- repo: https://github.com/rubocop/rubocop
rev: v1.68.0
hooks:
- id: rubocop
# php specific
- repo: local
hooks:
- id: php-lint
name: php-lint
entry: php -l
language: system
types: [php]
# Nim specific
- repo: https://github.com/juancarlospaco/pre-commit-nim
rev: "f3e8249a482c72d02654e2babaa733782bca6175"
hooks:
- id: nim-check
- repo: local
hooks:
- id: nimpretty
name: nimpretty
entry: nimpretty
language: system
types: [nim]
- id: nimble-check
name: nimble check
entry: bash -c 'cd tictactoe_nim && nimble check .'
language: system
types: [nim]
pass_filenames: false
# Perl specific
- repo: https://github.com/perltidy/perltidy
rev: "20240903.02"
hooks:
- id: perltidy
files: ^tictactoe_perl/
types: [perl]
# Nix specific, currently fails to install
# - repo: https://github.com/nix-community/nixpkgs-fmt
# rev: master
# hooks:
# - id: nixpkgs-fmt
# bash specific
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
files: ^tictactoe_bash/
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
# Choose one of:
- id: shfmt # prebuilt upstream executable
files: ^tictactoe_bash/
# - id: shfmt-src # build from source (requires/installs Go to build)
# - id: shfmt-docker # Docker image (requires Docker to run)
# lua specific lints
# NONE
# swift specific
# NONE
# assembly specific
# NONE
# prolog specific
# NONE
# smalltalk specific
# NONE
# zig specific
# NONE
# fortran specific
# NONE
# brainfuck specific
# NONE
# Cobol specific
# None
# Haskell specific
# None
# Julia specific
# None
# C# specific
# None
# basic specific
# None
# Clojure specific
# None