Repository navigation
Expand file tree
/
Copy pathprek.toml
More file actions
108 lines (94 loc) · 3 KB
/
Copy pathprek.toml
File metadata and controls
108 lines (94 loc) · 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
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
# Configuration file for prek, a fast Rust-based Git hook manager.
# See https://prek.j178.dev for more information.
#:schema https://www.schemastore.org/prek.json
default_install_hook_types = ["pre-commit", "pre-push"]
# scripts/ holds one-off maintenance scripts that aren't held to the library's lint rules.
exclude = "^scripts"
[[repos]]
repo = "builtin"
hooks = [
{ id = "trailing-whitespace" },
{ id = "end-of-file-fixer" },
{ id = "mixed-line-ending" },
{ id = "check-case-conflict" },
{ id = "check-shebang-scripts-are-executable" },
{ id = "check-merge-conflict" },
{ id = "check-yaml", args = ["--unsafe"] },
]
# Hooks not yet reimplemented as builtins
[[repos]]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v6.0.0"
hooks = [
{ id = "check-builtin-literals" },
{ id = "debug-statements" },
]
[[repos]]
repo = "https://github.com/crate-ci/typos"
rev = "v1.52.2"
hooks = [
{ id = "typos", args = ["--force-exclude"], require_serial = true },
]
[[repos]]
repo = "https://github.com/gitleaks/gitleaks"
rev = "v8.30.1"
hooks = [
# The upstream hook scans only the index, so at pre-push or in CI's clean checkout it would
# pass having scanned nothing. The whole-tree alias covers those stages.
{ id = "gitleaks", stages = ["pre-commit"] },
{ id = "gitleaks", alias = "gitleaks-tree", name = "Detect hardcoded secrets (tracked tree)", entry = "./tools/scan_tracked_secrets.sh", pass_filenames = false, always_run = true, stages = ["pre-push"] },
]
# Python tools locked in uv.lock run through `uv run`, so the hook and a hand-run
# `uv run <tool>` always use the same version.
[[repos]]
repo = "local"
# --force-exclude applies ruff.toml's excludes to the filenames prek passes explicitly.
[[repos.hooks]]
id = "ruff-check"
name = "ruff check"
language = "system"
entry = "uv run ruff check --fix --force-exclude --show-fixes"
require_serial = true
types_or = ["python", "pyi"]
[[repos.hooks]]
id = "ruff-format"
name = "ruff format"
language = "system"
entry = "uv run ruff format --force-exclude"
require_serial = true
types_or = ["python", "pyi"]
[[repos.hooks]]
id = "house-lint"
name = "house-lint"
language = "system"
entry = "uv run house-lint check"
require_serial = true
types = ["python"]
files = '^(src|tests|tools|examples)/.*\.py$'
[[repos.hooks]]
id = "pyright"
name = "pyright"
language = "system"
entry = "uv run pyright"
pass_filenames = false
require_serial = true
types_or = ["python", "pyi"]
stages = ["pre-push"]
[[repos.hooks]]
id = "no-mypy-ignore"
name = 'Ban "type: ignore" comments (use pyright)'
language = "pygrep"
types = ["python"]
entry = "# type: ignore"
[[repos.hooks]]
id = "zizmor"
name = "zizmor (GitHub Actions security)"
language = "system"
entry = "env -u GH_TOKEN -u GITHUB_TOKEN uvx zizmor@1.26.1 --offline"
files = '^\.github/workflows/'
[[repos.hooks]]
id = "no-future-annotations"
name = "Ban from __future__ import annotations (breaks Pydantic)"
language = "pygrep"
types = ["python"]
entry = "^from __future__ import annotations"