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

@@ -67,8 +67,12 @@ function buildHooksReport(config: OpenClawConfig): HookStatusReport {
}
function formatHookStatus(hook: HookStatusEntry): string {
if (hook.eligible) return theme.success("✓ ready");
if (hook.disabled) return theme.warn("⏸ disabled");
if (hook.eligible) {
return theme.success("✓ ready");
}
if (hook.disabled) {
return theme.warn("⏸ disabled");
}
return theme.error("✗ missing");
}
@@ -78,7 +82,9 @@ function formatHookName(hook: HookStatusEntry): string {
}
function formatHookSource(hook: HookStatusEntry): string {
if (!hook.managedByPlugin) return hook.source;
if (!hook.managedByPlugin) {
return hook.source;
}
return `plugin:${hook.pluginId ?? "unknown"}`;
}
@@ -326,13 +332,24 @@ export function formatHooksCheck(report: HookStatusReport, opts: HooksCheckOptio
lines.push(theme.heading("Hooks not ready:"));
for (const hook of notEligible) {
const reasons = [];
if (hook.disabled) reasons.push("disabled");
if (hook.missing.bins.length > 0) reasons.push(`bins: ${hook.missing.bins.join(", ")}`);
if (hook.missing.anyBins.length > 0)
if (hook.disabled) {
reasons.push("disabled");
}
if (hook.missing.bins.length > 0) {
reasons.push(`bins: ${hook.missing.bins.join(", ")}`);
}
if (hook.missing.anyBins.length > 0) {
reasons.push(`anyBins: ${hook.missing.anyBins.join(", ")}`);
if (hook.missing.env.length > 0) reasons.push(`env: ${hook.missing.env.join(", ")}`);
if (hook.missing.config.length > 0) reasons.push(`config: ${hook.missing.config.join(", ")}`);
if (hook.missing.os.length > 0) reasons.push(`os: ${hook.missing.os.join(", ")}`);
}
if (hook.missing.env.length > 0) {
reasons.push(`env: ${hook.missing.env.join(", ")}`);
}
if (hook.missing.config.length > 0) {
reasons.push(`config: ${hook.missing.config.join(", ")}`);
}
if (hook.missing.os.length > 0) {
reasons.push(`os: ${hook.missing.os.join(", ")}`);
}
lines.push(` ${hook.emoji ?? "🔗"} ${hook.name} - ${reasons.join("; ")}`);
}
}