-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
79 lines (70 loc) · 2.57 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
79 lines (70 loc) · 2.57 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
# Pre-commit / prek configuration
# Runs with either `pre-commit run --all-files` or `prek run --all-files`
# prek (https://github.com/j178/prek) is a drop-in Rust reimplementation
# of pre-commit and understands this file unchanged.
default_install_hook_types: [pre-commit, commit-msg]
default_stages: [pre-commit]
repos:
# --- Generic hygiene --------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(CHANGELOG\.md|Cargo\.lock)$
- id: end-of-file-fixer
exclude: ^(CHANGELOG\.md|Cargo\.lock)$
- id: check-yaml
- id: check-toml
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-merge-conflict
- id: mixed-line-ending
args: [--fix=lf]
# --- Spell check ------------------------------------------------------
- repo: https://github.com/crate-ci/typos
rev: v1.28.4
hooks:
- id: typos
# --- Rust -------------------------------------------------------------
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
args: [--all, --]
- id: clippy
# Note: skips `advanced_examples` feature — it pulls opencv/ort which
# require LLVM + libclang system packages and makes this hook
# unusable on a fresh dev box or in CI without extra setup.
args: [--all-targets, --features, python, --, -D, warnings]
# --- TOML formatter ---------------------------------------------------
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- id: taplo-lint
# --- Markdown / Prose -------------------------------------------------
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.4.2
hooks:
- id: prettier
types_or: [markdown, yaml, json]
exclude: ^(CHANGELOG\.md|target/|site/|docs/api/|book/)
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
args: [--fix]
exclude: ^(CHANGELOG\.md|target/|site/|docs/api/|book/)
# --- Python (pyo3 bindings / scripts) --------------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
# --- Commit message ---------------------------------------------------
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]