docs(GOV-001): 建立工程治理与追溯规范

This commit is contained in:
2026-08-12 18:18:55 +08:00
parent 7cc2ba06a6
commit efdfb331bb
46 changed files with 1030 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# 提交标题必须遵循中文 Conventional Commit。类型与功能编号用于机器检索,
# 冒号后的中文摘要用于人类阅读。合并提交和回退提交由 Git 自动生成,予以放行。
message_file="$1"
subject="$(sed -n '1p' "$message_file")"
case "$subject" in
Merge\ *|Revert\ *)
exit 0
;;
esac
if ! printf '%s' "$subject" | grep -Eq '^(feat|fix|docs|refactor|test|chore|build|ci|perf|style)(\([A-Z0-9-]+\))?!?: .+'; then
printf '%s\n' '提交标题格式错误。示例:feat(FEAT-MO-001): 新增市场概览结论区' >&2
exit 1
fi
if ! printf '%s' "$subject" | grep -Eq '[一-龥]'; then
printf '%s\n' '提交摘要必须使用中文。' >&2
exit 1
fi