@codacy/gate-cli 0.10.1 → 0.12.0
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/README.md +1 -1
- package/bin/gate.js +49 -24
- package/data/skills/gate-analyze/SKILL.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/gate.js
CHANGED
|
@@ -11848,28 +11848,35 @@ function findMdFiles(dir, maxDepth, depth = 0) {
|
|
|
11848
11848
|
return result;
|
|
11849
11849
|
}
|
|
11850
11850
|
function discoverPlans() {
|
|
11851
|
-
const
|
|
11852
|
-
|
|
11853
|
-
const
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
const content = (0, import_node_fs7.readFileSync)(entry.path, "utf-8");
|
|
11868
|
-
result.push({ name: entry.name, content });
|
|
11869
|
-
} catch {
|
|
11851
|
+
const homePlansDir = (0, import_node_path6.join)(process.env.HOME ?? "", ".claude", "plans");
|
|
11852
|
+
const localPlansDir = ".claude/plans";
|
|
11853
|
+
const candidates = [];
|
|
11854
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11855
|
+
for (const plansDir of [localPlansDir, homePlansDir]) {
|
|
11856
|
+
if (!(0, import_node_fs7.existsSync)(plansDir)) continue;
|
|
11857
|
+
try {
|
|
11858
|
+
for (const f of (0, import_node_fs7.readdirSync)(plansDir)) {
|
|
11859
|
+
if (!f.endsWith(".md") || seen.has(f)) continue;
|
|
11860
|
+
seen.add(f);
|
|
11861
|
+
const fullPath = (0, import_node_path6.join)(plansDir, f);
|
|
11862
|
+
try {
|
|
11863
|
+
const stat = (0, import_node_fs7.statSync)(fullPath);
|
|
11864
|
+
candidates.push({ name: f, path: fullPath, mtime: stat.mtimeMs, size: stat.size });
|
|
11865
|
+
} catch {
|
|
11866
|
+
}
|
|
11870
11867
|
}
|
|
11868
|
+
} catch {
|
|
11869
|
+
}
|
|
11870
|
+
}
|
|
11871
|
+
candidates.sort((a, b) => b.mtime - a.mtime);
|
|
11872
|
+
const result = [];
|
|
11873
|
+
for (const entry of candidates.slice(0, MAX_PLAN_FILES)) {
|
|
11874
|
+
if (entry.size > MAX_PLAN_FILE_BYTES) continue;
|
|
11875
|
+
try {
|
|
11876
|
+
const content = (0, import_node_fs7.readFileSync)(entry.path, "utf-8");
|
|
11877
|
+
result.push({ name: entry.name, content });
|
|
11878
|
+
} catch {
|
|
11871
11879
|
}
|
|
11872
|
-
} catch {
|
|
11873
11880
|
}
|
|
11874
11881
|
return result;
|
|
11875
11882
|
}
|
|
@@ -12306,11 +12313,13 @@ async function runAnalyze(opts, globals) {
|
|
|
12306
12313
|
|
|
12307
12314
|
`);
|
|
12308
12315
|
}
|
|
12309
|
-
|
|
12310
|
-
|
|
12316
|
+
const agentFindings = findings.filter((f) => f.scope !== "pre-existing");
|
|
12317
|
+
const preExistingFindings = findings.filter((f) => f.scope === "pre-existing");
|
|
12318
|
+
if (agentFindings.length > 0) {
|
|
12319
|
+
process.stderr.write(`${BOLD}Found ${agentFindings.length} issues in your changes. Fix the critical and high severity ones:${NC}
|
|
12311
12320
|
|
|
12312
12321
|
`);
|
|
12313
|
-
for (const f of
|
|
12322
|
+
for (const f of agentFindings) {
|
|
12314
12323
|
const severity = (f.severity ?? "").toUpperCase();
|
|
12315
12324
|
const title = f.title ?? "";
|
|
12316
12325
|
const file = f.file ?? "";
|
|
@@ -12331,6 +12340,22 @@ async function runAnalyze(opts, globals) {
|
|
|
12331
12340
|
process.stderr.write("\n");
|
|
12332
12341
|
}
|
|
12333
12342
|
}
|
|
12343
|
+
if (preExistingFindings.length > 0) {
|
|
12344
|
+
process.stderr.write(`${DIM}\u2501\u2501\u2501 Pre-existing issues (not caused by your changes, informational only) \u2501\u2501\u2501${NC}
|
|
12345
|
+
|
|
12346
|
+
`);
|
|
12347
|
+
for (const f of preExistingFindings) {
|
|
12348
|
+
const severity = (f.severity ?? "").toUpperCase();
|
|
12349
|
+
const title = f.title ?? "";
|
|
12350
|
+
const file = f.file ?? "";
|
|
12351
|
+
const line = f.line ?? "";
|
|
12352
|
+
process.stderr.write(`${DIM}[${severity}] ${title}
|
|
12353
|
+
`);
|
|
12354
|
+
process.stderr.write(` File: ${file}:${line}${NC}
|
|
12355
|
+
|
|
12356
|
+
`);
|
|
12357
|
+
}
|
|
12358
|
+
}
|
|
12334
12359
|
if (viewUrl) {
|
|
12335
12360
|
process.stderr.write(`${CYAN}View full report: ${viewUrl}${NC}
|
|
12336
12361
|
|
|
@@ -12616,7 +12641,7 @@ function registerInitCommand(program2) {
|
|
|
12616
12641
|
}
|
|
12617
12642
|
|
|
12618
12643
|
// src/cli.ts
|
|
12619
|
-
program.name("gate").description("CLI for GATE.md quality gate service").version("0.
|
|
12644
|
+
program.name("gate").description("CLI for GATE.md quality gate service").version("0.12.0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
|
|
12620
12645
|
registerAuthCommands(program);
|
|
12621
12646
|
registerHooksCommands(program);
|
|
12622
12647
|
registerIntentCommands(program);
|
|
@@ -193,7 +193,7 @@ Test Adequacy: 5.0/10 — missing webhook handler tests
|
|
|
193
193
|
1. [HIGH] Add tests for webhook event handlers
|
|
194
194
|
2. [MEDIUM] Refactor webhook into handler modules
|
|
195
195
|
|
|
196
|
-
View full report: https://
|
|
196
|
+
View full report: https://gate.codacy.com/runs/run-20260327-...?token=gateview_...
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
---
|