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
# Pre-commit configuration for RustDupe
# Runs rustfmt and clippy checks before each commit to ensure code quality
#
# Installation:
# pip install pre-commit
# pre-commit install
#
# Manual run:
# pre-commit run --all-files
#
# Skip hooks temporarily:
# git commit --no-verify
# (Use sparingly - prefer fixing issues)
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Rust formatting with rustfmt
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format Rust code with rustfmt
entry: cargo fmt
args:
language: system
types:
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
description: Lint Rust code with clippy (warnings as errors)
entry: cargo clippy
args:
language: system
types:
pass_filenames: false
- id: cargo-check
name: cargo check
description: Type-check Rust code
entry: cargo check
language: system
types:
pass_filenames: false
- id: cargo-test
name: cargo test
description: Run Rust tests
entry: cargo test
args:
language: system
types:
pass_filenames: false
stages:
# Default stages for hooks without explicit stages
default_stages: