Skip to content

Commit 131f113

Browse files
authored
🔧 Reconfigure prek priorities (#651)
## Description This PR reconfigures the `prek` priorities to ensure that no two hooks write at the same time. ## Checklist - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~~I have added appropriate tests that cover the new/changed functionality.~~ - [x] ~~I have updated the documentation to reflect these changes.~~ - [x] ~~I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.~~ - [x] ~~I have added migration instructions to the upgrade guide (if needed).~~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes.
1 parent 937c911 commit 131f113

2 files changed

Lines changed: 41 additions & 47 deletions

File tree

.license-tools-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
".*\\.rst",
3030
"py\\.typed",
3131
".*build.*",
32-
"LICENSE"
32+
"(^|/)LICENSE$"
3333
]
3434
}

.pre-commit-config.yaml

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ ci:
1515
skip: [ty-check]
1616

1717
repos:
18-
# Priority 0: Fast validation and independent fixers
19-
2018
## Standard hooks
2119
- repo: https://github.com/pre-commit/pre-commit-hooks
2220
rev: v6.0.0
@@ -26,14 +24,7 @@ repos:
2624
- id: end-of-file-fixer
2725
priority: 1
2826
- id: trailing-whitespace
29-
priority: 1
30-
31-
## Check the pyproject.toml file
32-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
33-
rev: 2026.04.11
34-
hooks:
35-
- id: validate-pyproject
36-
priority: 0
27+
priority: 2
3728

3829
## Check JSON schemata
3930
- repo: https://github.com/python-jsonschema/check-jsonschema
@@ -44,23 +35,6 @@ repos:
4435
- id: check-readthedocs
4536
priority: 0
4637

47-
## Catch common capitalization mistakes
48-
- repo: local
49-
hooks:
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
55-
priority: 0
56-
57-
## Check for spelling
58-
- repo: https://github.com/adhtruong/mirrors-typos
59-
rev: v1.45.0
60-
hooks:
61-
- id: typos
62-
priority: 0
63-
6438
## Check best practices for scientific Python code
6539
- repo: https://github.com/scientific-python/cookie
6640
rev: 2026.04.04
@@ -69,21 +43,45 @@ repos:
6943
additional_dependencies: ["repo-review[cli]"]
7044
priority: 0
7145

72-
## Check for license headers
73-
- repo: https://github.com/emzeat/mz-lictools
74-
rev: v2.9.0
46+
## Check pyproject.toml file
47+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
48+
rev: 2026.04.11
7549
hooks:
76-
- id: license-tools
50+
- id: validate-pyproject
7751
priority: 0
7852

79-
## Ensure uv lock file is up-to-date
53+
## Ensure uv.lock is up to date
8054
- repo: https://github.com/astral-sh/uv-pre-commit
8155
rev: 0.11.6
8256
hooks:
8357
- id: uv-lock
8458
priority: 0
8559

86-
## Tidy up BibTeX files
60+
## Check for common capitalization mistakes
61+
- repo: local
62+
hooks:
63+
- id: disallow-caps
64+
name: Disallow improper capitalization
65+
language: pygrep
66+
entry: \b(Numpy|Github|PyTest|Mqt|Tum)\b
67+
exclude: ^(\.pre-commit-config\.yaml)$
68+
priority: 0
69+
70+
## Check for typos
71+
- repo: https://github.com/adhtruong/mirrors-typos
72+
rev: v1.45.1
73+
hooks:
74+
- id: typos
75+
priority: 3
76+
77+
## Check license headers
78+
- repo: https://github.com/emzeat/mz-lictools
79+
rev: v2.9.0
80+
hooks:
81+
- id: license-tools
82+
priority: 4
83+
84+
## Format BibTeX files with bibtex-tidy
8785
- repo: https://github.com/FlamingTempura/bibtex-tidy
8886
rev: v1.14.0
8987
hooks:
@@ -100,32 +98,28 @@ repos:
10098
"--trailing-commas",
10199
"--remove-empty-fields",
102100
]
103-
priority: 0
104-
105-
# Priority 1: Second-pass fixers
101+
priority: 5
106102

107103
## Format configuration files with prettier
108104
- repo: https://github.com/rbubley/mirrors-prettier
109-
rev: v3.8.2
105+
rev: v3.8.3
110106
hooks:
111107
- id: prettier
112108
types_or: [yaml, markdown, html, css, scss, javascript, json, json5]
113-
priority: 1
109+
priority: 5
114110

115-
## Python linting using ruff
111+
## Format and lint Python files with ruff
116112
- repo: https://github.com/astral-sh/ruff-pre-commit
117-
rev: v0.15.10
113+
rev: v0.15.11
118114
hooks:
119115
- id: ruff-format
120116
types_or: [python, pyi, jupyter, markdown]
121-
priority: 1
117+
priority: 6
122118
- id: ruff-check
123119
require_serial: true
124-
priority: 2
125-
126-
# Priority 2+: Final checks and fixers
120+
priority: 7
127121

128-
## Static type checking using ty (needs to run after lockfile update/ruff format, and ruff lint)
122+
## Check Python types with ty
129123
- repo: local
130124
hooks:
131125
- id: ty-check
@@ -136,4 +130,4 @@ repos:
136130
types_or: [python, pyi, jupyter]
137131
exclude: ^(docs/)
138132
pass_filenames: false
139-
priority: 3
133+
priority: 8

0 commit comments

Comments
 (0)