Repository navigation
Expand file tree
/
Copy pathprek.toml
More file actions
211 lines (183 loc) · 4.46 KB
/
Copy pathprek.toml
File metadata and controls
211 lines (183 loc) · 4.46 KB
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
# Copyright (c) 2026 Graphcore Ltd. All rights reserved.
# Configuration file for `prek`, a git hook framework written in Rust.
# See https://prek.j178.dev for more information.
#:schema https://www.schemastore.org/prek.json
default_stages = ["pre-commit", "pre-merge-commit"]
default_install_hook_types = ["commit-msg", "pre-commit", "pre-merge-commit"]
exclude = '''
(?x)^(
.*d3.*.js|
.*jquery.*.js|
.*mermaid.*.js
)
'''
[[repos]]
repo = "builtin"
[[repos.hooks]]
id = "check-added-large-files"
priority = 5
[[repos.hooks]]
id = "check-case-conflict"
priority = 5
[[repos.hooks]]
id = "check-executables-have-shebangs"
priority = 5
[[repos.hooks]]
id = "check-merge-conflict"
priority = 5
[[repos.hooks]]
id = "check-toml"
priority = 5
[[repos.hooks]]
id = "check-yaml"
priority = 5
[[repos.hooks]]
id = "end-of-file-fixer"
priority = 4
[[repos.hooks]]
id = "mixed-line-ending"
exclude = "licenses.html"
priority = 3
[[repos.hooks]]
id = "trailing-whitespace"
exclude = "licenses.html"
priority = 2
[[repos]]
repo = "local"
[[repos.hooks]]
id = "check-copyright"
name = "check copyright"
description = "check copyright notice is valid"
language = "system"
entry = "cargo run --bin check-copyright"
require_serial = true
exclude = '''
(?x)(
^.git/.*|
^Cargo.lock|
.*\.stderr$|
.*\.png|
.*\.json
)
'''
priority = 5
[[repos.hooks]]
id = "lychee-check-links"
name = "check links"
description = "check validity of links in Markdown and HTML"
language = "system"
types_or = ["html", "markdown"]
entry = "sh -c 'lychee . || { sleep 20; lychee .; }'"
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "taplo-fmt"
name = "taplo fmt"
description = "check syntax and formatting of TOML files"
language = "system"
types = ["toml"]
entry = "taplo fmt --diff"
priority = 0
[[repos.hooks]]
id = "prettier-markdown"
name = "prettier markdown"
description = "check formatting of Markdown files"
language = "system"
types = ["markdown"]
entry = "npx prettier --write"
priority = 0
[[repos.hooks]]
id = "prettier-yaml"
name = "prettier yaml"
description = "check formatting of YAML files"
language = "system"
types = ["yaml"]
entry = "npx prettier --write"
priority = 0
[[repos.hooks]]
id = "prettier-javascript"
name = "prettier JavaScript"
description = "format JavaScript files"
language = "system"
types = ["javascript"]
entry = "npx prettier --write"
priority = 0
[[repos.hooks]]
id = "eslint"
name = "eslint"
description = "lint JavaScript files"
language = "system"
types = ["javascript"]
entry = "npx eslint --max-warnings 0"
pass_filenames = false
priority = 1
[[repos.hooks]]
id = "cargo-deny"
name = "cargo deny"
description = "check Rust dependencies licenses and for vulnerabilities"
language = "system"
types_or = ["rust", "toml"]
entry = "cargo deny check"
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cargo-about"
name = "cargo about"
description = "Document licenses of Rust dependencies"
language = "system"
types_or = ["rust", "toml"]
entry = "cargo about generate --locked --workspace --all-features --fail --config about.toml --output-file licenses.html about.hbs"
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cargo-nightly-fmt"
name = "cargo +nightly fmt"
description = 'format files with "cargo fmt" from the nightly toolchain'
language = "system"
types = ["rust"]
entry = "cargo +nightly fmt --"
priority = 0
[[repos.hooks]]
id = "cargo-check"
name = "cargo check"
description = "check for package errors with cargo check"
language = "system"
types_or = ["rust", "toml"]
entry = "cargo check --all-targets"
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cargo-clippy-strict"
name = "cargo clippy-strict"
description = "lint Rust source code"
language = "system"
types = ["rust"]
entry = 'env RUSTFLAGS="-D warnings" cargo clippy-strict'
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cargo-doc-gwr-dev"
name = "cargo doc-gwr-dev"
description = "check Rust source code documentation"
language = "system"
types = ["rust"]
entry = 'env RUSTDOCFLAGS="-D warnings" cargo doc-gwr-dev'
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cargo-semver-checks"
name = "cargo semver-checks"
description = "lint crate API changes for semver violations"
language = "script"
types_or = ["rust", "toml"]
entry = "semver-checks.sh"
pass_filenames = false
priority = 5
[[repos.hooks]]
id = "cog-verify"
name = "cog verify"
description = "check commit message is in Conventional Commit form"
language = "system"
entry = "cog verify --file"
priority = 0
stages = ["commit-msg"]