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 : [mypy]
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
38- 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
49- hooks :
50- - id : fix-ligatures
51- - id : fix-smartquotes
52-
53- # Check for common mistakes
54- - repo : https://github.com/pre-commit/pygrep-hooks
55- rev : v1.10.0
56- hooks :
57- - id : rst-backticks
58- - id : rst-directive-colons
59- - id : rst-inline-touching-normal
60-
61- # Ensure uv lock file is up-to-date
62- - repo : https://github.com/astral-sh/uv-pre-commit
63- rev : 0.9.28
64- hooks :
65- - id : uv-lock
66-
67- # Python linting and formatting using ruff
68- - repo : https://github.com/astral-sh/ruff-pre-commit
69- rev : v0.14.14
70- hooks :
71- - id : ruff-check
72- - id : ruff-format
73-
74- # Also run Black on examples in the documentation
75- - repo : https://github.com/adamchainz/blacken-docs
76- rev : 1.20.0
77- hooks :
78- - id : blacken-docs
79- additional_dependencies : [black==25.*]
80-
81- # Check for license headers
82- - repo : https://github.com/emzeat/mz-lictools
83- rev : v2.9.0
84- hooks :
85- - id : license-tools
86- exclude : \.pkl$
87-
88- # Check static types with mypy
89- - repo : https://github.com/pre-commit/mirrors-mypy
90- rev : v1.19.1
91- hooks :
92- - id : mypy
93- files : ^(src/mqt|tests|noxfile.py)
94- args : []
95- additional_dependencies :
96- - nox
97- - numpy
98- - pytest
99- - pytest-mock
100-
101- # Check for spelling
102- - repo : https://github.com/adhtruong/mirrors-typos
103- rev : v1.42.3
31+ # # Check the pyproject.toml file
32+ - repo : https://github.com/henryiii/validate-pyproject-schema-store
33+ rev : 2026.01.22
10434 hooks :
105- - id : typos
35+ - id : validate-pyproject
36+ priority : 0
10637
107- # Format configuration files with prettier
108- - repo : https://github.com/rbubley/mirrors-prettier
109- rev : v3.8 .1
38+ # # Check JSON schemata
39+ - repo : https://github.com/python-jsonschema/check-jsonschema
40+ rev : 0.36 .1
11041 hooks :
111- - id : prettier
112- types_or : [yaml, markdown, html, css, scss, javascript, json]
42+ - id : check-github-workflows
43+ priority : 0
44+ - id : check-readthedocs
45+ priority : 0
11346
114- # Catch common capitalization mistakes
47+ # # Catch common capitalization mistakes
11548 - repo : local
11649 hooks :
11750 - id : disallow-caps
11851 name : Disallow improper capitalization
11952 language : pygrep
120- entry : PyBind| Numpy|Cmake|CCache| Github|PyTest|Mqt|Tum
53+ entry : ' \b(?: Numpy|Github|PyTest|Mqt|Tum)\b '
12154 exclude : .pre-commit-config.yaml
55+ priority : 0
56+
57+ # # Check for spelling
58+ - repo : https://github.com/adhtruong/mirrors-typos
59+ rev : v1.42.3
60+ hooks :
61+ - id : typos
62+ priority : 0
12263
123- # Check best practices for scientific Python code
64+ # # Check best practices for scientific Python code
12465 - repo : https://github.com/scientific-python/cookie
12566 rev : 2025.11.21
12667 hooks :
12768 - id : sp-repo-review
12869 additional_dependencies : ["repo-review[cli]"]
70+ priority : 0
12971
130- # Check JSON schemata
131- - repo : https://github.com/python-jsonschema/check-jsonschema
132- rev : 0.36.1
72+ # # Check for license headers
73+ - repo : https://github.com/emzeat/mz-lictools
74+ rev : v2.9.0
13375 hooks :
134- - id : check-dependabot
135- - id : check-github-workflows
136- - id : check-readthedocs
76+ - id : license-tools
77+ priority : 0
13778
138- # Check the pyproject.toml file
139- - repo : https://github.com/henryiii/validate-pyproject-schema-store
140- rev : 2026.01.22
79+ # # Ensure uv lock file is up-to-date
80+ - repo : https://github.com/astral-sh/uv-pre-commit
81+ rev : 0.9.28
14182 hooks :
142- - id : validate-pyproject
83+ - id : uv-lock
84+ priority : 0
14385
144- # Tidy up BibTeX files
86+ # # Tidy up BibTeX files
14587 - repo : https://github.com/FlamingTempura/bibtex-tidy
14688 rev : v1.14.0
14789 hooks :
@@ -158,3 +100,61 @@ repos:
158100 " --trailing-commas" ,
159101 " --remove-empty-fields" ,
160102 ]
103+ priority : 0
104+
105+ # Priority 1: Second-pass fixers
106+
107+ # # Format configuration files with prettier
108+ - repo : https://github.com/rbubley/mirrors-prettier
109+ rev : v3.8.1
110+ hooks :
111+ - id : prettier
112+ types_or : [yaml, markdown, html, css, scss, javascript, json]
113+ priority : 1
114+
115+ # # Python linting using ruff
116+ - repo : https://github.com/astral-sh/ruff-pre-commit
117+ rev : v0.14.14
118+ hooks :
119+ - id : ruff-format
120+ priority : 1
121+ - id : ruff-check
122+ require_serial : true
123+ priority : 2
124+
125+ # Priority 2+: Final checks and fixers
126+
127+ # # Clean Jupyter notebooks
128+ - repo : https://github.com/srstevenson/nb-clean
129+ rev : 4.0.1
130+ hooks :
131+ - id : nb-clean
132+ args :
133+ - --remove-empty-cells
134+ - --preserve-cell-metadata
135+ - raw_mimetype
136+ - --
137+ priority : 2
138+
139+ # # Also run Black on examples in the documentation (needs to run after ruff format)
140+ - repo : https://github.com/adamchainz/blacken-docs
141+ rev : 1.20.0
142+ hooks :
143+ - id : blacken-docs
144+ language : python
145+ additional_dependencies : [black==26.*]
146+ priority : 2
147+
148+ # # Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
149+ - repo : https://github.com/pre-commit/mirrors-mypy
150+ rev : v1.19.1
151+ hooks :
152+ - id : mypy
153+ files : ^(src/mqt|tests|noxfile.py)
154+ args : []
155+ additional_dependencies :
156+ - nox
157+ - numpy
158+ - pytest
159+ - pytest-mock
160+ priority : 3
0 commit comments