codeep 2.22.0 → 2.23.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/dist/utils/codeReview.js +21 -3
- package/dist/utils/headlessReview.js +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/utils/codeReview.js
CHANGED
|
@@ -55,11 +55,14 @@ const CODE_PATTERNS = [
|
|
|
55
55
|
// Performance issues
|
|
56
56
|
{
|
|
57
57
|
id: 'foreach-await',
|
|
58
|
-
pattern: /\.forEach\s*\([^
|
|
58
|
+
pattern: /\.forEach\s*\(\s*async\b[^{]{0,120}\{[^{}]{0,200}?\bawait\b/g,
|
|
59
59
|
category: 'performance',
|
|
60
60
|
severity: 'warning',
|
|
61
61
|
message: 'Sequential async operations in forEach are inefficient',
|
|
62
62
|
suggestion: 'Use Promise.all() with map() for parallel execution',
|
|
63
|
+
// Both quantifiers are bounded and both classes are negated, so the match
|
|
64
|
+
// is linear in the input — this rule is a built-in and never passes
|
|
65
|
+
// through the custom-rule screening in utils/reviewConfig.ts.
|
|
63
66
|
extensions: ['.js', '.ts', '.jsx', '.tsx'],
|
|
64
67
|
},
|
|
65
68
|
{
|
|
@@ -172,12 +175,27 @@ const CODE_PATTERNS = [
|
|
|
172
175
|
extensions: ['.js', '.ts', '.jsx', '.tsx'],
|
|
173
176
|
},
|
|
174
177
|
];
|
|
178
|
+
/**
|
|
179
|
+
* Collapse JavaScript's module-flavoured extensions onto `.js`.
|
|
180
|
+
*
|
|
181
|
+
* `.mjs` and `.cjs` are JavaScript — the module system differs, nothing a
|
|
182
|
+
* regex rule cares about does. Without this, thirteen rules that name `.js`
|
|
183
|
+
* silently skipped every such file, security rules included: `eval()`,
|
|
184
|
+
* `innerHTML` and hardcoded credentials went unreported in `.mjs` entirely.
|
|
185
|
+
*
|
|
186
|
+
* Normalising here rather than widening each rule's `extensions` array means a
|
|
187
|
+
* rule added tomorrow is covered by default. The arrays were the wrong place
|
|
188
|
+
* to fix it — thirteen copies of the same fact is how it went wrong once.
|
|
189
|
+
*/
|
|
190
|
+
function normaliseExtension(ext) {
|
|
191
|
+
return ext === '.mjs' || ext === '.cjs' ? '.js' : ext;
|
|
192
|
+
}
|
|
175
193
|
/**
|
|
176
194
|
* Analyze a single file for issues
|
|
177
195
|
*/
|
|
178
196
|
function analyzeFile(filePath, content, projectRoot, rules, disabled) {
|
|
179
197
|
const issues = [];
|
|
180
|
-
const ext = extname(filePath);
|
|
198
|
+
const ext = normaliseExtension(extname(filePath));
|
|
181
199
|
const relativePath = relative(projectRoot, filePath);
|
|
182
200
|
const lines = content.split('\n');
|
|
183
201
|
// Skip the regex pass on very large files (the cheap line-count heuristics
|
|
@@ -299,7 +317,7 @@ function getAllSourceFiles(dir, maxFiles = 50) {
|
|
|
299
317
|
}
|
|
300
318
|
else if (entry.isFile()) {
|
|
301
319
|
const ext = extname(entry.name);
|
|
302
|
-
if (['.ts', '.tsx', '.js', '.jsx', '.py', '.php', '.go', '.rs'].includes(ext)) {
|
|
320
|
+
if (['.ts', '.tsx', '.js', '.mjs', '.cjs', '.jsx', '.py', '.php', '.go', '.rs'].includes(ext)) {
|
|
303
321
|
files.push(fullPath);
|
|
304
322
|
}
|
|
305
323
|
}
|
|
@@ -220,7 +220,12 @@ async function runFixPlan(plan, context) {
|
|
|
220
220
|
// no boundary at all while the tests happily asserted otherwise.
|
|
221
221
|
const result = await runAgent(plan.prompt, context, {
|
|
222
222
|
personalityOverride: plan.personality,
|
|
223
|
-
|
|
223
|
+
// The product default. 12 was picked to keep a CI run cheap and was
|
|
224
|
+
// simply too small: fixing one innerHTML call and running the suite ran
|
|
225
|
+
// out of steps, and an agent stopped mid-edit leaves a worse diff than
|
|
226
|
+
// one that never started. The real bounds on cost here are the size of
|
|
227
|
+
// the plan, which buildFixPlan caps, and the action's wall-clock.
|
|
228
|
+
maxIterations: 25,
|
|
224
229
|
});
|
|
225
230
|
const edited = new Set(result.actions
|
|
226
231
|
.filter(a => a.type === 'write' || a.type === 'edit')
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.23.0";
|
package/dist/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
|
|
2
2
|
// Baked from package.json at build time so the bun-compiled binary reports
|
|
3
3
|
// the right version (it has no package.json on disk to read at runtime).
|
|
4
|
-
export const VERSION = '2.
|
|
4
|
+
export const VERSION = '2.23.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|