-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathprek.toml
More file actions
55 lines (48 loc) · 1.32 KB
/
prek.toml
File metadata and controls
55 lines (48 loc) · 1.32 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
default_install_hook_types = ["pre-commit", "pre-push"]
# Exclude vendored, generated, and binary corpus files
exclude = '(^docs/mermaid\.min\.js$|^docs/src/images/|^fuzz/corpus/)'
# --- File hygiene (built-in, fast) ---
[[repos]]
repo = "builtin"
hooks = [
{ id = "trailing-whitespace" },
{ id = "end-of-file-fixer" },
{ id = "check-yaml" },
{ id = "check-toml" },
{ id = "check-merge-conflict" },
{ id = "check-added-large-files", args = ["--maxkb=1024"] },
]
# --- Rust toolchain checks ---
[[repos]]
repo = "local"
[[repos.hooks]]
id = "cargo-fmt"
name = "cargo fmt --check"
language = "system"
entry = "cargo fmt --all -- --check"
pass_filenames = false
files = '\.(rs|toml)$'
[[repos.hooks]]
id = "cargo-clippy"
name = "cargo clippy"
language = "system"
entry = "cargo clippy --workspace --all-targets --all-features -- -D warnings"
env = { CARGO_INCREMENTAL = "0" }
pass_filenames = false
files = '\.(rs|toml)$'
[[repos.hooks]]
id = "cargo-doc"
name = "cargo doc warnings"
language = "system"
entry = "cargo doc --workspace --no-deps --all-features"
env = { RUSTDOCFLAGS = "-Dwarnings" }
pass_filenames = false
files = '\.(rs|toml)$'
[[repos.hooks]]
id = "cargo-test"
name = "cargo test"
language = "system"
entry = "cargo test --workspace"
pass_filenames = false
stages = ["pre-push"]
files = '\.(rs|toml)$'