re-enable Prettier check for codex-cli in CI (#417)

This check was lost in https://github.com/openai/codex/pull/287. Both
the root folder and `codex-cli/` have their own `pnpm format` commands
that check the formatting of different things.

Also ran `pnpm format:fix` to fix the formatting violations that got in
while this was disabled in CI.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/417).
* #420
* #419
* #416
* __->__ #417
This commit is contained in:
Michael Bolin
2025-04-19 11:22:45 -07:00
committed by GitHub
parent 081786eaa6
commit 419f085cc4
4 changed files with 61 additions and 53 deletions

View File

@@ -44,7 +44,11 @@ jobs:
# Run all tasks using workspace filters # Run all tasks using workspace filters
- name: Check formatting - name: Check TypeScript code formatting
working-directory: codex-cli
run: pnpm run format
- name: Check Markdown and config file formatting
run: pnpm run format run: pnpm run format
- name: Run tests - name: Run tests

View File

@@ -160,7 +160,8 @@ export function TerminalChatCommandReview({
); );
} }
} }
}, { isActive } },
{ isActive },
); );
return ( return (

View File

@@ -303,12 +303,7 @@ export default function TerminalChat({
// We intentionally omit 'approvalPolicy' and 'confirmationPrompt' from the deps // We intentionally omit 'approvalPolicy' and 'confirmationPrompt' from the deps
// so switching modes or showing confirmation dialogs doesnt tear down the loop. // so switching modes or showing confirmation dialogs doesnt tear down the loop.
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [ }, [model, config, requestConfirmation, additionalWritableRoots]);
model,
config,
requestConfirmation,
additionalWritableRoots,
]);
// whenever loading starts/stops, reset or start a timer — but pause the // whenever loading starts/stops, reset or start a timer — but pause the
// timer while a confirmation overlay is displayed so we don't trigger a // timer while a confirmation overlay is displayed so we don't trigger a
@@ -597,7 +592,11 @@ export default function TerminalChat({
setApprovalPolicy(newMode as ApprovalPolicy); setApprovalPolicy(newMode as ApprovalPolicy);
// update existing AgentLoop instance // update existing AgentLoop instance
if (agentRef.current) { if (agentRef.current) {
(agentRef.current as unknown as { approvalPolicy: ApprovalPolicy }).approvalPolicy = newMode as ApprovalPolicy; (
agentRef.current as unknown as {
approvalPolicy: ApprovalPolicy;
}
).approvalPolicy = newMode as ApprovalPolicy;
} }
setItems((prev) => [ setItems((prev) => [
...prev, ...prev,

View File

@@ -14,9 +14,13 @@ describe("createInputItem", () => {
it("includes image content for existing file", async () => { it("includes image content for existing file", async () => {
const fakeBuffer = Buffer.from("fake image content"); const fakeBuffer = Buffer.from("fake image content");
const readSpy = vi.spyOn(fs, "readFile").mockResolvedValue(fakeBuffer as any); const readSpy = vi
.spyOn(fs, "readFile")
.mockResolvedValue(fakeBuffer as any);
const result = await createInputItem("hello", ["dummy-path"]); const result = await createInputItem("hello", ["dummy-path"]);
const expectedUrl = `data:application/octet-stream;base64,${fakeBuffer.toString("base64")}`; const expectedUrl = `data:application/octet-stream;base64,${fakeBuffer.toString(
"base64",
)}`;
expect(result.role).toBe("user"); expect(result.role).toBe("user");
expect(result.type).toBe("message"); expect(result.type).toBe("message");
expect(result.content.length).toBe(2); expect(result.content.length).toBe(2);