Skip to content

pass exit code on format command#59

Open
jbolda wants to merge 1 commit into
mainfrom
format-pass-exit-code
Open

pass exit code on format command#59
jbolda wants to merge 1 commit into
mainfrom
format-pass-exit-code

Conversation

@jbolda

@jbolda jbolda commented Jul 27, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Passes through the exit code from the format command. If oxfmt fails, we will now recognize it (especially in CI).

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@jbolda
jbolda requested a review from natemoo-re July 27, 2026 04:05
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: edb7fc4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bomb.sh/tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tools@59

commit: edb7fc4

@jbolda jbolda changed the title pass exit code on lint command pass exit code on format command Jul 27, 2026
@jbolda
jbolda force-pushed the format-pass-exit-code branch from 2cf4dc6 to edb7fc4 Compare July 27, 2026 04:18
Comment thread src/commands/format.ts
for await (const line of result) {
console.info(line);
}
if (result.exitCode !== 0) process.exit(result.exitCode!);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

Suggested change
if (result.exitCode !== 0) process.exit(result.exitCode!);
if (result.exitCode) process.exit(result.exitCode);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but it didn't feel appropriate to always call process.exit(). Don't love calling it either way, but kind of following precedenc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestions just removes non-null assertion, if result.exitCode is falsy, it still skips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants