Skip to content

Commit 3224a08

Browse files
committed
style: apply biome formatter
Release CI for v2.0.0 failed on `biome check` because several files touched in the perf-win batch landed without running the formatter locally (the sandbox used to draft the changes lacks `bun` + the pre-commit hook). No logic change — pure reflow: - git-inventory-tool.ts: long makeSkipEntry / maxRoots lines - presets.ts: wrap the getPresetEntry union return type - roots.ts: wrap the root_index_out_of_range return literal
1 parent e22ddba commit 3224a08

File tree

3 files changed

+29
-34
lines changed

3 files changed

+29
-34
lines changed

src/server/git-inventory-tool.ts

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ export function registerGitInventoryTool(server: FastMCP): void {
3434
.describe("Merge with preset instead of replacing."),
3535
remote: z.string().optional().describe("Pair with `branch`."),
3636
branch: z.string().optional().describe("Pair with `remote`."),
37-
maxRoots: z
38-
.number()
39-
.int()
40-
.min(1)
41-
.max(256)
42-
.optional()
43-
.default(MAX_INVENTORY_ROOTS_DEFAULT),
37+
maxRoots: z.number().int().min(1).max(256).optional().default(MAX_INVENTORY_ROOTS_DEFAULT),
4438
}),
4539
execute: async (args) => {
4640
const pre = requireGitAndRoots(server, args, args.preset);
@@ -57,7 +51,10 @@ export function registerGitInventoryTool(server: FastMCP): void {
5751
}
5852
const useFixed = hasRemote && hasBranch;
5953
if (useFixed) {
60-
if (!isSafeGitUpstreamToken(fixedRemote!.trim()) || !isSafeGitUpstreamToken(fixedBranch!.trim())) {
54+
if (
55+
!isSafeGitUpstreamToken(fixedRemote!.trim()) ||
56+
!isSafeGitUpstreamToken(fixedBranch!.trim())
57+
) {
6158
return jsonRespond({ error: "invalid_remote_or_branch" });
6259
}
6360
}
@@ -80,9 +77,17 @@ export function registerGitInventoryTool(server: FastMCP): void {
8077
allJson.push({
8178
workspace_root: workspaceRoot,
8279
...(useFixed
83-
? { upstream: { mode: "fixed" as const, remote: fixedRemote!, branch: fixedBranch! } }
80+
? {
81+
upstream: {
82+
mode: "fixed" as const,
83+
remote: fixedRemote!,
84+
branch: fixedBranch!,
85+
},
86+
}
8487
: {}),
85-
entries: [makeSkipEntry(workspaceRoot, workspaceRoot, upstreamMode, JSON.stringify(err))],
88+
entries: [
89+
makeSkipEntry(workspaceRoot, workspaceRoot, upstreamMode, JSON.stringify(err)),
90+
],
8691
});
8792
} else {
8893
mdChunks.push(`### ${workspaceRoot}\n${jsonRespond(err)}`);
@@ -123,24 +128,12 @@ export function registerGitInventoryTool(server: FastMCP): void {
123128
const { abs, underTop } = validateRepoPath(rel, top);
124129
if (!underTop) {
125130
entries.push(
126-
makeSkipEntry(
127-
rel,
128-
abs,
129-
upstreamMode,
130-
"(path escapes git toplevel — rejected)",
131-
),
131+
makeSkipEntry(rel, abs, upstreamMode, "(path escapes git toplevel — rejected)"),
132132
);
133133
continue;
134134
}
135135
if (!gitRevParseGitDir(abs)) {
136-
entries.push(
137-
makeSkipEntry(
138-
rel,
139-
abs,
140-
upstreamMode,
141-
"(not a git work tree — skip)",
142-
),
143-
);
136+
entries.push(makeSkipEntry(rel, abs, upstreamMode, "(not a git work tree — skip)"));
144137
continue;
145138
}
146139
jobs.push({ label: rel, abs });
@@ -155,14 +148,7 @@ export function registerGitInventoryTool(server: FastMCP): void {
155148
);
156149
entries.push(...computed);
157150
} else if (!gitRevParseGitDir(top)) {
158-
entries.push(
159-
makeSkipEntry(
160-
".",
161-
top,
162-
upstreamMode,
163-
"(not a git work tree — unexpected)",
164-
),
165-
);
151+
entries.push(makeSkipEntry(".", top, upstreamMode, "(not a git work tree — unexpected)"));
166152
} else {
167153
const one = await collectInventoryEntry(
168154
".",

src/server/presets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ export function presetLoadErrorPayload(
124124
export function getPresetEntry(
125125
gitTop: string,
126126
presetName: string,
127-
): { ok: true; entry: PresetEntry; presetSchemaVersion?: string } | { ok: false; error: Record<string, unknown> } {
127+
):
128+
| { ok: true; entry: PresetEntry; presetSchemaVersion?: string }
129+
| { ok: false; error: Record<string, unknown> } {
128130
const loaded = loadPresetsFromGitTop(gitTop);
129131
if (!loaded.ok) {
130132
if (loaded.reason === "missing") {

src/server/roots.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ export function resolveWorkspaceRoots(server: FastMCP, args: RootPick): ResolveR
6161
if (args.rootIndex != null) {
6262
const r = fileRoots[args.rootIndex];
6363
if (!r) {
64-
return { ok: false, error: { error: "root_index_out_of_range", rootIndex: args.rootIndex, rootCount: fileRoots.length } };
64+
return {
65+
ok: false,
66+
error: {
67+
error: "root_index_out_of_range",
68+
rootIndex: args.rootIndex,
69+
rootCount: fileRoots.length,
70+
},
71+
};
6572
}
6673
return { ok: true, roots: [r] };
6774
}

0 commit comments

Comments
 (0)