Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
80 lines (72 loc) · 2.18 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
80 lines (72 loc) · 2.18 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Pre-commit hooks configuration
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^tests/crash_cases/
- id: end-of-file-fixer
exclude: ^tests/crash_cases/
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: mixed-line-ending
args: ["--fix=lf"]
exclude: ^tests/crash_cases/
# Rust formatting
- repo: local
hooks:
- id: rustfmt
name: rustfmt
description: Format Rust code with rustfmt
entry: cargo fmt --
language: system
types: [rust]
pass_filenames: true
- id: clippy
name: clippy
description: Lint Rust code with clippy
entry: cargo clippy --all-targets -- -D warnings
language: system
types: [rust]
pass_filenames: false
- id: cargo-check
name: cargo check
description: Check Rust code compiles
entry: cargo check --all-targets
language: system
types: [rust]
pass_filenames: false
- id: cargo-test
name: cargo test
description: Run Rust tests
entry: cargo test --all-targets
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]
- id: cargo-bench-check
name: cargo bench check
description: Check benchmarks compile
entry: cargo bench --no-run
language: system
types: [rust]
pass_filenames: false
- id: cargo-doc-check
name: cargo doc check
description: Check for broken doc links
entry: env RUSTDOCFLAGS="-F rustdoc::broken-intra-doc-links" cargo doc --no-deps
language: system
types: [rust]
pass_filenames: false
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: ["--fix", "--disable", "MD013", "MD033", "MD041", "--"]