You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pre-change CRAP gate: --gate-on-change flag (Group 2b) #268
Add a --gate-on-change flag to Gaze that computes CRAP scores only for functions modified in the current changeset, failing CI if any touched function has a CRAP score above the threshold.
Currently CRAP scores are computed for the entire codebase. The Boy Scout Rule demands that code you touch must meet quality standards, even if legacy code does not. This flag scopes enforcement to changed functions only.
Implementation
--gate-on-change Flag
Accepts a git ref or diff specification (e.g., --gate-on-change=origin/main)
Identifies functions modified in the diff
Computes CRAP scores only for those functions
Fails if any modified function exceeds the CRAP threshold
Reports which specific functions failed and their scores
Integration
Works with existing gaze CRAP computation
Compatible with CI pipelines (GitHub Actions, etc.)
JSON output includes a changed_functions section
Acceptance Criteria
--gate-on-change flag added to gaze
Correctly identifies functions modified in a changeset (git diff based)
Computes CRAP scores only for changed functions
Fails CI with clear output when changed functions exceed threshold
JSON output includes changed_functions section with per-function scores
Works with both staged changes and branch comparisons
Activity
feat: add --gate-on-change pre-change CRAP gate (unbound-force#268)
feat: add --gate-on-change pre-change CRAP gate (unbound-force#268)
feat: add --gate-on-change pre-change CRAP gate (unbound-force#268)
feat: add --gate-on-change pre-change CRAP gate (#268)