-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
62 lines (56 loc) · 1.64 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
# .pre-commit-config.yaml
repos:
# Standard pre-commit hooks for generic tasks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 # Use the latest stable version
hooks:
- id: trailing-whitespace
name: Remove trailing whitespace
- id: end-of-file-fixer
name: Ensure files end with a newline
- id: check-yaml
name: YAML syntax checker
- id: check-added-large-files
name: Prevent adding large files
# Local hooks for Rust-specific tools
- repo: local
hooks:
# Rustfmt: Formats Rust code
- id: cargo-fmt
name: Cargo fmt
entry: cargo fmt -- --check
language: system
types: [rust]
pass_filenames: false
# Clippy: Lints Rust code
- id: cargo-clippy
name: Cargo Clippy
entry: cargo clippy -- -D warnings
language: system
types: [rust]
pass_filenames: false
# Cargo Check: Checks for compilation errors
- id: cargo-check
name: Cargo Check
entry: cargo check
language: system
types: [rust]
pass_filenames: false
# Cargo Test: Ensures tests compile without running them
- id: cargo-test
name: Cargo Test
entry: cargo test --no-run
language: system
types: [rust]
pass_filenames: false
# Optional: Cargo Audit for security vulnerabilities
- id: cargo-audit
name: Cargo Audit
entry: cargo audit
language: system
types: [rust]
pass_filenames: false
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
hooks:
- id: typos