Repository navigation
Expand file tree
/
Copy pathpre-commit.sh
More file actions
executable file
·86 lines (73 loc) · 2.18 KB
/
Copy pathpre-commit.sh
File metadata and controls
executable file
·86 lines (73 loc) · 2.18 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
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2026 Pieter Van Garderen
#
# SPDX-License-Identifier: MIT
#
# Master pre-commit hook: run every verify_*.sh gate in order and stop at the first failure.
echo "========================================"
echo "Running Pre-Commit Hooks..."
echo "========================================"
# 0. Validate Branch-per-Task Workflow
./scripts/verify_branch.sh
if [ $? -ne 0 ]; then
exit 1
fi
# 1. Validate isolated ports
./scripts/verify_isolated_ports.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Port Validation"
exit 1
fi
# 2. Validate document sync
./scripts/verify_doc_sync.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Document Sync Validation"
exit 1
fi
# 3. Validate Bi-directional PRD/SRS Traceability
./scripts/verify_srs_traceability.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Traceability Validation"
exit 1
fi
# 4. Validate relative links
./scripts/verify_relative_links.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Portable Documentation Validation"
exit 1
fi
# 5. Validate workspace boundaries
./scripts/verify_workspace_boundaries.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Workspace Boundary Validation"
exit 1
fi
# 6. Validate centralized logging
./scripts/verify_centralized_logging.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Centralized Logging Validation"
exit 1
fi
# 7. Validate formatting for detected stacks
./scripts/verify_formatting.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Formatting Validation"
exit 1
fi
# 8. Validate documentation (ADR structure, PRD allocation, links, task cleanup)
./scripts/verify_docs.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Documentation Validation"
exit 1
fi
# 9. Lint and tests for detected stacks (see scripts/verify_tests.sh for the per-stack steps).
# No hosted CI: this is the gate before a push. VERIFY_SKIP_TESTS=1 skips it for WIP commits.
./scripts/verify_tests.sh
if [ $? -ne 0 ]; then
echo "❌ pre-commit failed: Lint and Test Validation"
exit 1
fi
echo "========================================"
echo "✅ All Pre-Commit Hooks Passed!"
echo "========================================"
exit 0