-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
51 lines (47 loc) · 1.82 KB
/
.pre-commit-config.yaml
File metadata and controls
51 lines (47 loc) · 1.82 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
# Pre-commit Configuration for Spec Validation
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: pre-commit run --all-files
repos:
- repo: local
hooks:
# Convert test logs to JUnit XML and stage evidence when source files change.
# Exits 1 if evidence files were updated (auto-fixer pattern) -- re-commit to include them.
# Trigger: any staged src/*.c or src/*.h file (code change → fresh evidence expected).
- id: convert-logs-to-junit
name: Convert test logs to JUnit XML (test evidence)
entry: pwsh -NoProfile -ExecutionPolicy Bypass -File tools/test/pre-commit-update-evidence.ps1
language: system
pass_filenames: false
files: ^src/.*\.(c|h)$
verbose: true
# Validate specification files
- id: validate-specs
name: Validate Specification Files
entry: python scripts/pre-commit-hook.py
language: python
files: \.(md)$
exclude: (README|template|TEMPLATE|MIGRATION-SUMMARY)
additional_dependencies: ['pyyaml', 'jsonschema']
# Ensure spec numbering is sequential (future enhancement)
- id: check-spec-numbering
name: Check Spec ID Numbering
entry: python scripts/check-spec-numbering.py
language: python
files: \.(md)$
exclude: (README|template|TEMPLATE)
pass_filenames: false
additional_dependencies: ['pyyaml']
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: \.md$
- id: end-of-file-fixer
- id: check-yaml
args: ['--unsafe'] # Allow custom YAML tags
- id: check-added-large-files
args: ['--maxkb=1000']
- id: mixed-line-ending
args: ['--fix=lf']