Add --min-grade flag for configurable CI gate threshold#74
Open
dmchaledev wants to merge 1 commit into
Open
Conversation
The exit-1 threshold was hardcoded to D/F. Teams enforcing stricter security posture (e.g. requiring B or above on every deployment) had no way to configure this without wrapping the tool. --min-grade accepts any valid grade (A+, A, B, C, D, F) and exits 1 when the report falls below it; the default preserves the existing D behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Enxu2FVQRw3oWQCQ1HtTnh
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
cli.ts:95), with no way to configure it--min-grade <grade>(acceptsA+,A,B,C,D,F); exits 1 when the report falls below the specified gradeD, preserving existing behavior for anyone who doesn't pass the flag--helpoutput and README CLI example to document the new optionBefore:
After:
Implementation
GRADE_ORDERarray (['A+', 'A', 'B', 'C', 'D', 'F']) encodes severity by index.gradeIndex()looks up the report grade and the threshold, and exits 1 when the report index exceeds the threshold index. An invalid--min-gradevalue prints a clear error and exits 1.The URL-detection filter is extended to skip the grade argument value so positional URL parsing stays correct regardless of flag order.
Test plan
npm test)--min-grade Bshould exit 0 for A/A+, exit 1 for B/C/D/F--min-grade A+should exit 1 for anything below A+--min-grade invalidshould print a clear error and exit 1--min-gradebehaves identically to the current D/F gate🤖 Generated with Claude Code
https://claude.ai/code/session_01Enxu2FVQRw3oWQCQ1HtTnh
Generated by Claude Code