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

@@ -82,7 +82,9 @@ function getAnnounceQueue(
function scheduleAnnounceDrain(key: string) {
const queue = ANNOUNCE_QUEUES.get(key);
if (!queue || queue.draining) return;
if (!queue || queue.draining) {
return;
}
queue.draining = true;
void (async () => {
try {
@@ -92,19 +94,27 @@ function scheduleAnnounceDrain(key: string) {
if (queue.mode === "collect") {
if (forceIndividualCollect) {
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await queue.send(next);
continue;
}
const isCrossChannel = hasCrossChannelItems(queue.items, (item) => {
if (!item.origin) return {};
if (!item.originKey) return { cross: true };
if (!item.origin) {
return {};
}
if (!item.originKey) {
return { cross: true };
}
return { key: item.originKey };
});
if (isCrossChannel) {
forceIndividualCollect = true;
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await queue.send(next);
continue;
}
@@ -117,7 +127,9 @@ function scheduleAnnounceDrain(key: string) {
renderItem: (item, idx) => `---\nQueued #${idx + 1}\n${item.prompt}`.trim(),
});
const last = items.at(-1);
if (!last) break;
if (!last) {
break;
}
await queue.send({ ...last, prompt });
continue;
}
@@ -125,13 +137,17 @@ function scheduleAnnounceDrain(key: string) {
const summaryPrompt = buildQueueSummaryPrompt({ state: queue, noun: "announce" });
if (summaryPrompt) {
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await queue.send({ ...next, prompt: summaryPrompt });
continue;
}
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await queue.send(next);
}
} catch (err) {