11# To run all pre-commit checks, use:
22#
3- # pre-commit run -a
3+ # uvx prek run -a
44#
55# To install pre-commit hooks that run every time you commit:
66#
7- # pre-commit install
7+ # uv tool install prek
8+ # prek install
89#
910
1011ci :
1112 autoupdate_commit_msg : " ⬆️🪝 update pre-commit hooks"
12- autofix_commit_msg : " 🎨 pre-commit fixes"
1313 autoupdate_schedule : quarterly
14+ autofix_commit_msg : " 🎨 pre-commit fixes"
1415 skip : [ty-check]
1516
1617repos :
17- # Standard hooks
18+ # Priority 0: Fast validation and independent fixers
19+
20+ # # Standard hooks
1821 - repo : https://github.com/pre-commit/pre-commit-hooks
1922 rev : v6.0.0
2023 hooks :
21- - id : check-added-large-files
22- args : ["--maxkb=2048"]
23- - id : check-case-conflict
24- - id : check-vcs-permalinks
2524 - id : check-merge-conflict
26- - id : check-symlinks
27- - id : check-json
28- - id : check-toml
29- - id : check-yaml
30- - id : debug-statements
25+ priority : 0
3126 - id : end-of-file-fixer
32- - id : mixed-line-ending
27+ priority : 1
3328 - id : trailing-whitespace
29+ priority : 1
3430
35- # Clean jupyter notebooks
36- - repo : https://github.com/srstevenson/nb-clean
37- rev : 4.0.1
31+ # # Check the pyproject.toml file
32+ - repo : https://github.com/henryiii/validate-pyproject-schema-store
33+ rev : 2026.01.22
3834 hooks :
39- - id : nb-clean
40- args :
41- - --remove-empty-cells
42- - --preserve-cell-metadata
43- - raw_mimetype
44- - --
45-
46- # Handling unwanted unicode characters
47- - repo : https://github.com/sirosen/texthooks
48- rev : 0.7.1
35+ - id : validate-pyproject
36+ priority : 0
37+
38+ # # Check JSON schemata
39+ - repo : https://github.com/python-jsonschema/check-jsonschema
40+ rev : 0.36.0
41+ hooks :
42+ - id : check-github-workflows
43+ priority : 0
44+ - id : check-readthedocs
45+ priority : 0
46+
47+ # # Catch common capitalization mistakes
48+ - repo : local
4949 hooks :
50- - id : fix-ligatures
51- - id : fix-smartquotes
50+ - id : disallow-caps
51+ name : Disallow improper capitalization
52+ language : pygrep
53+ entry : Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum|MQTopt|MQTref
54+ exclude : .pre-commit-config.yaml
55+ priority : 0
5256
53- # Check for common mistakes
54- - repo : https://github.com/pre-commit/pygrep-hooks
55- rev : v1.10.0
57+ # # Check for spelling
58+ - repo : https://github.com/adhtruong/mirrors-typos
59+ rev : v1.42.1
5660 hooks :
57- - id : rst-backticks
58- - id : rst-directive-colons
59- - id : rst-inline-touching-normal
61+ - id : typos
62+ priority : 0
6063
61- # Check for license headers
64+ # # Check best practices for scientific Python code
65+ - repo : https://github.com/scientific-python/cookie
66+ rev : 2025.11.21
67+ hooks :
68+ - id : sp-repo-review
69+ additional_dependencies : ["repo-review[cli]"]
70+ priority : 0
71+
72+ # # Check for license headers
6273 - repo : https://github.com/emzeat/mz-lictools
6374 rev : v2.9.0
6475 hooks :
6576 - id : license-tools
77+ priority : 0
6678
67- # Ensure uv lock file is up-to-date
79+ # # Ensure uv lock file is up-to-date
6880 - repo : https://github.com/astral-sh/uv-pre-commit
6981 rev : 0.9.26
7082 hooks :
7183 - id : uv-lock
84+ priority : 0
7285
73- # Python linting using ruff
74- - repo : https://github.com/astral-sh/ruff-pre-commit
75- rev : v0 .14.14
86+ # # Tidy up BibTeX files
87+ - repo : https://github.com/FlamingTempura/bibtex-tidy
88+ rev : v1 .14.0
7689 hooks :
77- - id : ruff-check
78- - id : ruff-format
90+ - id : bibtex-tidy
91+ args :
92+ [
93+ " --align=20" ,
94+ " --curly" ,
95+ " --months" ,
96+ " --blank-lines" ,
97+ " --sort" ,
98+ " --strip-enclosing-braces" ,
99+ " --sort-fields" ,
100+ " --trailing-commas" ,
101+ " --remove-empty-fields" ,
102+ ]
103+ priority : 0
79104
80- # Also run Black on examples in the documentation
81- - repo : https://github.com/adamchainz/blacken-docs
82- rev : 1.20.0
105+ # Priority 1: Second-pass fixers
106+
107+ # # Clang-format the C++ part of the code base automatically
108+ - repo : https://github.com/pre-commit/mirrors-clang-format
109+ rev : v21.1.8
83110 hooks :
84- - id : blacken-docs
85- additional_dependencies : [black==25.*]
111+ - id : clang-format
112+ types_or : [c++, c, cuda]
113+ priority : 1
86114
87- # CMake format and lint the CMakeLists.txt files
115+ # # CMake format and lint the CMakeLists.txt files
88116 - repo : https://github.com/cheshirekow/cmake-format-precommit
89117 rev : v0.6.13
90118 hooks :
91119 - id : cmake-format
92120 additional_dependencies : [pyyaml]
93121 types : [file]
94122 files : (\.cmake|CMakeLists.txt)(.in)?$
123+ priority : 1
95124
96- # Clang-format the C++ part of the code base automatically
97- - repo : https://github.com/pre-commit/mirrors-clang-format
98- rev : v21.1.8
99- hooks :
100- - id : clang-format
101- types_or : [c++, c, cuda]
102-
103- # Format configuration files with prettier
125+ # # Format configuration files with prettier
104126 - repo : https://github.com/rbubley/mirrors-prettier
105127 rev : v3.8.1
106128 hooks :
107129 - id : prettier
108130 types_or : [yaml, markdown, html, css, scss, javascript, json]
131+ priority : 1
132+
133+ # # Python linting using ruff
134+ - repo : https://github.com/astral-sh/ruff-pre-commit
135+ rev : v0.14.14
136+ hooks :
137+ - id : ruff-format
138+ priority : 1
139+ - id : ruff-check
140+ require_serial : true
141+ priority : 2
109142
110- # # Static type checking using ty
143+ # Priority 2+: Final checks and fixers
144+
145+ # # Also run Black on examples in the documentation (needs to run after ruff format)
146+ - repo : https://github.com/adamchainz/blacken-docs
147+ rev : 1.20.0
148+ hooks :
149+ - id : blacken-docs
150+ language : python
151+ additional_dependencies : [black==26.*]
152+ priority : 2
153+
154+ # # Static type checking using ty (needs to run after lockfile update/ruff format, and ruff lint)
111155 - repo : local
112156 hooks :
113157 - id : ty-check
@@ -117,57 +161,4 @@ repos:
117161 require_serial : true
118162 types_or : [python, pyi, jupyter]
119163 exclude : ^(docs/)
120-
121- # Check for spelling
122- - repo : https://github.com/adhtruong/mirrors-typos
123- rev : v1.42.1
124- hooks :
125- - id : typos
126-
127- # Catch common capitalization mistakes
128- - repo : local
129- hooks :
130- - id : disallow-caps
131- name : Disallow improper capitalization
132- language : pygrep
133- entry : Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
134- exclude : .pre-commit-config.yaml
135-
136- # Check best practices for scientific Python code
137- - repo : https://github.com/scientific-python/cookie
138- rev : 2025.11.21
139- hooks :
140- - id : sp-repo-review
141- additional_dependencies : ["repo-review[cli]"]
142-
143- # Check JSON schemata
144- - repo : https://github.com/python-jsonschema/check-jsonschema
145- rev : 0.36.0
146- hooks :
147- - id : check-dependabot
148- - id : check-github-workflows
149- - id : check-readthedocs
150-
151- # Check the pyproject.toml file
152- - repo : https://github.com/henryiii/validate-pyproject-schema-store
153- rev : 2026.01.22
154- hooks :
155- - id : validate-pyproject
156-
157- # Tidy up BibTeX files
158- - repo : https://github.com/FlamingTempura/bibtex-tidy
159- rev : v1.14.0
160- hooks :
161- - id : bibtex-tidy
162- args :
163- [
164- " --align=20" ,
165- " --curly" ,
166- " --months" ,
167- " --blank-lines" ,
168- " --sort" ,
169- " --strip-enclosing-braces" ,
170- " --sort-fields" ,
171- " --trailing-commas" ,
172- " --remove-empty-fields" ,
173- ]
164+ priority : 3
0 commit comments