-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
91 lines (80 loc) · 3.43 KB
/
.pre-commit-config.yaml
File metadata and controls
91 lines (80 loc) · 3.43 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
# Stop after the first failing hook so a broken Block 1 never runs Block 2 (code review + contract tests).
# Layout and stages mirror specfact-cli-modules; CLI adds Markdown + workflow lint + version hook.
fail_fast: true
repos:
- repo: local
hooks:
- id: verify-module-signatures
name: Verify module signatures (branch-aware; skip if no staged module tree changes)
entry: scripts/pre-commit-verify-modules.sh
language: script
pass_filenames: false
always_run: true
- id: check-version-sources
name: Check synchronized version sources (always; PR orchestrator tests job parity)
entry: hatch run check-version-sources
language: system
pass_filenames: false
always_run: true
# Runs only when canonical version files are staged — same scope as pr-orchestrator tests job
# PyPI step (version_sources_changed). Skips routine commits when local == PyPI after a release.
- id: check-local-version-ahead-of-pypi
name: Check local version ahead of PyPI (lenient network; when version files staged)
entry: >-
env SPECFACT_PYPI_VERSION_CHECK_LENIENT_NETWORK=1
hatch run python scripts/check_local_version_ahead_of_pypi.py
--skip-when-version-unchanged-vs HEAD
language: system
pass_filenames: false
files: ^(pyproject\.toml|setup\.py|src/__init__\.py|src/specfact_cli/__init__\.py)$
- id: cli-block1-format
name: "CLI Block 1 — format"
entry: ./scripts/pre-commit-quality-checks.sh block1-format
language: system
files: \.(py|pyi)$
pass_filenames: false
verbose: true
- id: cli-block1-yaml
name: "CLI Block 1 — yaml-lint (when YAML staged)"
entry: ./scripts/pre-commit-quality-checks.sh block1-yaml
language: system
files: \.(yaml|yml)$
verbose: true
- id: cli-block1-markdown-fix
name: "CLI Block 1 — markdown auto-fix (when Markdown staged)"
entry: ./scripts/pre-commit-quality-checks.sh block1-markdown-fix
language: system
files: \.(md|mdc)$
verbose: true
- id: cli-block1-markdown-lint
name: "CLI Block 1 — markdownlint (when Markdown staged)"
entry: ./scripts/pre-commit-quality-checks.sh block1-markdown-lint
language: system
files: \.(md|mdc)$
verbose: true
- id: cli-block1-workflows
name: "CLI Block 1 — workflow lint (when workflows staged)"
entry: ./scripts/pre-commit-quality-checks.sh block1-workflows
language: system
files: ^\.github/workflows/.*\.(yaml|yml)$
verbose: true
- id: cli-block1-lint
name: "CLI Block 1 — lint (when Python staged)"
entry: ./scripts/pre-commit-quality-checks.sh block1-lint
language: system
files: \.(py|pyi)$
verbose: true
- id: cli-block2
name: "CLI Block 2 — code review + contract tests"
entry: ./scripts/pre-commit-quality-checks.sh block2
language: system
pass_filenames: false
always_run: true
verbose: true
- id: check-doc-frontmatter
name: Check documentation ownership frontmatter (enforced paths)
entry: hatch run doc-frontmatter-check
language: system
files: ^(docs/.*\.md|docs/\.doc-frontmatter-enforced|USAGE-FAQ\.md)$
pass_filenames: false
always_run: false