Keep main's one-line guards where no rule needs braces
Check / check (pull_request) Successful in 37s

This commit is contained in:
Danny Kim
2026-10-17 18:52:49 +09:00
parent 3cbe4171ea
commit eba9b9c57c
4 changed files with 12 additions and 27 deletions
+5 -15
View File
@@ -52,9 +52,7 @@ type ClaudeResult = ClaudeFailureFields &
const env = (name: string): string => {
const value = process.env[name];
if (value === undefined) {
throw new Error(`${name} is not set`);
}
if (value === undefined) throw new Error(`${name} is not set`);
return value;
};
@@ -101,9 +99,7 @@ async function postAuthorComment(body: string): Promise<void> {
async function runRoot(command: string, args: string[]): Promise<void> {
const { success, code } = await output(command, { args, env: PROCESS_ENV, clearEnv: true });
if (!success) {
throw new Error(`${command} ${args[0]} exited with ${code}`);
}
if (!success) throw new Error(`${command} ${args[0]} exited with ${code}`);
}
async function configureGitAuthor(): Promise<void> {
@@ -131,9 +127,7 @@ async function runAgentCommand(
env: agentEnvironment(PROCESS_ENV, profile, token),
clearEnv: true,
}).output();
if (!success) {
throw new Error(`${command} ${args[0]} exited with ${code}`);
}
if (!success) throw new Error(`${command} ${args[0]} exited with ${code}`);
}
async function prepareProfile(profile: RuntimeProfile): Promise<void> {
@@ -361,9 +355,7 @@ async function runCodex(
env: environment,
clearEnv: true,
}).output();
if (!loggedIn.success) {
await codexDeviceLogin(profile, environment);
}
if (!loggedIn.success) await codexDeviceLogin(profile, environment);
}
const outputPath = await makeProfileFile(profile, "result.md");
const attempt = async (): Promise<{ status: CommandStatus; error: string }> => {
@@ -479,9 +471,7 @@ async function runProfile(profile: RuntimeProfile): Promise<AttemptResult> {
await persistCodexAuth(stagedCodexAuth, CODEX_AUTH);
}
}
if (resultPath !== null) {
body = await readProfileFile(profile, resultPath);
}
if (resultPath !== null) body = await readProfileFile(profile, resultPath);
if (body === undefined || reviewPath === undefined || anchorsPath === undefined) {
throw new Error("agent attempt produced no result");
}