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
# Pre-commit hooks for chipp-rs
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Rust-specific hooks
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
# Format code with rustfmt
- id: fmt
name: cargo fmt
args:
# Lint with clippy (enforce zero warnings)
- id: clippy
name: cargo clippy
args:
# General file quality hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevent committing large files
- id: check-added-large-files
args:
# Check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# Check for merge conflicts
- id: check-merge-conflict
# Check YAML files for syntax errors
- id: check-yaml
args: # Allow custom YAML tags
# Check TOML files for syntax errors
- id: check-toml
# Ensure files end with a newline
- id: end-of-file-fixer
exclude: '\.lock$'
# Remove trailing whitespace
- id: trailing-whitespace
args:
# Prevent committing to main/master
- id: no-commit-to-branch
args:
# Configuration
default_language_version:
python: python3
# Run hooks on all files during manual runs
files: ''
exclude: '^(target/|\.git/)'