gitlab-ai-review 2.5.1 → 2.5.2
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/cli.js +16 -7
- package/index.js +1 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -34,15 +34,24 @@ async function main() {
|
|
|
34
34
|
|
|
35
35
|
const results = await sdk.reviewAndCommentOnLines();
|
|
36
36
|
|
|
37
|
+
// 统计结果
|
|
38
|
+
const fileNames = new Set(results.map(r => r.fileName));
|
|
39
|
+
const successCount = results.filter(r => r.status === 'success').length;
|
|
40
|
+
const errorCount = results.filter(r => r.status === 'error').length;
|
|
41
|
+
const skippedCount = results.filter(r => r.status === 'skipped').length;
|
|
42
|
+
|
|
37
43
|
console.log('\n📊 审查结果汇总:');
|
|
38
|
-
console.log(` - 审查文件数: ${
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
console.log(` - 审查文件数: ${fileNames.size}`);
|
|
45
|
+
console.log(` - 成功添加评论: ${successCount} 条`);
|
|
46
|
+
if (errorCount > 0) {
|
|
47
|
+
console.log(` - 失败: ${errorCount} 条`);
|
|
48
|
+
}
|
|
49
|
+
if (skippedCount > 0) {
|
|
50
|
+
console.log(` - 跳过: ${skippedCount} 条`);
|
|
51
|
+
}
|
|
43
52
|
|
|
44
|
-
if (
|
|
45
|
-
console.log('\n⚠️
|
|
53
|
+
if (errorCount > 0) {
|
|
54
|
+
console.log('\n⚠️ 部分评论添加失败,请检查上方日志');
|
|
46
55
|
process.exit(1);
|
|
47
56
|
} else {
|
|
48
57
|
console.log('\n✅ 代码审查完成!');
|
package/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import * as DiffParser from './lib/diff-parser.js';
|
|
|
15
15
|
export class GitLabAIReview {
|
|
16
16
|
constructor(options = {}) {
|
|
17
17
|
this.name = 'GitLab AI Review SDK';
|
|
18
|
-
this.version = '2.5.
|
|
18
|
+
this.version = '2.5.2';
|
|
19
19
|
|
|
20
20
|
// 如果传入了配置,使用手动配置;否则使用自动检测
|
|
21
21
|
if (options.token || options.gitlab) {
|