job51-gitlab-cr-node-jt-1 1.1.2 → 1.1.3

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.
Files changed (2) hide show
  1. package/index.js +1 -15
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -116,15 +116,9 @@ class GitLabCodeReviewer {
116
116
 
117
117
  // 创建处理单个块的函数
118
118
  const processBlock = async (diffObject, blockIndex) => {
119
- // 创建临时文件存储diff内容
120
- const tmpFileName = `./temp-diff-block-${Date.now()}-${blockIndex}.diff`;
121
-
122
119
  try {
123
- // 将diff内容写入临时文件
124
- fs.writeFileSync(tmpFileName, diffObject.diff);
125
-
126
120
  // 审核当前块(传入临时文件路径而不是直接的diff内容)
127
- const review_result = await this.reviewDiffWithClaudeUsingFile(tmpFileName);
121
+ const review_result = await this.reviewDiffWithClaude(diffObject.diff);
128
122
  const blockObj = { ...diffObject, review_result, temp_file_path: tmpFileName };
129
123
 
130
124
  // 立即发布评论
@@ -155,14 +149,6 @@ class GitLabCodeReviewer {
155
149
  };
156
150
  } catch (error) {
157
151
  throw error;
158
- } finally {
159
- try {
160
- if (fs.existsSync(tmpFileName)) {
161
- fs.unlinkSync(tmpFileName);
162
- }
163
- } catch (cleanupError) {
164
- console.error('清理临时文件失败:', cleanupError.message);
165
- }
166
152
  }
167
153
  };
168
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job51-gitlab-cr-node-jt-1",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "GitLab merge request code review tool with AI-powered analysis",
5
5
  "main": "index.js",
6
6
  "bin": {