Repository navigation
Expand file tree
/
Copy pathprek.toml
More file actions
112 lines (87 loc) · 2.49 KB
/
Copy pathprek.toml
File metadata and controls
112 lines (87 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Native prek configuration for wslarc.
# Hook repositories are pinned to immutable tags; bump them together with uv.lock.
minimum_prek_version = "0.5.0"
# uv.lock points at public PyPI. Without this, a machine whose uv default index
# is a private mirror reports the lock as out of date in the uv-lock hook.
# `uv check` starts its own uv subprocess, so a flag would not reach it.
default_env = { UV_DEFAULT_INDEX = "https://pypi.org/simple" }
[[repos]]
repo = "builtin"
[[repos.hooks]]
id = "trailing-whitespace"
[[repos.hooks]]
id = "end-of-file-fixer"
[[repos.hooks]]
id = "mixed-line-ending"
args = ["--fix=lf"]
[[repos.hooks]]
id = "check-merge-conflict"
[[repos.hooks]]
id = "check-case-conflict"
[[repos.hooks]]
id = "check-symlinks"
[[repos.hooks]]
id = "check-toml"
[[repos.hooks]]
id = "check-added-large-files"
args = ["--maxkb=500"]
[[repos.hooks]]
id = "detect-private-key"
# Keep rev in step with ruff in uv.lock.
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.17.4"
[[repos.hooks]]
id = "ruff-check"
args = ["--fix", "--exit-non-zero-on-fix"]
require_serial = true
[[repos.hooks]]
id = "ruff-format"
require_serial = true
[[repos]]
repo = "https://github.com/astral-sh/uv-pre-commit"
rev = "0.13.7"
[[repos.hooks]]
id = "uv-lock"
args = ["--check"]
[[repos]]
repo = "https://github.com/abravalheri/validate-pyproject"
rev = "v0.27"
[[repos.hooks]]
id = "validate-pyproject"
[[repos]]
repo = "https://github.com/betterleaks/betterleaks"
rev = "v2.0.0-rc.8"
[[repos.hooks]]
id = "betterleaks"
# ty is the fast checker and runs on pre-commit; keep its rev in step with ty in
# uv.lock. It reads its file set from pyproject.toml, so no filenames are passed.
[[repos]]
repo = "https://github.com/astral-sh/ty-pre-commit"
rev = "v0.0.100"
[[repos.hooks]]
id = "ty"
# mypy stays the strict gate the repository documents: it checks the whole `files`
# set from pyproject.toml from pyproject.toml, so filenames are not
# passed through: a change in one module can break a caller in another.
[[repos]]
repo = "local"
[[repos.hooks]]
id = "mypy"
name = "mypy"
language = "system"
entry = "uv run --frozen mypy"
types = ["python"]
pass_filenames = false
always_run = true
require_serial = true
# pytest imports the project's dependencies, so it runs in the project's uv
# environment. Tests are fast, but they stay on pre-push.
[[repos.hooks]]
id = "pytest"
name = "pytest"
language = "system"
entry = "uv run --frozen pytest -q"
types = ["python"]
pass_filenames = false
stages = ["pre-push"]