dev-manager-tauri/src-tauri/resources/onboarding/lefthook.yml.tmpl
lanrtop 892e5977ed fix(onboarding): lefthook.yml.tmpl 用 COMMIT_EDITMSG 替换 {1}
lefthook v2 在 Windows 上解析 YAML 时会将 {1} 与模板变量混淆,
改为直接读取 .git/COMMIT_EDITMSG,与 react-phone-apps 修复保持一致。
2026-07-04 16:50:55 +09:00

17 lines
569 B
Cheetah
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 接入包标准 lefthook 配置(炼境分发)
# 作用:强制 Conventional Commits + 提交前类型检查
# 安装pnpm add -D lefthook && pnpm exec lefthook install
pre-commit:
parallel: true
commands:
# TODO: 按项目调整 typecheck 命令与 globmonorepo 用 --filter <pkg> typecheck
typecheck:
glob: "*.{ts,tsx}"
run: pnpm typecheck
commit-msg:
commands:
conventional:
run: "head -1 .git/COMMIT_EDITMSG | grep -qE '^(feat|fix|docs|chore|refactor|ci|perf|style|test|build|revert)(\\(.+\\))?!?: .+' || exit 1"