Skip to content

Commit 6f5a1b1

Browse files
committed
Replace pre-commit with prek
1 parent 5aa9cf5 commit 6f5a1b1

File tree

4 files changed

+55
-76
lines changed

4 files changed

+55
-76
lines changed

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,63 @@ repos:
66
rev: v6.0.0
77
hooks:
88
- id: check-added-large-files
9+
priority: 0
910
- id: check-ast
11+
priority: 0
1012
- id: check-merge-conflict
13+
priority: 0
1114
- id: debug-statements
15+
priority: 0
1216
- id: detect-private-key
17+
priority: 0
1318
- id: end-of-file-fixer
1419
types: [python]
1520
- id: fix-byte-order-marker
21+
priority: 1
1622
- id: mixed-line-ending
1723
args: [--fix=lf]
1824
types: [python]
25+
priority: 2
1926
- id: trailing-whitespace
27+
priority: 3
2028

2129
- repo: https://github.com/pre-commit/pygrep-hooks
2230
rev: v1.10.0
2331
hooks:
2432
- id: python-check-blanket-noqa
33+
priority: 0
2534
- id: python-check-mock-methods
35+
priority: 0
2636
- id: python-no-eval
37+
priority: 0
2738
- id: python-no-log-warn
39+
priority: 0
2840
- id: python-use-type-annotations
41+
priority: 0
2942
- id: text-unicode-replacement-char
43+
priority: 0
3044

3145
- repo: https://github.com/Lucas-C/pre-commit-hooks
3246
rev: v1.5.5
3347
hooks:
3448
- id: forbid-tabs
49+
priority: 0
3550
- id: remove-tabs
3651
args: [--whitespaces-count, '2']
52+
priority: 4
3753
- id: chmod
3854
args: ['644']
3955
exclude_types: [shell]
4056
exclude: ^(.*__main__\.py|syncmaster/server/scripts/.*\.py|docker/.*\.py|tests/resources/file_df_connection/generate.*.py)$
57+
priority: 5
4158
- id: chmod
4259
args: ['755']
4360
types: [shell]
61+
priority: 5
4462
- id: chmod
4563
args: ['755']
4664
files: ^(.*__main__\.py|syncmaster/server/scripts/.*\.py|docker/.*\.py|tests/resources/file_df_connection/generate.*.py)$
65+
priority: 5
4766
- id: insert-license
4867
types: [python]
4968
exclude: ^(syncmaster/server/dependencies/stub.py|docs/.*\.py|tests/.*\.py)$
@@ -52,13 +71,16 @@ repos:
5271
- .spdx-license-header.txt
5372
- --allow-past-years
5473
- --no-extra-eol
74+
priority: 6
5575

5676
- repo: https://github.com/astral-sh/ruff-pre-commit
5777
rev: v0.14.10
5878
hooks:
5979
- id: ruff-format
80+
priority: 7
6081
- id: ruff-check
6182
args: [--fix]
83+
priority: 8
6284

6385
- repo: local
6486
hooks:
@@ -68,28 +90,34 @@ repos:
6890
language: python
6991
require_serial: true
7092
pass_filenames: false
93+
priority: 9
7194

7295

7396
- repo: https://github.com/IamTheFij/docker-pre-commit
7497
rev: v3.0.1
7598
hooks:
7699
- id: docker-compose-check
100+
priority: 0
77101

78102
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
79103
rev: v2.15.0
80104
hooks:
81105
- id: pretty-format-yaml
82106
args: [--autofix, --indent, '2', --offset, '2']
107+
priority: 5
83108

84109
- repo: https://github.com/astral-sh/uv-pre-commit
85110
rev: 0.9.18
86111
hooks:
87112
- id: uv-lock
113+
priority: 5
88114

89115
- repo: meta
90116
hooks:
91117
- id: check-hooks-apply
118+
priority: 0
92119
- id: check-useless-excludes
120+
priority: 0
93121

94122
ci:
95123
skip:

CONTRIBUTING.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ Enable pre-commit hooks
7474
`pre-commit <https://pre-commit.com/>`_ hooks allows to validate & fix repository content before making new commit.
7575
It allows to run linters, formatters, fix file permissions and so on. If something is wrong, changes cannot be committed.
7676

77-
Firstly, install pre-commit hooks:
77+
Firstly, install `prek <https://prek.j178.dev/>`_ hooks:
7878

7979
.. code:: bash
8080
81-
pre-commit install --install-hooks
81+
prek install --install-hooks
8282
8383
Ant then test hooks run:
8484

8585
.. code:: bash
8686
87-
pre-commit run
87+
prek run
8888
8989
How to
9090
------

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test = [
107107
]
108108
dev = [
109109
"mypy~=1.19.1",
110-
"pre-commit~=4.5.0",
110+
"prek~=0.2.25",
111111
"sqlalchemy[mypy]~=2.0.44",
112112
"types-jwcrypto~=1.5.0",
113113
]

uv.lock

Lines changed: 23 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)