dev-manager-tauri/src-tauri/resources/onboarding/lefthook.yml.tmpl
lanrtop ead35ad12a feat(toolchain): 增加项目级运行时能力包
以 .nvmrc 与 packageManager 作为 Node/pnpm 版本事实,新增 Windows-only 的状态诊断、受控 mise 准备、MCP/Tauri/UI 双投影及 onboarding 自检。

Feature-Confirmed: true

Rules-Applied: R01,R04,R06,R07,R08,R10,R12
2026-09-22 01:08:31 +09:00

31 lines
1.5 KiB
Cheetah
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 命令与 glob(monorepo 用 --filter <pkg> typecheck)
typecheck:
glob: "*.{ts,tsx}"
run: pnpm typecheck
# 🚨 【必填项】项目有 API / 后端层时,必须取消注释并按实际路径配置——
# 否则后端类型错误不会被 pre-commit 拦截(前端 typecheck 只覆盖 src/ 层)。
# 按实际填写一行,其余示例行可删掉:
# api-typecheck:
# glob: "api/**/*.{ts,tsx}"
# run: pnpm --filter api typecheck # monorepo workspace
# # run: pnpm exec tsc -p api/tsconfig.json --noEmit # 独立 tsconfig
# # run: pnpm -r typecheck # 递归所有包
blueprint-gate:
run: node .claude/hooks/blueprint-gate.cjs || true
commit-msg:
commands:
conventional:
run: "head -1 \"{1}\" | grep -qE '^(feat|fix|docs|chore|refactor|ci|perf|style|test|build|revert)(\\(.+\\))?!?: .+' || exit 1"
feature-confirmed:
run: |
head -1 "{1}" | grep -qE '^feat' || exit 0
grep -q 'Feature-Confirmed: true' "{1}" || { printf '\n⚠️ feat: 提交须含 Feature-Confirmed: true trailer\n 在 commit message 末尾加一行:Feature-Confirmed: true\n (确认卡已与用户对齐,方可提交)\n\n' >&2; exit 1; }