@@ -69,33 +69,6 @@ func (f *PRFormatter) formatHeader(issueTitle string, issueNumber int) string {
69
69
> **Closes #%d** | Auto-generated by CodeAgent 🤖` , issueTitle , issueNumber )
70
70
}
71
71
72
- // formatIssueContext 格式化Issue上下文
73
- func (f * PRFormatter ) formatIssueContext (title , body string ) string {
74
- var builder strings.Builder
75
-
76
- builder .WriteString ("## 📋 Original Issue\n \n " )
77
- builder .WriteString (fmt .Sprintf ("**Title**: %s\n \n " , title ))
78
-
79
- if body != "" {
80
- // 清理和格式化body
81
- cleanBody := f .cleanIssueBody (body )
82
- if len (cleanBody ) > f .maxDescriptionLength {
83
- cleanBody = cleanBody [:f .maxDescriptionLength ] + "..."
84
- }
85
- builder .WriteString ("**Description**:\n " )
86
- builder .WriteString (cleanBody )
87
- }
88
-
89
- return builder .String ()
90
- }
91
-
92
- // formatSummary 格式化摘要(原始版本)
93
- func (f * PRFormatter ) formatSummary (summary string ) string {
94
- return fmt .Sprintf (`## 🎯 Implementation Summary
95
-
96
- %s` , f .formatMarkdownSection (summary ))
97
- }
98
-
99
72
// formatConciseSummary 格式化简洁摘要
100
73
func (f * PRFormatter ) formatConciseSummary (summary string ) string {
101
74
// 提取核心描述,避免主观语言
@@ -172,13 +145,6 @@ func (f *PRFormatter) formatConciseSummary(summary string) string {
172
145
%s` , concise )
173
146
}
174
147
175
- // formatChanges 格式化变更详情
176
- func (f * PRFormatter ) formatChanges (changes string ) string {
177
- return fmt .Sprintf (`## 📝 Changes Made
178
-
179
- %s` , f .formatMarkdownSection (changes ))
180
- }
181
-
182
148
// formatConciseChanges 格式化简洁变更
183
149
func (f * PRFormatter ) formatConciseChanges (changes string ) string {
184
150
// 提取前3个关键变更点
@@ -212,13 +178,6 @@ func (f *PRFormatter) formatConciseChanges(changes string) string {
212
178
return result
213
179
}
214
180
215
- // formatTestPlan 格式化测试计划
216
- func (f * PRFormatter ) formatTestPlan (testPlan string ) string {
217
- return fmt .Sprintf (`## 🧪 Testing
218
-
219
- %s` , f .formatMarkdownSection (testPlan ))
220
- }
221
-
222
181
// formatTechnicalDetails 格式化技术细节
223
182
func (f * PRFormatter ) formatTechnicalDetails (aiOutput string ) string {
224
183
// 提取关键信息
@@ -290,7 +249,6 @@ func (f *PRFormatter) cleanIssueBody(body string) string {
290
249
// 移除命令行
291
250
body = strings .ReplaceAll (body , "/code" , "" )
292
251
body = strings .ReplaceAll (body , "/continue" , "" )
293
- body = strings .ReplaceAll (body , "/fix" , "" )
294
252
295
253
// 清理多余的空格和空行
296
254
body = strings .TrimSpace (body )
@@ -305,43 +263,6 @@ func (f *PRFormatter) cleanIssueBody(body string) string {
305
263
return body
306
264
}
307
265
308
- // extractFromAIOutput 从AI输出中提取summary和changes
309
- func (f * PRFormatter ) extractFromAIOutput (aiOutput string ) (summary , changes string ) {
310
- lines := strings .Split (aiOutput , "\n " )
311
-
312
- var summaryLines , changesLines []string
313
- currentSection := ""
314
-
315
- for _ , line := range lines {
316
- trimmed := strings .TrimSpace (line )
317
-
318
- // 检测章节标题
319
- if strings .Contains (trimmed , "## 总结" ) || strings .Contains (trimmed , "## Summary" ) {
320
- currentSection = "summary"
321
- continue
322
- } else if strings .Contains (trimmed , "## 改动" ) || strings .Contains (trimmed , "## Changes" ) ||
323
- strings .Contains (trimmed , "## 修改" ) || strings .Contains (trimmed , "## 变更" ) {
324
- currentSection = "changes"
325
- continue
326
- } else if strings .Contains (trimmed , "### " ) && currentSection != "" {
327
- // 子章节,继续当前部分
328
- } else if strings .HasPrefix (trimmed , "## " ) && currentSection != "" {
329
- // 新的主章节,结束当前部分
330
- currentSection = ""
331
- continue
332
- }
333
-
334
- // 收集内容
335
- if currentSection == "summary" && trimmed != "" && ! strings .HasPrefix (trimmed , "##" ) {
336
- summaryLines = append (summaryLines , trimmed )
337
- } else if currentSection == "changes" && trimmed != "" && ! strings .HasPrefix (trimmed , "##" ) {
338
- changesLines = append (changesLines , trimmed )
339
- }
340
- }
341
-
342
- return strings .Join (summaryLines , "\n " ), strings .Join (changesLines , "\n " )
343
- }
344
-
345
266
// extractKeyPoints 从AI输出中提取关键点
346
267
func (f * PRFormatter ) extractKeyPoints (aiOutput string ) []string {
347
268
var points []string
0 commit comments