@kevinrabun/judges 3.23.6 → 3.23.8
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/CHANGELOG.md +40 -0
- package/README.md +1 -1
- package/dist/api.d.ts +6 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +6 -1
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +123 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +556 -0
- package/dist/commands/benchmark.js.map +1 -1
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +17 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/fix.d.ts +27 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +137 -13
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/lsp.d.ts +24 -0
- package/dist/commands/lsp.d.ts.map +1 -0
- package/dist/commands/lsp.js +287 -0
- package/dist/commands/lsp.js.map +1 -0
- package/dist/commands/review.d.ts +37 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +539 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/scaffold-plugin.d.ts +16 -0
- package/dist/commands/scaffold-plugin.d.ts.map +1 -0
- package/dist/commands/scaffold-plugin.js +271 -0
- package/dist/commands/scaffold-plugin.js.map +1 -0
- package/dist/commands/tune.d.ts +25 -0
- package/dist/commands/tune.d.ts.map +1 -0
- package/dist/commands/tune.js +408 -0
- package/dist/commands/tune.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -1
- package/dist/disk-cache.d.ts +40 -0
- package/dist/disk-cache.d.ts.map +1 -0
- package/dist/disk-cache.js +196 -0
- package/dist/disk-cache.js.map +1 -0
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/index.js +50 -3
- package/dist/evaluators/index.js.map +1 -1
- package/dist/evaluators/v2.d.ts.map +1 -1
- package/dist/evaluators/v2.js +2 -2
- package/dist/evaluators/v2.js.map +1 -1
- package/dist/finding-lifecycle.d.ts +93 -0
- package/dist/finding-lifecycle.d.ts.map +1 -0
- package/dist/finding-lifecycle.js +214 -0
- package/dist/finding-lifecycle.js.map +1 -0
- package/dist/formatters/github-actions.d.ts +7 -0
- package/dist/formatters/github-actions.d.ts.map +1 -0
- package/dist/formatters/github-actions.js +69 -0
- package/dist/formatters/github-actions.js.map +1 -0
- package/dist/patches/index.d.ts.map +1 -1
- package/dist/patches/index.js +127 -0
- package/dist/patches/index.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +103 -0
- package/dist/presets.js.map +1 -1
- package/dist/scoring.d.ts +8 -0
- package/dist/scoring.d.ts.map +1 -1
- package/dist/scoring.js +66 -26
- package/dist/scoring.js.map +1 -1
- package/dist/tools/register-evaluation.d.ts +1 -1
- package/dist/tools/register-evaluation.d.ts.map +1 -1
- package/dist/tools/register-evaluation.js +90 -1
- package/dist/tools/register-evaluation.js.map +1 -1
- package/dist/tools/register-workflow.d.ts.map +1 -1
- package/dist/tools/register-workflow.js +23 -20
- package/dist/tools/register-workflow.js.map +1 -1
- package/dist/types.d.ts +36 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `judges scaffold-plugin` — Generate a starter custom plugin project.
|
|
3
|
+
*
|
|
4
|
+
* Creates a directory structure with:
|
|
5
|
+
* - package.json (with @kevinrabun/judges as peer dependency)
|
|
6
|
+
* - tsconfig.json
|
|
7
|
+
* - src/index.ts (plugin entry-point with example rule & judge)
|
|
8
|
+
* - src/rules/example-rule.ts
|
|
9
|
+
* - README.md
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* judges scaffold-plugin my-org-rules
|
|
13
|
+
* judges scaffold-plugin my-org-rules --dir ./plugins
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
16
|
+
import { join, resolve } from "path";
|
|
17
|
+
// ─── Templates ───────────────────────────────────────────────────────────────
|
|
18
|
+
function packageJsonTemplate(name) {
|
|
19
|
+
return JSON.stringify({
|
|
20
|
+
name,
|
|
21
|
+
version: "0.1.0",
|
|
22
|
+
description: `Custom Judges Panel plugin: ${name}`,
|
|
23
|
+
type: "module",
|
|
24
|
+
main: "dist/index.js",
|
|
25
|
+
types: "dist/index.d.ts",
|
|
26
|
+
scripts: {
|
|
27
|
+
build: "tsc",
|
|
28
|
+
watch: "tsc --watch",
|
|
29
|
+
test: "node --test dist/**/*.test.js",
|
|
30
|
+
},
|
|
31
|
+
peerDependencies: {
|
|
32
|
+
"@anthropic-ai/sdk": ">=0.39.0",
|
|
33
|
+
"@kevinrabun/judges": "*",
|
|
34
|
+
},
|
|
35
|
+
devDependencies: {
|
|
36
|
+
typescript: "^5.7.0",
|
|
37
|
+
},
|
|
38
|
+
keywords: ["judges-plugin", "code-review", "static-analysis"],
|
|
39
|
+
license: "MIT",
|
|
40
|
+
}, null, 2);
|
|
41
|
+
}
|
|
42
|
+
function tsconfigTemplate() {
|
|
43
|
+
return JSON.stringify({
|
|
44
|
+
compilerOptions: {
|
|
45
|
+
target: "ES2022",
|
|
46
|
+
module: "Node16",
|
|
47
|
+
moduleResolution: "Node16",
|
|
48
|
+
declaration: true,
|
|
49
|
+
outDir: "dist",
|
|
50
|
+
rootDir: "src",
|
|
51
|
+
strict: true,
|
|
52
|
+
esModuleInterop: true,
|
|
53
|
+
skipLibCheck: true,
|
|
54
|
+
},
|
|
55
|
+
include: ["src"],
|
|
56
|
+
}, null, 2);
|
|
57
|
+
}
|
|
58
|
+
function indexTemplate(name) {
|
|
59
|
+
return `/**
|
|
60
|
+
* ${name} — Custom Judges Panel Plugin
|
|
61
|
+
*
|
|
62
|
+
* Register this plugin in your .judgesrc or via the API:
|
|
63
|
+
*
|
|
64
|
+
* import { registerPlugin } from "@kevinrabun/judges/api";
|
|
65
|
+
* import plugin from "${name}";
|
|
66
|
+
* registerPlugin(plugin);
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
import type { JudgesPlugin, CustomRule } from "@kevinrabun/judges/api";
|
|
70
|
+
import { exampleNoTodoRule } from "./rules/example-rule.js";
|
|
71
|
+
|
|
72
|
+
const plugin: JudgesPlugin = {
|
|
73
|
+
name: "${name}",
|
|
74
|
+
version: "0.1.0",
|
|
75
|
+
description: "Custom rules and judges for ${name}",
|
|
76
|
+
|
|
77
|
+
// Register custom rules
|
|
78
|
+
rules: [exampleNoTodoRule],
|
|
79
|
+
|
|
80
|
+
// Optionally add custom judges (uncomment to use):
|
|
81
|
+
// judges: [],
|
|
82
|
+
|
|
83
|
+
// Hook: post-process findings (e.g., add org metadata)
|
|
84
|
+
// afterEvaluate: (findings) => {
|
|
85
|
+
// return findings.map((f) => ({
|
|
86
|
+
// ...f,
|
|
87
|
+
// tags: [...(f.tags || []), "${name}"],
|
|
88
|
+
// }));
|
|
89
|
+
// },
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export default plugin;
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
function exampleRuleTemplate() {
|
|
96
|
+
return `/**
|
|
97
|
+
* Example custom rule: no-todo-comments
|
|
98
|
+
*
|
|
99
|
+
* Flags TODO / FIXME / HACK comments as findings.
|
|
100
|
+
* This is a pattern-based rule — the simplest form.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
import type { CustomRule } from "@kevinrabun/judges/api";
|
|
104
|
+
|
|
105
|
+
export const exampleNoTodoRule: CustomRule = {
|
|
106
|
+
id: "CUSTOM-001",
|
|
107
|
+
title: "TODO/FIXME comment detected",
|
|
108
|
+
severity: "info",
|
|
109
|
+
judgeId: "code-structure",
|
|
110
|
+
description: "Flags TODO, FIXME, and HACK comments that should be tracked in an issue tracker.",
|
|
111
|
+
languages: [], // empty = all languages
|
|
112
|
+
pattern: /\\b(TODO|FIXME|HACK|XXX)\\b/i,
|
|
113
|
+
suggestedFix: "Convert this comment into a tracked issue and reference the issue ID.",
|
|
114
|
+
tags: ["tech-debt", "comments"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* For more complex rules, use the \`analyze\` function instead of \`pattern\`:
|
|
119
|
+
*
|
|
120
|
+
* export const complexRule: CustomRule = {
|
|
121
|
+
* id: "CUSTOM-002",
|
|
122
|
+
* title: "Complex custom check",
|
|
123
|
+
* severity: "medium",
|
|
124
|
+
* judgeId: "cybersecurity",
|
|
125
|
+
* description: "Example of a custom rule with analyze function.",
|
|
126
|
+
* analyze: (code, language) => {
|
|
127
|
+
* const findings: Finding[] = [];
|
|
128
|
+
* // Your custom analysis logic here
|
|
129
|
+
* return findings;
|
|
130
|
+
* },
|
|
131
|
+
* };
|
|
132
|
+
*/
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
function readmeTemplate(name) {
|
|
136
|
+
return `# ${name}
|
|
137
|
+
|
|
138
|
+
A custom plugin for [Judges Panel](https://github.com/KevinRabun/judges).
|
|
139
|
+
|
|
140
|
+
## Quick Start
|
|
141
|
+
|
|
142
|
+
\`\`\`bash
|
|
143
|
+
npm install
|
|
144
|
+
npm run build
|
|
145
|
+
\`\`\`
|
|
146
|
+
|
|
147
|
+
## Usage
|
|
148
|
+
|
|
149
|
+
### Via API
|
|
150
|
+
|
|
151
|
+
\`\`\`ts
|
|
152
|
+
import { registerPlugin } from "@kevinrabun/judges/api";
|
|
153
|
+
import plugin from "${name}";
|
|
154
|
+
|
|
155
|
+
registerPlugin(plugin);
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
### Via .judgesrc
|
|
159
|
+
|
|
160
|
+
\`\`\`json
|
|
161
|
+
{
|
|
162
|
+
"plugins": ["${name}"]
|
|
163
|
+
}
|
|
164
|
+
\`\`\`
|
|
165
|
+
|
|
166
|
+
## Adding Rules
|
|
167
|
+
|
|
168
|
+
Create a new file in \`src/rules/\` and add it to the plugin's \`rules\` array in \`src/index.ts\`.
|
|
169
|
+
|
|
170
|
+
### Pattern-Based Rule
|
|
171
|
+
|
|
172
|
+
\`\`\`ts
|
|
173
|
+
import type { CustomRule } from "@kevinrabun/judges/api";
|
|
174
|
+
|
|
175
|
+
export const myRule: CustomRule = {
|
|
176
|
+
id: "MYORG-001",
|
|
177
|
+
title: "My custom rule",
|
|
178
|
+
severity: "medium",
|
|
179
|
+
judgeId: "cybersecurity",
|
|
180
|
+
description: "What this rule checks.",
|
|
181
|
+
pattern: /dangerousFunction\\(/,
|
|
182
|
+
suggestedFix: "Use safeFunction() instead.",
|
|
183
|
+
};
|
|
184
|
+
\`\`\`
|
|
185
|
+
|
|
186
|
+
### Function-Based Rule
|
|
187
|
+
|
|
188
|
+
\`\`\`ts
|
|
189
|
+
import type { CustomRule, Finding } from "@kevinrabun/judges/api";
|
|
190
|
+
|
|
191
|
+
export const myAdvancedRule: CustomRule = {
|
|
192
|
+
id: "MYORG-002",
|
|
193
|
+
title: "Advanced custom check",
|
|
194
|
+
severity: "high",
|
|
195
|
+
judgeId: "cybersecurity",
|
|
196
|
+
description: "Complex analysis with custom logic.",
|
|
197
|
+
analyze: (code: string, language: string): Finding[] => {
|
|
198
|
+
const findings: Finding[] = [];
|
|
199
|
+
// Your analysis logic here
|
|
200
|
+
return findings;
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT
|
|
208
|
+
`;
|
|
209
|
+
}
|
|
210
|
+
function parseScaffoldArgs(argv) {
|
|
211
|
+
const args = { name: undefined, dir: "." };
|
|
212
|
+
for (let i = 3; i < argv.length; i++) {
|
|
213
|
+
const arg = argv[i];
|
|
214
|
+
if (arg === "--dir" || arg === "-d") {
|
|
215
|
+
args.dir = argv[++i];
|
|
216
|
+
}
|
|
217
|
+
else if (!arg.startsWith("-") && !args.name) {
|
|
218
|
+
args.name = arg;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return args;
|
|
222
|
+
}
|
|
223
|
+
export function runScaffoldPlugin(argv) {
|
|
224
|
+
const args = parseScaffoldArgs(argv);
|
|
225
|
+
if (!args.name) {
|
|
226
|
+
console.error("Error: Plugin name required.");
|
|
227
|
+
console.error("Usage: judges scaffold-plugin <name> [--dir <path>]");
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
const name = args.name;
|
|
231
|
+
const root = resolve(args.dir, name);
|
|
232
|
+
if (existsSync(root)) {
|
|
233
|
+
console.error(`Error: Directory already exists: ${root}`);
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
// Create directory structure
|
|
237
|
+
mkdirSync(join(root, "src", "rules"), { recursive: true });
|
|
238
|
+
// Write files
|
|
239
|
+
const files = [
|
|
240
|
+
["package.json", packageJsonTemplate(name)],
|
|
241
|
+
["tsconfig.json", tsconfigTemplate()],
|
|
242
|
+
["README.md", readmeTemplate(name)],
|
|
243
|
+
[join("src", "index.ts"), indexTemplate(name)],
|
|
244
|
+
[join("src", "rules", "example-rule.ts"), exampleRuleTemplate()],
|
|
245
|
+
];
|
|
246
|
+
for (const [rel, content] of files) {
|
|
247
|
+
writeFileSync(join(root, rel), content, "utf-8");
|
|
248
|
+
}
|
|
249
|
+
console.log("");
|
|
250
|
+
console.log("╔══════════════════════════════════════════════════════════════╗");
|
|
251
|
+
console.log("║ Judges Panel — Plugin Scaffolded ║");
|
|
252
|
+
console.log("╚══════════════════════════════════════════════════════════════╝");
|
|
253
|
+
console.log("");
|
|
254
|
+
console.log(` Created: ${root}`);
|
|
255
|
+
console.log("");
|
|
256
|
+
console.log(" Files:");
|
|
257
|
+
for (const [rel] of files) {
|
|
258
|
+
console.log(` ${rel}`);
|
|
259
|
+
}
|
|
260
|
+
console.log("");
|
|
261
|
+
console.log(" Next steps:");
|
|
262
|
+
console.log(` cd ${name}`);
|
|
263
|
+
console.log(" npm install");
|
|
264
|
+
console.log(" npm run build");
|
|
265
|
+
console.log("");
|
|
266
|
+
console.log(" Then register in your project:");
|
|
267
|
+
console.log(` import plugin from "${name}";`);
|
|
268
|
+
console.log(" registerPlugin(plugin);");
|
|
269
|
+
console.log("");
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=scaffold-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold-plugin.js","sourceRoot":"","sources":["../../src/commands/scaffold-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,gFAAgF;AAEhF,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,IAAI;QACJ,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,+BAA+B,IAAI,EAAE;QAClD,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE;YACP,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,+BAA+B;SACtC;QACD,gBAAgB,EAAE;YAChB,mBAAmB,EAAE,UAAU;YAC/B,oBAAoB,EAAE,GAAG;SAC1B;QACD,eAAe,EAAE;YACf,UAAU,EAAE,QAAQ;SACrB;QACD,QAAQ,EAAE,CAAC,eAAe,EAAE,aAAa,EAAE,iBAAiB,CAAC;QAC7D,OAAO,EAAE,KAAK;KACf,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,eAAe,EAAE;YACf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G,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `judges tune` — Analyze your project and suggest optimal .judgesrc.json configuration.
|
|
3
|
+
*
|
|
4
|
+
* Runs an initial evaluation on a sample of project files, then recommends:
|
|
5
|
+
* - Which preset best fits your project
|
|
6
|
+
* - Rules to disable based on consistent FP patterns
|
|
7
|
+
* - Severity overrides for noisy rules
|
|
8
|
+
* - Framework-specific settings
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* judges tune # Analyze current directory
|
|
12
|
+
* judges tune --dir ./src # Analyze specific directory
|
|
13
|
+
* judges tune --apply # Write .judgesrc.json automatically
|
|
14
|
+
* judges tune --max-files 20 # Limit sample size
|
|
15
|
+
*/
|
|
16
|
+
interface TuneArgs {
|
|
17
|
+
dir: string;
|
|
18
|
+
apply: boolean;
|
|
19
|
+
maxFiles: number;
|
|
20
|
+
verbose: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseTuneArgs(argv: string[]): TuneArgs;
|
|
23
|
+
export declare function runTune(argv: string[]): void;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=tune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tune.d.ts","sourceRoot":"","sources":["../../src/commands/tune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAoQD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAkCtD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAkI5C"}
|