a6f05ab2d5
- Phase 0: AGENTS.md cleanup (dedup quotes, renumber sections, merge qmd) - Phase 1: typed relations (manage-relations.py, graph-search.py, check-staleness.py, detect-conflicts.py) - Phase 2: frontmatter validator, weekly lint, knowledge promotion, git hooks - Fix .gitignore to track tools/ and .githooks/ - Fix git remote URL (remove plaintext token) - New wiki pages: 504 pages, 34 raw sources
12 lines
436 B
Bash
12 lines
436 B
Bash
#!/bin/sh
|
|
# pre-commit — 验证被修改的 wiki 页面 frontmatter
|
|
CHANGED=$(git diff --cached --name-only --diff-filter=ACM | grep '^wiki/.*\.md$')
|
|
if [ -z "$CHANGED" ]; then exit 0; fi
|
|
|
|
python tools/scripts/validate-frontmatter.py --git-hook
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR: Frontmatter validation failed. Commit rejected."
|
|
echo "Run 'python tools/scripts/validate-frontmatter.py --files <file>' to check."
|
|
exit 1
|
|
fi
|