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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
default_language_version:
rust: 1.28.2
default_install_hook_types:
- pre-commit
- post-checkout
- post-merge
- post-rewrite
default_stages:
- pre-commit
- post-checkout
- post-merge
- post-rewrite
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: check-added-large-files
exclude: poetry.lock|uv.lock
- id: check-ast
- id: check-yaml
exclude: mkdocs.yml
args:
- --allow-multiple-documents
- id: check-toml
- id: check-json
exclude: .vscode/launch.json
- id: pretty-format-json
args:
- id: check-merge-conflict
- id: check-case-conflict
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
# - id: no-commit-to-branch
- id: trailing-whitespace
- id: fix-byte-order-marker
exclude: docs/CNAME
- id: mixed-line-ending
args:
- --fix=lf
- id: check-docstring-first
- id: debug-statements
- id: check-symlinks
# shell script linter
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.11.0
hooks:
- id: shellcheck
# md formatting
- repo: https://github.com/executablebooks/mdformat
rev: 1.0.0
hooks:
- id: mdformat
args:
- --number
- --no-validate
additional_dependencies:
# https://mdformat.readthedocs.io/en/stable/users/plugins.html
# Code formatter plugins
- mdformat-beautysh # bash, sh
# - mdformat-black # python
- mdformat-config # json, toml, yaml
# - mdformat-gofmt # go
- mdformat-ruff # python
- mdformat-rustfmt # rust
# - mdformat-shfmt # bash, sh
# - mdformat-web # javascript, js, css, html, xml
# Parser extension plugins
# - mdformat-admon # admonitions
# - mdformat-deflist # definition lists
- mdformat-footnote # footnotes
- mdformat-frontmatter # front matter
- mdformat-gfm # GitHub Flavored Markdown (includes tables)
- mdformat-gfm-alerts # GFM alerts
- mdformat-mkdocs # MKDocs
# - mdformat-myst # MyST
# - mdformat-toc # table of contents
# Other misc plugins
- mdformat-pyproject # load options from pyproject.toml
- mdformat-simple-breaks # three dashes for breaks
# Legacy/Additional
# - mdformat-tables # deprecated, use mdformat-gfm
# - mdformat-wikilink # wikilinks
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks