Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
139 lines (124 loc) · 4.85 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
139 lines (124 loc) · 4.85 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# This file is part of the jebel-quant/rhiza repository
# (https://github.com/jebel-quant/rhiza).
#
# Pin node so pre-commit provisions a compatible runtime instead of using the
# system node. Some npm-based hooks (markdownlint-cli) pull transitive deps that
# reject odd-numbered current node releases (e.g. v25), failing on EBADENGINE.
default_language_version:
node: "24.12.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
groups: ["fast"]
- id: check-yaml
args: ['--unsafe']
exclude: ^recipe/meta\.yaml$
groups: ["fast"]
- repo: local
hooks:
- id: no-python-cache-files
name: Prevent committing Python cache files
language: fail
entry: Python cache files (__pycache__, .pyc, .pyo, .pyd) must not be committed. Run 'make clean' to remove them.
files: '(/__pycache__/|\.py[cod]$)'
groups: ["python", "fast"]
- id: no-rej-files
name: Reject .rej files
entry: "bash -c 'find . -type f -name \"*.rej\" | grep -q . && { echo \"ERROR: .rej files detected\"; find . -type f -name \"*.rej\"; exit 1; } || exit 0'"
language: system
pass_filenames: false
groups: ["fast"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.16.6'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, --unsafe-fixes ]
groups: ["python", "lint", "fast"]
# Run the formatter
- id: ruff-format
groups: ["python", "format", "fast"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.49.1
hooks:
- id: markdownlint
args: ["--disable", "MD013"]
groups: ["lint", "fast"]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.38.0
hooks:
- id: check-renovate
args: [ "--verbose" ]
groups: ["fast"]
- id: check-github-workflows
args: ["--verbose"]
groups: ["fast"]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
groups: ["lint", "fast"]
- repo: https://github.com/abravalheri/validate-pyproject
rev: "0.26"
hooks:
- id: validate-pyproject
groups: ["python", "fast"]
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
# Scope deliberately lives in .bandit, not here — see that file (#1493).
args: ["--ini", ".bandit"]
groups: ["python", "security", "slow"]
- repo: https://github.com/betterleaks/betterleaks
rev: v1.8.1
hooks:
- id: betterleaks
groups: ["security", "slow"]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.12.10
hooks:
- id: uv-lock
groups: ["python", "fast"]
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args: [--config=pyproject.toml]
files: ^src/
groups: ["python", "lint", "slow"]
- repo: https://github.com/Jebel-Quant/rhiza-hooks
rev: v1.3.0 # Use the latest release
hooks:
# Migrated from rhiza
- id: check-rhiza-workflow-names
groups: ["fast"]
- id: update-readme-help
groups: ["fast"]
# Additional utility hooks
- id: check-rhiza-config
groups: ["fast"]
# check-managed-files refuses a commit touching any path in .rhiza/template.lock's
# `files:` list (minus `exclude:` in template.yml), enforcing the rule every managed
# repo's CLAUDE.md opens with. Only paths differing from HEAD are reported, so
# `make fmt` and CI stay green on a clean tree under --all-files. Its adoption was
# gated on the sync commit gaining `SKIP=check-managed-files` -- see CLAUDE.md's
# "Enforcing template ownership" for why that order is not optional.
- id: check-managed-files
groups: ["fast"]
- id: check-makefile-targets
groups: ["fast"]
- id: check-python-version-consistency
groups: ["python", "fast"]
# check-bumpversion-config asserts that bump-my-version can actually discover the
# project's version config (issue #1453) — for this layer, the [tool.bumpversion]
# table in pyproject.toml, since python-core deliberately ships no .bumpversion.toml.
# It ships as of v1.1.0; it stays off because pytest-rhiza's test_pyproject check —
# which this layer names in RHIZA_CHECKS — enforces the same invariant one gate later.
# - id: check-bumpversion-config
# check-template-bundles validates .rhiza/template.yml against the template repo's
# remote bundle list, so it fires only when that file is staged — and unlike in the
# mother repo (which has no template.yml) it is live in a synced project. Disabled in
# #660 (rhiza-hooks 0.3.0) with no reason recorded.
# - id: check-template-bundles