Skip to content

Commit e059b30

Browse files
that-github-userunknownclaude
authored
Code quality: remove dead code, deduplicate padRight, clean exports (#148)
- Remove extractRunNumber (always returned -1, dead code) (#130) - Import padRight from display.ts instead of duplicating in evaluate.ts (#132) - Make CleanOptions, CompareOptions, StatsOptions non-exported (unused externally) (#133) - Keep ApplyOptions exported (used in tests) Closes #130 Closes #132 Closes #133 Co-authored-by: unknown <that-github-user@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5fc9d02 commit e059b30

6 files changed

Lines changed: 5 additions & 23 deletions

File tree

src/commands/clean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cleanupBranches, getRepoRoot, removeWorktree } from "../utils/git.js";
66

77
const exec = promisify(execFile);
88

9-
export interface CleanOptions {
9+
interface CleanOptions {
1010
all?: boolean;
1111
}
1212

src/commands/compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import pc from "picocolors";
44
import { diffSimilarity, parseDiff } from "../scoring/diff-parser.js";
55
import type { AgentResult, EnsembleResult } from "../types.js";
66

7-
export interface CompareOptions {
7+
interface CompareOptions {
88
agentA: number;
99
agentB: number;
1010
}

src/commands/evaluate.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { join } from "node:path";
33
import pc from "picocolors";
44
import { analyzeConvergence, copelandRecommend, recommend } from "../scoring/convergence.js";
55
import type { EnsembleResult } from "../types.js";
6+
import { padRight } from "../utils/display.js";
67
import { parseAndValidateResult } from "../utils/schema.js";
78

89
interface RunEvaluation {
@@ -207,13 +208,6 @@ export async function evaluate(): Promise<void> {
207208
console.log();
208209
}
209210

210-
function padRight(str: string, len: number): string {
211-
// biome-ignore lint/suspicious/noControlCharactersInRegex: intentional ANSI escape sequence matching
212-
const stripped = str.replace(/\x1b\[[0-9;]*m/g, "");
213-
const padding = Math.max(0, len - stripped.length);
214-
return str + " ".repeat(padding);
215-
}
216-
217211
function pct(n: number, total: number): string {
218212
return `${n}/${total} (${Math.round((n / total) * 100)}%)`;
219213
}

src/commands/list.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import assert from "node:assert/strict";
22
import { describe, it } from "node:test";
33
import type { EnsembleResult } from "../types.js";
4-
import { buildRunSummary, extractRunNumber } from "./list.js";
5-
6-
describe("extractRunNumber", () => {
7-
it("returns -1 (run numbers assigned by load order, not filename)", () => {
8-
assert.equal(extractRunNumber("run-2026-03-28T05-58-48-564Z.json"), -1);
9-
assert.equal(extractRunNumber("latest.json"), -1);
10-
});
11-
});
4+
import { buildRunSummary } from "./list.js";
125

136
function makeResult(overrides: Partial<EnsembleResult> = {}): EnsembleResult {
147
return {

src/commands/list.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ export interface RunSummary {
1414
avgConvergence: number | null;
1515
}
1616

17-
/** Run numbers are assigned by sort order (chronological), not embedded in filename */
18-
export function extractRunNumber(_filename: string): number {
19-
return -1; // Assigned by loadAllRuns based on sort position
20-
}
21-
2217
export function buildRunSummary(runNumber: number, result: EnsembleResult): RunSummary {
2318
const testPassRate =
2419
result.tests.length > 0

src/commands/stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import pc from "picocolors";
44
import type { EnsembleResult } from "../types.js";
55
import { parseAndValidateResult } from "../utils/schema.js";
66

7-
export interface StatsOptions {
7+
interface StatsOptions {
88
model?: string;
99
since?: string;
1010
until?: string;

0 commit comments

Comments
 (0)