-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
46 lines (43 loc) · 1.6 KB
/
Copy pathlefthook.yml
File metadata and controls
46 lines (43 loc) · 1.6 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
# Git hooks. Install with: mise run install-hooks
# Skip all: LEFTHOOK=0 git commit
# Skip one: LEFTHOOK_EXCLUDE=ruff-check git commit
pre-commit:
parallel: true
commands:
ruff-check:
glob: "*.py"
run: mise exec -- ruff check {staged_files}
ruff-format:
glob: "*.py"
run: mise exec -- ruff format --check {staged_files}
proto-lint:
glob: "proto/**/*.proto"
run: mise run //proto:lint
mise-lock:
glob: "{mise.toml,mise.lock,.python-version}"
run: MISE_LOCK_CHECK_FROM=index mise run lint:mise-lock
http-spec:
# The committed OpenAPI contract tracks the code: regenerate and stage it
# whenever a commit touches the runtime source, so it never drifts and the
# spec change rides the same commit reviewers see. The glob spans the whole
# package because the rendered document reaches past the route modules —
# the published enums come from `core` — and it is anchored at `src/`
# because a `**/` segment needs a directory level beneath it: a pattern
# like `src/reactor_runtime/http/**/*.py` skips `http/routes.py` itself.
glob: "src/**/*.py"
run: mise run http-spec && git add api/openapi.json
post-checkout:
commands:
mise-trust:
# Trust this checkout's mise config so tasks and hooks resolve after a
# clone, branch switch, or fresh worktree. Silent; never blocks checkout.
run: mise trust --yes --quiet 2>/dev/null || true
pre-push:
parallel: true
commands:
lint:
run: mise run lint
typecheck:
run: mise run typecheck
test:
run: mise run test