pi-lens 2.2.4 → 2.2.5
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.
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* - OutputSemantic: How to display (blocking, warning, silent, etc.)
|
|
14
14
|
* - BaselineStore: Track pre-existing issues for delta mode
|
|
15
15
|
*/
|
|
16
|
-
import * as fs from "node:fs";
|
|
17
16
|
import { detectFileKind } from "../file-kinds.js";
|
|
18
17
|
// --- In-Memory Baseline Store ---
|
|
19
18
|
export function createBaselineStore() {
|
|
@@ -32,8 +31,6 @@ export function createBaselineStore() {
|
|
|
32
31
|
}
|
|
33
32
|
// --- Runner Registry ---
|
|
34
33
|
const globalRegistry = new Map();
|
|
35
|
-
// Track last-run mtime per file+runner to skip unchanged files
|
|
36
|
-
const lastRunMtimes = new Map(); // key: `${runnerId}:${filePath}` -> mtimeMs
|
|
37
34
|
export function registerRunner(runner) {
|
|
38
35
|
if (globalRegistry.has(runner.id)) {
|
|
39
36
|
console.error(`[dispatch] Duplicate runner: ${runner.id}`);
|
|
@@ -223,22 +220,6 @@ export async function dispatchForFile(ctx, groups) {
|
|
|
223
220
|
}
|
|
224
221
|
// --- Run Single Runner ---
|
|
225
222
|
async function runRunner(ctx, runner, defaultSemantic) {
|
|
226
|
-
// Skip if file unchanged (optimization for expensive runners)
|
|
227
|
-
if (runner.skipIfUnchanged) {
|
|
228
|
-
const cacheKey = `${runner.id}:${ctx.filePath}`;
|
|
229
|
-
try {
|
|
230
|
-
const stats = fs.statSync(ctx.filePath);
|
|
231
|
-
const lastMtime = lastRunMtimes.get(cacheKey);
|
|
232
|
-
if (lastMtime && stats.mtimeMs <= lastMtime) {
|
|
233
|
-
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
234
|
-
}
|
|
235
|
-
// Update mtime after run (below)
|
|
236
|
-
lastRunMtimes.set(cacheKey, stats.mtimeMs);
|
|
237
|
-
}
|
|
238
|
-
catch {
|
|
239
|
-
// File doesn't exist or stat failed, continue with run
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
223
|
try {
|
|
243
224
|
const result = await runner.run(ctx);
|
|
244
225
|
return {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* - BaselineStore: Track pre-existing issues for delta mode
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import * as fs from "node:fs";
|
|
18
17
|
import type { FileKind } from "../file-kinds.js";
|
|
19
18
|
import { detectFileKind } from "../file-kinds.js";
|
|
20
19
|
|
|
@@ -52,9 +51,6 @@ export function createBaselineStore(): BaselineStore {
|
|
|
52
51
|
|
|
53
52
|
const globalRegistry = new Map<string, RunnerDefinition>();
|
|
54
53
|
|
|
55
|
-
// Track last-run mtime per file+runner to skip unchanged files
|
|
56
|
-
const lastRunMtimes = new Map<string, number>(); // key: `${runnerId}:${filePath}` -> mtimeMs
|
|
57
|
-
|
|
58
54
|
export function registerRunner(runner: RunnerDefinition): void {
|
|
59
55
|
if (globalRegistry.has(runner.id)) {
|
|
60
56
|
console.error(`[dispatch] Duplicate runner: ${runner.id}`);
|
|
@@ -311,22 +307,6 @@ async function runRunner(
|
|
|
311
307
|
runner: RunnerDefinition,
|
|
312
308
|
defaultSemantic: OutputSemantic,
|
|
313
309
|
): Promise<RunnerResult> {
|
|
314
|
-
// Skip if file unchanged (optimization for expensive runners)
|
|
315
|
-
if (runner.skipIfUnchanged) {
|
|
316
|
-
const cacheKey = `${runner.id}:${ctx.filePath}`;
|
|
317
|
-
try {
|
|
318
|
-
const stats = fs.statSync(ctx.filePath);
|
|
319
|
-
const lastMtime = lastRunMtimes.get(cacheKey);
|
|
320
|
-
if (lastMtime && stats.mtimeMs <= lastMtime) {
|
|
321
|
-
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
322
|
-
}
|
|
323
|
-
// Update mtime after run (below)
|
|
324
|
-
lastRunMtimes.set(cacheKey, stats.mtimeMs);
|
|
325
|
-
} catch {
|
|
326
|
-
// File doesn't exist or stat failed, continue with run
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
310
|
try {
|
|
331
311
|
const result = await runner.run(ctx);
|
|
332
312
|
return {
|
|
@@ -20,7 +20,6 @@ const typeSafetyRunner: RunnerDefinition = {
|
|
|
20
20
|
appliesTo: ["jsts"],
|
|
21
21
|
priority: 20,
|
|
22
22
|
enabledByDefault: true,
|
|
23
|
-
skipIfUnchanged: true, // Skip type-coverage if file unchanged
|
|
24
23
|
|
|
25
24
|
async run(ctx: DispatchContext): Promise<RunnerResult> {
|
|
26
25
|
// Only check TypeScript files
|
|
@@ -98,8 +98,6 @@ export interface RunnerDefinition {
|
|
|
98
98
|
enabledByDefault: boolean;
|
|
99
99
|
/** Skip this runner for test files (false positive reduction) */
|
|
100
100
|
skipTestFiles?: boolean;
|
|
101
|
-
/** Skip if file unchanged since last run (check mtime) */
|
|
102
|
-
skipIfUnchanged?: boolean;
|
|
103
101
|
/** Check if runner should run */
|
|
104
102
|
when?: (ctx: DispatchContext) => Promise<boolean> | boolean;
|
|
105
103
|
/** Execute the runner */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-lens",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Real-time code quality feedback for pi — TypeScript LSP, Biome, ast-grep, Ruff, complexity metrics, duplicate detection. Includes automated fix loop (/lens-booboo-fix) and interactive architectural refactoring (/lens-booboo-refactor) with browser-based interviews.",
|
|
6
6
|
"repository": {
|