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
min_version: 1.5.3
pre-commit:
parallel: true
commands:
formatting:
glob: "*.{rs}"
run: cargo fmt --check {staged_files}
clippy:
glob: "*.rs"
run: cargo clippy --all-targets --all-features -- -D warnings
test:
run: cargo test
check-config:
glob: "config/*.toml"
run: cargo run -- validate-config {staged_files}
#commit-msg:
# commands:
# validate-message:
# # We'll use our own scripture tool to validate the commit message
# run: |
# message=$(cat $1)
# cargo run -- validate-message "$message"
pre-push:
parallel: true
commands:
security-audit:
run: cargo audit
unused-deps:
run: cargo machete
cargo-deny:
run: cargo deny check licenses sources
skip_output:
- meta
- success
- summary
metrics:
commands:
crates-outdated:
run: cargo outdated --exit-code 1
cyclomatic:
run: cargo dev-metrics
post-merge:
commands:
deps-check:
run: |
if [[ $(git diff HEAD@{1} -- Cargo.lock) != "" ]]; then
cargo clean && cargo check
fi
config-update:
run: |
if [[ $(git diff HEAD@{1} -- config/) != "" ]]; then
cargo run -- update-config
fi