@rigour-labs/cli 6.12.2 → 6.12.3-rc.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.
|
@@ -10,10 +10,12 @@ export interface Checked {
|
|
|
10
10
|
uncommitted: boolean;
|
|
11
11
|
/** The settings read: a path, `<path> at <commit>` for an independent review, or `defaults`. */
|
|
12
12
|
config: string;
|
|
13
|
-
/** Every check the run reached, by id: PASS, FAIL, SKIP or ERROR. A check whose findings were all already in the base reads PASS. */
|
|
13
|
+
/** Every check the run reached, by id: PASS, FAIL, SKIP or ERROR. A check whose findings were all already in the base, or only on lines the change did not touch, reads PASS. */
|
|
14
14
|
checks: Record<string, string>;
|
|
15
15
|
/** By check, how many findings the base already had: left out of the verdict and of `checks`. */
|
|
16
16
|
preexisting: Record<string, number>;
|
|
17
|
+
/** By check, how many findings sat only on lines the change did not touch: left out of the verdict and of `checks`. */
|
|
18
|
+
outsideChange: Record<string, number>;
|
|
17
19
|
}
|
|
18
20
|
export declare function whatWasChecked(cwd: string, options: {
|
|
19
21
|
base?: string;
|
|
@@ -18,6 +18,7 @@ export function whatWasChecked(cwd, options, trustedRef, result) {
|
|
|
18
18
|
config: configSource(cwd, options, trustedRef),
|
|
19
19
|
checks: { ...(result.report?.summary ?? {}) },
|
|
20
20
|
preexisting: { ...result.preexistingByCheck },
|
|
21
|
+
outsideChange: { ...result.outsideChangeByCheck },
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
function git(cwd, args) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import chalk from 'chalk';
|
|
11
11
|
import fs from 'fs';
|
|
12
12
|
import path from 'path';
|
|
13
|
-
import { findingKey } from '@rigour-labs/core';
|
|
13
|
+
import { findingKey, gateOf } from '@rigour-labs/core';
|
|
14
14
|
import { enabledHere } from './personal.js';
|
|
15
15
|
import { printReceipt } from './review-receipt.js';
|
|
16
16
|
const SHOWN = 5;
|
|
@@ -51,15 +51,40 @@ function printFindings(result, all) {
|
|
|
51
51
|
console.log(chalk.dim(`\n …and ${count - SHOWN} more: rigour review --all`));
|
|
52
52
|
console.log(chalk.dim('\n Wrong? Dismiss it once and it never comes back.\n'));
|
|
53
53
|
}
|
|
54
|
+
/** The left-out findings by check, most first (`: ast-analysis 12, file-size 1`), as `checked.preexisting` and `checked.outsideChange` give them in JSON. */
|
|
55
|
+
function leftOutByCheck(result) {
|
|
56
|
+
const byCheck = new Map();
|
|
57
|
+
for (const counts of [result.preexistingByCheck, result.outsideChangeByCheck])
|
|
58
|
+
for (const [check, n] of Object.entries(counts ?? {}))
|
|
59
|
+
byCheck.set(check, (byCheck.get(check) ?? 0) + n);
|
|
60
|
+
const parts = countsByCheck(byCheck);
|
|
61
|
+
return parts ? `: ${parts}` : '';
|
|
62
|
+
}
|
|
63
|
+
/** `ast-analysis 12, file-size 3`: most first, then by name. */
|
|
64
|
+
function countsByCheck(byCheck) {
|
|
65
|
+
return [...byCheck].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([check, n]) => `${check} ${n}`).join(', ');
|
|
66
|
+
}
|
|
67
|
+
/** Findings about a changed file as a whole (no line), by the check that gave them: they fail their check without a row of their own. */
|
|
68
|
+
function fileFindingsByCheck(result) {
|
|
69
|
+
const byCheck = new Map();
|
|
70
|
+
for (const f of result.fileFindings) {
|
|
71
|
+
const check = gateOf(f) ?? f.id;
|
|
72
|
+
byCheck.set(check, (byCheck.get(check) ?? 0) + 1);
|
|
73
|
+
}
|
|
74
|
+
return countsByCheck(byCheck);
|
|
75
|
+
}
|
|
54
76
|
/** One line each, in plain words, for what was seen and never blocks. */
|
|
55
77
|
function printQuietLines(result, notes) {
|
|
56
78
|
const lines = [];
|
|
57
79
|
const seen = result.advisory.length + result.fileFindings.length;
|
|
58
80
|
if (seen)
|
|
59
81
|
lines.push(`Also seen, never blocking: ${seen} note${seen === 1 ? '' : 's'}${notes ? '' : ' (rigour review --notes)'}`);
|
|
82
|
+
const wholeFile = fileFindingsByCheck(result);
|
|
83
|
+
if (wholeFile)
|
|
84
|
+
lines.push(`About a changed file as a whole: ${wholeFile}${notes ? ' (listed below)' : ', shown with --notes'}.`);
|
|
60
85
|
const before = result.preexisting + result.excludedOutsideChangedLines;
|
|
61
86
|
if (before)
|
|
62
|
-
lines.push(`Not shown: ${before} issue${before === 1 ? '' : 's'} the code already had before this change (review.show_preexisting: true lists them).`);
|
|
87
|
+
lines.push(`Not shown: ${before} issue${before === 1 ? '' : 's'} the code already had before this change${leftOutByCheck(result)} (review.show_preexisting: true lists them).`);
|
|
63
88
|
if (result.baseUnknown)
|
|
64
89
|
lines.push('Compared with no base: HEAD already holds this diff, so findings on its lines were not checked against the code before it. Pass --base to compare.');
|
|
65
90
|
if (result.hints.length)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/cli",
|
|
3
|
-
"version": "6.12.2",
|
|
3
|
+
"version": "6.12.3-rc.2",
|
|
4
4
|
"description": "Code review that happens while your agent writes: deterministic checks on the lines it changed, quiet unless it can prove a defect, and learning from your team's fixes and dismissals. Works with Claude Code, Cursor, Codex, Cline and Windsurf.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.13"
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"inquirer": "9.2.16",
|
|
60
60
|
"ora": "^8.0.1",
|
|
61
61
|
"yaml": "^2.8.2",
|
|
62
|
-
"@rigour-labs/core": "6.12.2"
|
|
62
|
+
"@rigour-labs/core": "6.12.3-rc.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/fs-extra": "^11.0.4",
|
|
66
66
|
"@types/inquirer": "9.0.7",
|
|
67
67
|
"@types/node": "^25.0.3",
|
|
68
|
-
"@rigour-labs/studio": "6.12.2"
|
|
68
|
+
"@rigour-labs/studio": "6.12.3-rc.2"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsc && pnpm bundle-studio",
|