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"
15+ skip : [mypy]
1416
1517repos :
16- # Standard hooks
18+ # Priority 0: Fast validation and independent fixers
19+
20+ # # Standard hooks
1721 - repo : https://github.com/pre-commit/pre-commit-hooks
1822 rev : v6.0.0
1923 hooks :
20- - id : check-added-large-files
21- args : ["--maxkb=2048"]
22- - id : check-case-conflict
23- - id : check-vcs-permalinks
2424 - id : check-merge-conflict
25- - id : check-symlinks
26- - id : check-json
27- - id : check-toml
28- - id : check-yaml
29- - id : debug-statements
25+ priority : 0
3026 - id : end-of-file-fixer
31- - id : mixed-line-ending
27+ priority : 1
3228 - id : trailing-whitespace
29+ priority : 1
3330
34- # Clean jupyter notebooks
35- - repo : https://github.com/srstevenson/nb-clean
36- rev : 4.0.1
37- hooks :
38- - id : nb-clean
39- args :
40- - --remove-empty-cells
41- - --preserve-cell-metadata
42- - raw_mimetype
43- - --
44-
45- # Handling unwanted unicode characters
46- - repo : https://github.com/sirosen/texthooks
47- rev : 0.7.1
48- hooks :
49- - id : fix-ligatures
50- - id : fix-smartquotes
51-
52- # Check for common mistakes
53- - repo : https://github.com/pre-commit/pygrep-hooks
54- rev : v1.10.0
55- hooks :
56- - id : rst-backticks
57- - id : rst-directive-colons
58- - id : rst-inline-touching-normal
59-
60- # Ensure uv lock file is up-to-date
61- - repo : https://github.com/astral-sh/uv-pre-commit
62- rev : 0.9.28
63- hooks :
64- - id : uv-lock
65-
66- # Python linting using ruff
67- - repo : https://github.com/astral-sh/ruff-pre-commit
68- rev : v0.14.14
69- hooks :
70- - id : ruff-check
71- - id : ruff-format
72-
73- # Static type checking using mypy
74- - repo : https://github.com/pre-commit/mirrors-mypy
75- rev : v1.19.1
31+ # # Check the pyproject.toml file
32+ - repo : https://github.com/henryiii/validate-pyproject-schema-store
33+ rev : 2026.01.22
7634 hooks :
77- - id : mypy
78- files : ^^(src/mqt|tests|noxfile.py)
79- args : []
80- additional_dependencies :
81- - matplotlib
82- - nox
83- - more_itertools
84- - types-networkx
35+ - id : validate-pyproject
36+ priority : 0
8537
86- # Also run Black on examples in the documentation
87- - repo : https://github.com/adamchainz/blacken-docs
88- rev : 1.20.0
38+ # # Check JSON schemata
39+ - repo : https://github.com/python-jsonschema/check-jsonschema
40+ rev : 0.36.1
8941 hooks :
90- - id : blacken-docs
91- additional_dependencies : [black==25.*]
42+ - id : check-github-workflows
43+ priority : 0
44+ - id : check-readthedocs
45+ priority : 0
9246
93- # Format configuration files with prettier
94- - repo : https://github.com/rbubley/mirrors-prettier
95- rev : v3.8.1
47+ # # Catch common capitalization mistakes
48+ - repo : local
9649 hooks :
97- - id : prettier
98- types_or : [yaml, markdown, html, css, scss, javascript, json]
50+ - id : disallow-caps
51+ name : Disallow improper capitalization
52+ language : pygrep
53+ entry : \b(Numpy|Github|PyTest|Mqt|Tum)\b
54+ exclude : ^(\.pre-commit-config\.yaml|.*\.png)$
55+ priority : 0
9956
100- # Check for spelling
57+ # # Check for spelling
10158 - repo : https://github.com/adhtruong/mirrors-typos
10259 rev : v1.42.3
10360 hooks :
10461 - id : typos
62+ priority : 0
10563
106- # Catch common capitalization mistakes
107- - repo : local
108- hooks :
109- - id : disallow-caps
110- name : Disallow improper capitalization
111- language : pygrep
112- entry : PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum|MQTopt|MQTref
113- exclude : .pre-commit-config.yaml|^docs/_static
114-
115- # Check best practices for scientific Python code
64+ # # Check best practices for scientific Python code
11665 - repo : https://github.com/scientific-python/cookie
11766 rev : 2025.11.21
11867 hooks :
11968 - id : sp-repo-review
12069 additional_dependencies : ["repo-review[cli]"]
70+ priority : 0
12171
122- # Check JSON schemata
123- - repo : https://github.com/python-jsonschema/check-jsonschema
124- rev : 0.36.1
125- hooks :
126- - id : check-dependabot
127- - id : check-github-workflows
128- - id : check-readthedocs
129-
130- # Check the pyproject.toml file
131- - repo : https://github.com/henryiii/validate-pyproject-schema-store
132- rev : 2026.01.22
72+ # # Ensure uv lock file is up-to-date
73+ - repo : https://github.com/astral-sh/uv-pre-commit
74+ rev : 0.9.28
13375 hooks :
134- - id : validate-pyproject
76+ - id : uv-lock
77+ priority : 0
13578
136- # Tidy up BibTeX files
79+ # # Tidy up BibTeX files
13780 - repo : https://github.com/FlamingTempura/bibtex-tidy
13881 rev : v1.14.0
13982 hooks :
@@ -150,3 +93,49 @@ repos:
15093 " --trailing-commas" ,
15194 " --remove-empty-fields" ,
15295 ]
96+ priority : 0
97+
98+ # Priority 1: Second-pass fixers
99+
100+ # # Format configuration files with prettier
101+ - repo : https://github.com/rbubley/mirrors-prettier
102+ rev : v3.8.1
103+ hooks :
104+ - id : prettier
105+ types_or : [yaml, markdown, html, css, scss, javascript, json]
106+ priority : 1
107+
108+ # # Python linting using ruff
109+ - repo : https://github.com/astral-sh/ruff-pre-commit
110+ rev : v0.14.14
111+ hooks :
112+ - id : ruff-format
113+ priority : 1
114+ - id : ruff-check
115+ require_serial : true
116+ priority : 2
117+
118+ # Priority 2+: Final checks and fixers
119+
120+ # # Also run Black on examples in the documentation (needs to run after ruff format)
121+ - repo : https://github.com/adamchainz/blacken-docs
122+ rev : 1.20.0
123+ hooks :
124+ - id : blacken-docs
125+ language : python
126+ additional_dependencies : [black==26.*]
127+ priority : 2
128+
129+ # # Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
130+ - repo : https://github.com/pre-commit/mirrors-mypy
131+ rev : v1.19.1
132+ hooks :
133+ - id : mypy
134+ files : ^(src/mqt|tests|noxfile.py)
135+ args : []
136+ additional_dependencies :
137+ - matplotlib
138+ - nox
139+ - more_itertools
140+ - types-networkx
141+ priority : 3
0 commit comments