git-ai-review 2.4.0 → 2.4.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/dist/precommit.js +9 -1
- package/dist/review.js +3 -1
- package/package.json +1 -1
package/dist/precommit.js
CHANGED
|
@@ -44,7 +44,15 @@ export async function runPreCommit(cwd = process.cwd(), options = {}, deps = {})
|
|
|
44
44
|
}
|
|
45
45
|
const review = await runReviewFn(cwd, { verbose, reviewer: options.reviewer, allReviewers: options.allReviewers });
|
|
46
46
|
if (review.pass) {
|
|
47
|
-
|
|
47
|
+
try {
|
|
48
|
+
rmSync(failCountPath, { force: true });
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
try {
|
|
52
|
+
writeFileSync(failCountPath, '0', 'utf8');
|
|
53
|
+
}
|
|
54
|
+
catch { }
|
|
55
|
+
}
|
|
48
56
|
return 0;
|
|
49
57
|
}
|
|
50
58
|
const failCount = readCount(failCountPath) + 1;
|
package/dist/review.js
CHANGED
|
@@ -292,9 +292,11 @@ async function runClaude(prompt, verbose, skipPreflight = false) {
|
|
|
292
292
|
if (verbose) {
|
|
293
293
|
console.log(claude, claudeArgs.join(' '), '< <prompt via stdin>');
|
|
294
294
|
}
|
|
295
|
+
const CLAUDE_ENV_ALLOWLIST = new Set(['CLAUDE_BIN', 'CLAUDE_CONFIG_DIR', 'CLAUDE_CODE_OAUTH_TOKEN']);
|
|
295
296
|
const cleanEnv = {};
|
|
296
297
|
for (const [key, val] of Object.entries(process.env)) {
|
|
297
|
-
|
|
298
|
+
const upperKey = key.toUpperCase();
|
|
299
|
+
if (val !== undefined && !(upperKey.startsWith('CLAUDE') && !CLAUDE_ENV_ALLOWLIST.has(upperKey))) {
|
|
298
300
|
cleanEnv[key] = val;
|
|
299
301
|
}
|
|
300
302
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-ai-review",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Review your git diff with local Codex CLI, Copilot CLI, or Claude CLI — run manually in one command or automatically as a git hook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|