-
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
156 lines (141 loc) · 4.07 KB
/
.pre-commit-config.yaml
File metadata and controls
156 lines (141 loc) · 4.07 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# To run all pre-commit checks, use:
#
# uvx prek run -a
#
# To install pre-commit hooks that run every time you commit:
#
# uv tool install prek
# prek install
#
ci:
autoupdate_commit_msg: "⬆️🪝 update pre-commit hooks"
autoupdate_schedule: quarterly
autofix_commit_msg: "🎨 pre-commit fixes"
skip: [ty-check]
repos:
## Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
priority: 0
- id: end-of-file-fixer
priority: 1
- id: trailing-whitespace
priority: 2
## Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.1
hooks:
- id: check-github-workflows
priority: 0
- id: check-readthedocs
priority: 0
## Check best practices for scientific Python code
- repo: https://github.com/scientific-python/cookie
rev: 2026.04.04
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
priority: 0
## Check pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.04.11
hooks:
- id: validate-pyproject
priority: 0
## Ensure uv.lock is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.6
hooks:
- id: uv-lock
priority: 0
## Check for common capitalization mistakes
- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: \b(Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum)\b
exclude: ^(\.pre-commit-config\.yaml)$
priority: 0
## Check for typos
- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.45.0
hooks:
- id: typos
priority: 3
## Check license headers
- repo: https://github.com/emzeat/mz-lictools
rev: v2.9.0
hooks:
- id: license-tools
priority: 4
## Format BibTeX files with bibtex-tidy
- repo: https://github.com/FlamingTempura/bibtex-tidy
rev: v1.14.0
hooks:
- id: bibtex-tidy
args:
[
"--align=20",
"--curly",
"--months",
"--blank-lines",
"--sort",
"--strip-enclosing-braces",
"--sort-fields",
"--trailing-commas",
"--remove-empty-fields",
]
priority: 5
## Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.2
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json, json5]
priority: 5
## Format CMake files with cmake-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
additional_dependencies: [pyyaml]
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$
priority: 5
## Format C++ files with clang-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.3
hooks:
- id: clang-format
types_or: [c++, c, cuda]
priority: 5
- id: clang-format
name: clang-format (TableGen)
types_or: [file]
files: \.td$
priority: 5
## Format and lint Python files with ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.10
hooks:
- id: ruff-format
types_or: [python, pyi, jupyter, markdown]
priority: 6
- id: ruff-check
require_serial: true
priority: 7
## Check Python types with ty
- repo: local
hooks:
- id: ty-check
name: ty check
entry: uvx python -c "import subprocess; import sys; r = subprocess.run(['uv', 'sync', '--no-install-project', '--inexact']); sys.exit(r.returncode or subprocess.run(['uv', 'run', '--no-sync', 'ty', 'check']).returncode)"
language: unsupported
require_serial: true
types_or: [python, pyi, jupyter]
exclude: ^(docs/|mlir/|eval/)
pass_filenames: false
priority: 8