feat: 拆分评审与提交消息提示词并增加 hook 备份与 JSON 输出

- 新增 custom_reviewer_prompt 和 custom_commit_msg_prompt,兼容旧 custom_prompt
- pre-commit hook 安装时备份已有 hook,卸载时恢复
- 支持 --format json 输出评审结果
- diff 发送前自动脱敏敏感信息
This commit is contained in:
unclesam committed 2026-08-23 22:31:30 +08:00
1 parent 39c58316a5
commit b04d70b99a
18 files changed
+637 -45

No files matched your search

+10
View File
@@ -56,3 +56,13 @@ func TestBuildCommitMsgPrompt(t *testing.T) {
}
}
}
func TestBuildCommitMsgPromptWithCustom(t *testing.T) {
prompt := BuildCommitMsgPromptWithCustom("en", "Use a short imperative subject and mention breaking changes explicitly.")
if !strings.Contains(prompt, "Use a short imperative subject") {
t.Fatal("自定义 Commit Message Prompt 未被合并")
}
if !strings.Contains(prompt, "Conventional Commits") {
t.Fatal("内置 Conventional Commits 约束不应丢失")
}
}