-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
165 lines (146 loc) · 4.18 KB
/
.pre-commit-config.yaml
File metadata and controls
165 lines (146 loc) · 4.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
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
157
158
159
160
161
162
163
164
165
# 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: [mypy]
repos:
# Priority 0: Fast validation and independent fixers
## 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: 1
## Check the pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.01.22
hooks:
- id: validate-pyproject
priority: 0
## Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.0
hooks:
- id: check-github-workflows
priority: 0
- id: check-readthedocs
priority: 0
## Catch common capitalization mistakes
- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum|MQTopt|MQTref
exclude: .pre-commit-config.yaml
priority: 0
## Check for spelling
- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.42.1
hooks:
- id: typos
priority: 0
## Check best practices for scientific Python code
- repo: https://github.com/scientific-python/cookie
rev: 2025.11.21
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
priority: 0
## Check for license headers
- repo: https://github.com/emzeat/mz-lictools
rev: v2.9.0
hooks:
- id: license-tools
priority: 0
## Ensure uv lock file is up-to-date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.26
hooks:
- id: uv-lock
priority: 0
## Tidy up BibTeX files
- 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: 0
# Priority 1: Second-pass fixers
## Clang-format the C++ part of the code base automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.8
hooks:
- id: clang-format
types_or: [c++, c, cuda]
priority: 1
## CMake format and lint the CMakeLists.txt files
- 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: 1
## Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.1
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
priority: 1
## Python linting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff-format
priority: 1
- id: ruff-check
require_serial: true
priority: 2
# Priority 2+: Final checks and fixers
## Also run Black on examples in the documentation (needs to run after ruff format)
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.20.0
hooks:
- id: blacken-docs
language: python
additional_dependencies: [black==26.*]
priority: 2
## Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
files: ^(python/mqt|test/python)
args: []
additional_dependencies:
- pandas-stubs
- pytest
- scipy-stubs
- types-networkx