-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
77 lines (69 loc) · 2.09 KB
/
.pre-commit-config.yaml
File metadata and controls
77 lines (69 loc) · 2.09 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
# SPDX-FileCopyrightText: 2026 PythonWoods <dev@pythonwoods.dev>
# SPDX-License-Identifier: Apache-2.0
repos:
# 1. Generic file hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- id: check-json
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
- id: no-commit-to-branch
args: ["--branch", "main"]
# 2. Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
args: ["--fix"]
# 3. Ruff (linting & formatting)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
exclude: ^examples/
- id: ruff-format
exclude: ^examples/
# 4. Purge __pycache__ before REUSE — bytecode in untracked dirs fails the check
- repo: local
hooks:
- id: clean-pycache
name: Clean __pycache__ before REUSE lint
entry: bash -c "find . -path './.git' -prune -o -name '__pycache__' -type d -print -exec rm -rf {} + 2>/dev/null || true"
language: system
pass_filenames: false
always_run: true
# 5. REUSE/SPDX license compliance
- repo: https://github.com/fsfe/reuse-tool
rev: v5.0.2
hooks:
- id: reuse
# 6. Local: type checking, tests, zenzic self-check
- repo: local
hooks:
- id: mypy
name: Type Checking (mypy)
entry: uv run mypy src/
language: system
types: [python]
pass_filenames: false
- id: pytest
name: Run Tests (pytest)
entry: uv run pytest -q -x
language: system
types: [python]
pass_filenames: false
- id: zenzic
name: Zenzic self-check
entry: uv run zenzic check all --strict
language: system
types_or: [python, markdown, yaml]
pass_filenames: false