Skip to content

Tell checks, errors and panics apart by exit code to close #783 - #784

Merged
mathiasrw merged 14 commits into
mainfrom
fix/783
Oct 23, 2026
Merged

mathiasrw merged 14 commits into
mainfrom
fix/783

Conversation

@mathiasrw

@mathiasrw mathiasrw commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Closes #783

Stacked on #781.

Change

Code Meaning
0 Done. Warnings are ok.
1 Kept for a check that says no (#782).
2 One or more files gave an error, and the run went on.
3 The run stopped: a panic, any error with --halt, wrong flags or too few arguments.
  • yargs exits with 3 on wrong flags, from a .fail() handler. The help and the message on stderr are as before, and the stray empty line on stdout is gone.
  • Too few arguments shows the help and exits with 3. -h exits with 0, as before.
  • rr() in test/helper.js gives the same codes as the CLI.
  • The README has the table.

What breaks

An error in a file gives 2, and a panic or wrong flags give 3. Both were 1.

Tests

yarn test-ci passes: the demo on Node and Bun (now with exit codes 2 and 3), and 922 Bun tests. test/fix/783.test.js runs the CLI for each code. test/fix/692.test.js is back: it was deleted in #779 and not moved, so -version, -help, -V, -H, xversion, xhelp and where the help goes were not tested.

Base automatically changed from fix/720 to main October 23, 2026 08:30
@mathiasrw
mathiasrw marked this pull request as draft October 23, 2026 08:31
# Conflicts:
#	README.md
#	devguide.md
#	test/cli/debug.test.js
#	test/cli/delimiter.test.js
#	test/cli/glob-pipe.test.js
#	test/cli/run.sh
#	test/engine/encoding.test.js
#	test/engine/halt.test.js
#	test/fix/681.test.js
#	test/fix/683.test.js
#	test/fix/691.test.js
#	test/fix/700.test.js
#	test/fix/703.test.js
#	test/fix/708.test.js
#	test/fix/720.test.js
#	test/fix/728.test.js
#	test/fix/742.test.js
@mathiasrw
mathiasrw marked this pull request as ready for review October 23, 2026 08:33
@mathiasrw
mathiasrw merged commit 921b3b5 into main Oct 23, 2026
7 checks passed
@mathiasrw
mathiasrw deleted the fix/783 branch October 23, 2026 09:48
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.

Tell checks, errors and panics apart by exit code

1 participant