gitlab-ai-review 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/prompt-tools.js +9 -6
- package/package.json +1 -1
package/lib/prompt-tools.js
CHANGED
|
@@ -92,7 +92,7 @@ export function buildFileReviewPrompt(fileName, meaningfulChanges) {
|
|
|
92
92
|
{
|
|
93
93
|
"lineNumber": 15,
|
|
94
94
|
"hasIssue": true,
|
|
95
|
-
"comment": "
|
|
95
|
+
"comment": "必须按照上面'项目特定的审查规则'中定义的格式填写"
|
|
96
96
|
}
|
|
97
97
|
]
|
|
98
98
|
}
|
|
@@ -106,8 +106,10 @@ export function buildFileReviewPrompt(fileName, meaningfulChanges) {
|
|
|
106
106
|
- comment 必须是字符串
|
|
107
107
|
|
|
108
108
|
**comment 字段的内容:**
|
|
109
|
-
-
|
|
110
|
-
-
|
|
109
|
+
- **必须严格遵循"项目特定的审查规则"(reviewguard.md)中定义的格式**
|
|
110
|
+
- 如果规则中定义了包含 emoji、评分等格式,**必须完整使用该格式**
|
|
111
|
+
- comment 是一个字符串,可以包含换行符 \\n 来格式化内容
|
|
112
|
+
- 不要自创格式,必须参考上面"项目特定的审查规则"中的示例
|
|
111
113
|
|
|
112
114
|
6. 如果所有代码都没有问题,返回空的 reviews 数组:\`{"reviews": []}\`
|
|
113
115
|
7. 只返回 JSON,不要包含其他文字说明`;
|
|
@@ -303,12 +305,13 @@ export function buildFileReviewWithImpactPrompt(fileName, meaningfulChanges, imp
|
|
|
303
305
|
- 如果发现其他文件受影响,在当前变更行的 comment 字符串中说明
|
|
304
306
|
|
|
305
307
|
**comment 字段的内容:**
|
|
306
|
-
-
|
|
308
|
+
- **必须严格遵循"项目特定的审查规则"(reviewguard.md)中定义的格式**
|
|
309
|
+
- 如果规则中定义了包含【严重程度评分】、emoji、分点说明等格式,**必须完整使用该格式**
|
|
307
310
|
- comment 是一个字符串,可以包含换行符 \\n 来格式化内容
|
|
308
|
-
-
|
|
311
|
+
- 不要自创格式,必须参考上面"项目特定的审查规则"中的示例
|
|
309
312
|
|
|
310
313
|
**示例:**
|
|
311
|
-
|
|
314
|
+
如果 reviewguard.md 中定义了格式,删除第 15 行的函数时,comment 内容必须是:
|
|
312
315
|
"【严重程度评分:8/10】\\n\\n📋 问题描述:\\n删除了函数 fetchData 但该函数仍被多处使用\\n\\n🔍 影响分析:\\n• 当前文件:函数定义被完全移除\\n• 受影响的其他文件:components/UserList.vue (第 45 行)\\n\\n💡 改进建议:\\n1. 恢复此函数或提供替代方案\\n2. 先标记为 @deprecated"
|
|
313
316
|
|
|
314
317
|
7. 如果所有代码都没有问题,返回空的 reviews 数组:\`{"reviews": []}\`
|