mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:51:23 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -6,21 +6,31 @@ import { applySoulEvilOverride, resolveSoulEvilConfigFromHook } from "../../soul
|
||||
const HOOK_KEY = "soul-evil";
|
||||
|
||||
const soulEvilHook: HookHandler = async (event) => {
|
||||
if (!isAgentBootstrapEvent(event)) return;
|
||||
if (!isAgentBootstrapEvent(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const context = event.context;
|
||||
if (context.sessionKey && isSubagentSessionKey(context.sessionKey)) return;
|
||||
if (context.sessionKey && isSubagentSessionKey(context.sessionKey)) {
|
||||
return;
|
||||
}
|
||||
const cfg = context.cfg;
|
||||
const hookConfig = resolveHookConfig(cfg, HOOK_KEY);
|
||||
if (!hookConfig || hookConfig.enabled === false) return;
|
||||
if (!hookConfig || hookConfig.enabled === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
const soulConfig = resolveSoulEvilConfigFromHook(hookConfig as Record<string, unknown>, {
|
||||
warn: (message) => console.warn(`[soul-evil] ${message}`),
|
||||
});
|
||||
if (!soulConfig) return;
|
||||
if (!soulConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
const workspaceDir = context.workspaceDir;
|
||||
if (!workspaceDir || !Array.isArray(context.bootstrapFiles)) return;
|
||||
if (!workspaceDir || !Array.isArray(context.bootstrapFiles)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updated = await applySoulEvilOverride({
|
||||
files: context.bootstrapFiles,
|
||||
|
||||
Reference in New Issue
Block a user