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

@@ -75,12 +75,16 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
child.stdout?.on("data", (data: Buffer) => {
const line = data.toString().trim();
if (line) log.info(`[gog] ${line}`);
if (line) {
log.info(`[gog] ${line}`);
}
});
child.stderr?.on("data", (data: Buffer) => {
const line = data.toString().trim();
if (!line) return;
if (!line) {
return;
}
if (isAddressInUseError(line)) {
addressInUse = true;
}
@@ -92,7 +96,9 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
});
child.on("exit", (code, signal) => {
if (shuttingDown) return;
if (shuttingDown) {
return;
}
if (addressInUse) {
log.warn(
"gog serve failed to bind (address already in use); stopping restarts. " +
@@ -104,7 +110,9 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
log.warn(`gog exited (code=${code}, signal=${signal}); restarting in 5s`);
watcherProcess = null;
setTimeout(() => {
if (shuttingDown || !currentConfig) return;
if (shuttingDown || !currentConfig) {
return;
}
watcherProcess = spawnGogServe(currentConfig);
}, 5000);
});
@@ -180,7 +188,9 @@ export async function startGmailWatcher(cfg: OpenClawConfig): Promise<GmailWatch
// Set up renewal interval
const renewMs = runtimeConfig.renewEveryMinutes * 60_000;
renewInterval = setInterval(() => {
if (shuttingDown) return;
if (shuttingDown) {
return;
}
void startGmailWatch(runtimeConfig);
}, renewMs);