chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -16,13 +16,23 @@ import { normalizeToolName } from "./tool-policy.js";
function extendExecMeta(toolName: string, args: unknown, meta?: string): string | undefined {
const normalized = toolName.trim().toLowerCase();
if (normalized !== "exec" && normalized !== "bash") return meta;
if (!args || typeof args !== "object") return meta;
if (normalized !== "exec" && normalized !== "bash") {
return meta;
}
if (!args || typeof args !== "object") {
return meta;
}
const record = args as Record<string, unknown>;
const flags: string[] = [];
if (record.pty === true) flags.push("pty");
if (record.elevated === true) flags.push("elevated");
if (flags.length === 0) return meta;
if (record.pty === true) {
flags.push("pty");
}
if (record.elevated === true) {
flags.push("elevated");
}
if (flags.length === 0) {
return meta;
}
const suffix = flags.join(" · ");
return meta ? `${meta} · ${suffix}` : suffix;
}