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
63
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
name: check toml files
- id: check-yaml
name: check yaml files
# https://docs.rs/cargo-deny/latest/cargo_deny/#pre-commit-hook
- repo: https://github.com/EmbarkStudios/cargo-deny
rev: 0.19.0 # choose your preferred tag
hooks:
- id: cargo-deny
args:
- repo: local
hooks:
# rust codes
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --all -- --check
language: system
pass_filenames: false
types:
- id: cargo-check
name: cargo check
entry: cargo check
language: system
pass_filenames: false
types:
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy -- -D warnings
language: system
pass_filenames: false
types:
- id: cargo-clippy-python
name: cargo clippy python
entry: cargo --features python -- -D warnings
language: system
pass_filenames: false
types:
- id: ty-check
name: ty type check (if .venv exists)
entry: python hooks/ty-check.py
language: python
pass_filenames: false
types:
additional_dependencies:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.13
hooks:
- id: ruff-check
args:
# Run the formatter.
- id: ruff-format