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

@@ -34,8 +34,12 @@ export function createLocalShellRunner(deps: LocalShellDeps) {
const maxChars = deps.maxOutputChars ?? 40_000;
const ensureLocalExecAllowed = async (): Promise<boolean> => {
if (localExecAllowed) return true;
if (localExecAsked) return false;
if (localExecAllowed) {
return true;
}
if (localExecAsked) {
return false;
}
localExecAsked = true;
return await new Promise<boolean>((resolve) => {
@@ -78,7 +82,9 @@ export function createLocalShellRunner(deps: LocalShellDeps) {
const cmd = line.slice(1);
// NOTE: A lone '!' is handled by the submit handler as a normal message.
// Keep this guard anyway in case this is called directly.
if (cmd === "") return;
if (cmd === "") {
return;
}
if (localExecAsked && !localExecAllowed) {
deps.chatLog.addSystem("local shell: not enabled for this session");
@@ -87,7 +93,9 @@ export function createLocalShellRunner(deps: LocalShellDeps) {
}
const allowed = await ensureLocalExecAllowed();
if (!allowed) return;
if (!allowed) {
return;
}
deps.chatLog.addSystem(`[local] $ ${cmd}`);
deps.tui.requestRender();