-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathprek.toml
More file actions
72 lines (68 loc) · 6.3 KB
/
Copy pathprek.toml
File metadata and controls
72 lines (68 loc) · 6.3 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
default_install_hook_types = ["pre-commit", "pre-push"]
default_stages = ["pre-commit"]
# prek runs hooks that share a priority value concurrently and runs priority
# groups in ascending order. Hooks that mutate files must not share a group
# with any hook that reads or writes the same files. Layout:
# 0 read-only guards (builtin checks, meta checks)
# 1-3 file fixers, each mutating domain isolated from same-file hooks
# 4 frontend-deps (bun install mutates node_modules, which every
# Node-based hook below reads; it must finish before they start)
# 5 api-generate (rewrites generated Go/TS consumed by later groups)
# 10 independent lanes: bounded Go lint, frontend core, rust, scripts
# 20+ bounded Go consumers, serialized to avoid multiplying host load
[[repos]]
repo = "builtin"
hooks = [
{ id = "check-case-conflict", priority = 0 },
{ id = "check-merge-conflict", args = [
"--assume-in-merge",
], priority = 0 },
{ id = "detect-private-key", priority = 0 },
{ id = "no-commit-to-branch", priority = 0 },
{ id = "check-added-large-files", args = [
"--maxkb=1024",
], exclude = "^internal/apiclient/generated/client\\.go$", priority = 0 },
{ id = "check-json", priority = 0 },
{ id = "check-toml", priority = 0 },
{ id = "check-yaml", priority = 0 },
{ id = "trailing-whitespace", args = [
"--markdown-linebreak-ext=md",
], priority = 1 },
{ id = "end-of-file-fixer", priority = 2 },
]
[[repos]]
repo = "local"
hooks = [
{ id = "gofmt", name = "gofmt + goimports + gofumpt (via custom-gcl fmt)", language = "system", entry = "./scripts/run-hook-go.sh make fmt", files = "\\.go$", pass_filenames = false, priority = 3 },
{ id = "cargo-fmt", name = "cargo fmt", language = "system", entry = "cargo fmt --all", files = "^(Cargo\\.toml|Cargo\\.lock|rust/.*\\.rs|rust/.*/Cargo\\.toml)$", pass_filenames = false, priority = 3 },
{ id = "frontend-deps", name = "install workspace dependencies", language = "system", entry = "make frontend-deps", always_run = true, pass_filenames = false, priority = 4 },
{ id = "api-generate", name = "regenerate api clients", language = "system", entry = "make api-generate", files = "^(go\\.mod|go\\.sum|cmd/kenn-forge-openapi/.*\\.go|internal/server/.*\\.go|internal/db/.*\\.go|internal/apiclient/.*|frontend/package\\.json|frontend/bun\\.lock)$", exclude = "^internal/apiclient/generated/client\\.go$", pass_filenames = false, priority = 5 },
{ id = "lint-config-check", name = "kennlint config drift", language = "system", entry = "./scripts/run-hook-go.sh make lint-config-check", files = "^(\\.golangci(\\.overlay)?\\.yml|\\.custom-gcl\\.yml|go\\.mod|go\\.sum)$", pass_filenames = false, priority = 8 },
{ id = "golangci-lint", name = "golangci-lint --fix", language = "system", entry = "./scripts/run-hook-go.sh make lint", files = "^(go\\.mod|go\\.sum|.*\\.go)$", pass_filenames = false, priority = 10 },
{ id = "golangci-lint-check", name = "golangci-lint check", language = "system", entry = "./scripts/run-hook-go.sh make lint-check", stages = [
"pre-push",
], always_run = true, pass_filenames = false, priority = 10 },
{ id = "frontend-check", name = "vite-plus frontend core check", language = "system", entry = "make frontend-check-core-no-deps", files = "^(vite\\.config\\.ts|package\\.json|bun\\.lock|frontend/((src|tests)/.*\\.(svelte|ts)|package\\.json|tsconfig\\.json|vite\\.config\\.ts|playwright(-e2e)?\\.config\\.ts)|packages/(ui|github-app-ui)/(src/.*\\.(svelte|ts)|package\\.json|tsconfig\\.json))$", pass_filenames = false, priority = 10 },
{ id = "cargo-clippy", name = "cargo clippy", language = "system", entry = "cargo clippy --workspace --all-targets -- -D warnings", files = "^(Cargo\\.toml|Cargo\\.lock|rust/.*\\.(rs|toml)|rust/.*/Cargo\\.toml)$", pass_filenames = false, priority = 10 },
{ id = "frontend-api-client-check", name = "prevent manual frontend /api/v1 calls", language = "system", entry = "make frontend-api-client-check", files = "^(scripts/lint-api-urls\\.(mjs|test\\.mjs)|frontend/src/.*\\.(svelte|ts|js|tsx|jsx))$", pass_filenames = false, priority = 10 },
{ id = "font-size-token-check", name = "enforce font-size design tokens", language = "system", entry = "make font-size-token-check", files = "^(scripts/check-font-size-tokens\\.(ts|test\\.ts)|frontend/src/.*\\.(svelte|css|ts))$", pass_filenames = false, priority = 10 },
{ id = "script-tests", name = "script regression tests", language = "system", entry = "make script-tests", files = "^(scripts/.*\\.(mjs|ts|sh|py)|frontend/scripts/.*\\.ts|docs/screenshots/.*\\.(md|ts)|package\\.json|bun\\.lock)$", pass_filenames = false, priority = 10 },
{ id = "playwright-version-check", name = "browser CI image matches pinned toolchain", language = "system", entry = "make playwright-version-check", files = "^(scripts/check-playwright-version\\.mjs|\\.github/docker/playwright/Dockerfile|\\.github/workflows/ci\\.yml|package\\.json|frontend/package\\.json|packages/github-app-ui/package\\.json)$", pass_filenames = false, priority = 10 },
{ id = "huma-check", name = "shared Huma API contract", language = "system", entry = "./scripts/run-hook-go.sh make huma-check", always_run = true, pass_filenames = false, priority = 21 },
{ id = "huma-route-check", name = "prevent non-Huma Go routes", language = "system", entry = "./scripts/run-hook-go.sh make huma-route-check", files = "^(tools/nohttpmux/.*\\.go|cmd/.*\\.go|internal/.*\\.go|kenn-forge\\.go)$", pass_filenames = false, priority = 23 },
{ id = "migration-history-check", name = "enforce immutable history and one migration per PR", language = "system", entry = "./scripts/run-hook-go.sh make migration-history-check", files = "^internal/db/migrations/.*$", pass_filenames = false, priority = 24 },
{ id = "timing-budget-check", name = "reject unreviewed sub-second test polling budgets", language = "system", entry = "./scripts/run-hook-go.sh make timing-budget-check", files = "^(tools/timingbudgetcheck/.*\\.go|.*_test\\.go)$", pass_filenames = false, priority = 25 },
{ id = "nilaway", name = "nilaway", language = "system", entry = "./scripts/run-hook-go.sh make nilaway", stages = [
"pre-push",
], types_or = [
"go",
"go-mod",
"go-sum",
], pass_filenames = false, priority = 20 },
]
[[repos]]
repo = "meta"
hooks = [
{ id = "check-hooks-apply", priority = 0 },
{ id = "check-useless-excludes", priority = 0 },
]