fix(cli): validate option values instead of dropping bad ones#874
Merged
Conversation
The numeric settings are compared with [ -lt ], which errors instead of
returning false on a non-integer operand. Nothing validated them, so:
--jobs abc hung on Bash 3.x (the job-slot poll never reached
its break) and was ignored on Bash 4.3+
--coverage-min abc leaked '[: abc: integer expression expected' and
still exited 0, so the threshold went unenforced
--retry/-timeout silently dropped
--output nonsense silently fell back to the default renderer
Validation runs once on the resolved configuration, after flag parsing,
so it covers the BASHUNIT_* environment variables that bypass the parser
as well as the flags.
Closes #873
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #873
The numeric settings are compared with
[ -lt ], which errors instead of returningfalse on a non-integer operand, and nothing validated them.
--jobs abchung onthe Bash macOS ships (the job-slot poll never reached its
break) and was silentlyignored on Bash 4.3+.
--coverage-min abcleaked a raw shell error and still exited0, so a CI job reported success without enforcing its threshold.💡 Changes
--jobs,--retry,--test-timeoutand--coverage-min, and an unsupported--outputformat, with a message naming the setting and a non-zero exitBASHUNIT_*environment variables that bypass the parser are covered by the same gate--jobs auto,--output tapand valid numbers still work