Repository navigation
fix(cli): reject --fail-under outside 0 to 100 with exit 2 (#1037) - #1053
Merged
Merged
Conversation
Signed-off-by: minutechreview <141821420+minutechreview@users.noreply.github.com>
minutechreview
requested review from
Shreyash0712,
ahmdkaml and
yakew7
as code owners
October 17, 2026 13:37
Contributor
|
@minutechreview is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@yakew7 @Shreyash0712 @ahmdkaml - new PR touching a path you own, please review. |
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.
Summary
faircode profile --fail-under Naccepted any number. The score is 0 to 100, so--fail-under 150failed every run and--fail-under -5could never fail, which turns a CI gate off without a warning.Now a value outside 0 to 100 (also
nanandinf) exits 2 with:The check runs at the start of
profile, next to the existing--proxy-alpharange check, before the dataset is read. 0 and 100 stay valid.faircode/cli.py: the range checkfaircode/SPEC.md: a paragraph in section 5 about the gate and its rangeREADME.md: one sentence in the CI paragraphtests/test_cli.py: six bad values exit 2 with the message and print nothing to stdout; 0 and 100 still workType
Linked issue
Closes #1037
Checks:
pytest tests --ignore=tests/browsergives 818 passed, 21 skipped.ruff check faircode tests scripts,scripts/check_em_dash.pyandscripts/check_broken_links.pypass.