-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
59 lines (53 loc) · 1.69 KB
/
.pre-commit-config.yaml
File metadata and controls
59 lines (53 loc) · 1.69 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
# Format code with rustfmt
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --check
language: system
types: [rust]
pass_filenames: false
always_run: true
# Lint with clippy
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy -- -D warnings
language: system
types: [rust]
pass_filenames: false
always_run: true
# Run tests
- id: cargo-test
name: cargo test
entry: cargo test
language: system
types: [rust]
pass_filenames: false
always_run: true
# Security audit (install cargo-audit if not present)
- id: cargo-audit
name: cargo audit
entry: bash -c 'if ! command -v cargo-audit &> /dev/null; then echo "📦 Installing cargo-audit..."; cargo install cargo-audit; fi && cargo audit'
language: system
types: [rust]
pass_filenames: false
always_run: true
# Check documentation
- id: cargo-doc
name: cargo doc
entry: cargo doc --no-deps
language: system
types: [rust]
pass_filenames: false
always_run: true
# Build in release mode (matching CI)
- id: cargo-build-release
name: cargo build --release
entry: bash -c 'echo "🔨 Building in release mode..." && cargo build --release && echo "🧹 Cleaning build artifacts..." && rm -rf target/release'
language: system
types: [rust]
pass_filenames: false
always_run: true