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

@@ -10,7 +10,9 @@ async function detectOpenClawGitCheckout(root: string): Promise<"git" | "not-git
const res = await runCommandWithTimeout(["git", "-C", root, "rev-parse", "--show-toplevel"], {
timeoutMs: 5000,
}).catch(() => null);
if (!res) return "unknown";
if (!res) {
return "unknown";
}
if (res.code !== 0) {
// Avoid noisy "Update via package manager" notes when git is missing/broken,
// but do show it when this is clearly not a git checkout.
@@ -36,7 +38,9 @@ export async function maybeOfferUpdateBeforeDoctor(params: {
params.options.yes !== true &&
params.options.repair !== true &&
Boolean(process.stdin.isTTY);
if (!canOfferUpdate || !params.root) return { updated: false };
if (!canOfferUpdate || !params.root) {
return { updated: false };
}
const git = await detectOpenClawGitCheckout(params.root);
if (git === "git") {
@@ -44,7 +48,9 @@ export async function maybeOfferUpdateBeforeDoctor(params: {
message: "Update OpenClaw from git before running doctor?",
initialValue: true,
});
if (!shouldUpdate) return { updated: false };
if (!shouldUpdate) {
return { updated: false };
}
note("Running update (fetch/rebase/build/ui:build/doctor)…", "Update");
const result = await runGatewayUpdate({
cwd: params.root,