Repository navigation
Expand file tree
/
Copy pathprek.toml
More file actions
102 lines (82 loc) · 2.44 KB
/
Copy pathprek.toml
File metadata and controls
102 lines (82 loc) · 2.44 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
# Native prek configuration for deskhand.
# Hook repositories are pinned so maintenance changes remain reviewable.
minimum_prek_version = "0.5.10"
[[repos]]
repo = "builtin"
[[repos.hooks]]
id = "check-added-large-files"
args = ["--maxkb=512"]
[[repos.hooks]]
id = "check-json"
[[repos.hooks]]
id = "check-toml"
[[repos.hooks]]
id = "check-merge-conflict"
[[repos.hooks]]
id = "detect-private-key"
[[repos.hooks]]
id = "end-of-file-fixer"
priority = 2
[[repos.hooks]]
id = "trailing-whitespace"
args = ["--markdown-linebreak-ext=md"]
priority = 2
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.17.5"
[[repos.hooks]]
id = "ruff-check"
require_serial = true
[[repos.hooks]]
id = "ruff-format"
require_serial = true
[[repos]]
repo = "https://github.com/abravalheri/validate-pyproject"
rev = "v0.27"
[[repos.hooks]]
id = "validate-pyproject"
[[repos]]
repo = "https://github.com/astral-sh/ty-pre-commit"
rev = "v0.0.104"
[[repos.hooks]]
id = "ty"
[[repos]]
repo = "local"
# bridge.ps1 is shipped as UTF-8 and sent to Windows PowerShell 5.1 as text, so it must parse there,
# stay ASCII, and never exit the resident worker. Those three rules are already pinned by this test;
# running it cannot drift from them the way a re-implementation in a hook would.
[[repos.hooks]]
id = "bridge-script-rules"
name = "bridge.ps1 rules"
language = "system"
entry = "uv run pytest tests/unit/test_bridge_script.py -q"
files = "\\.ps1$"
pass_filenames = false
require_serial = true
# Changing a tool schema without regenerating the advertised contract is the drift a reader cannot
# see in the diff.
[[repos.hooks]]
id = "advertised-tools-are-current"
name = "tools.json is current"
language = "system"
entry = "bash -c 'uv run python tests/parity/dump_tools.py || exit 1; git diff --exit-code -- tests/parity/fixtures/tools.json || { echo \"fixtures/tools.json was regenerated; review and stage it\"; exit 1; }'"
files = "^(src/deskhand/onenote/(schemas|tools|server)\\.py|tests/parity/dump_tools\\.py)$"
pass_filenames = false
require_serial = true
# Slow checks: they need the whole tree, not the staged files, so they run before a push.
[[repos.hooks]]
id = "pyright"
name = "pyright"
language = "system"
entry = "uv run pyright"
files = "\\.py$"
pass_filenames = false
stages = ["pre-push"]
[[repos.hooks]]
id = "unit-tests"
name = "unit tests"
language = "system"
entry = "uv run pytest -q"
files = "^(src|tests)/.*\\.py$"
pass_filenames = false
stages = ["pre-push"]