Parent Epic: #85
Overview
Add code coverage validation to the pre-commit script (scripts/pre-commit.sh) as the last check in the steps array. The check uses the cargo cov-check alias which validates that coverage meets the 85% threshold and will fail the pre-commit if coverage drops below this level.
Goals
Specifications
Current Pre-commit Structure
The scripts/pre-commit.sh script uses a step-based execution model with an array of checks. Each step follows the format:
"description|success_message|optional_pre_message|optional_env_var|command"
Proposed Change
Add coverage check as the last step in the STEPS array:
"Running code coverage check|Coverage meets 85% threshold|(Informational only - does not block commits)||cargo cov-check"
Why This Approach?
Advantages:
- ✅ Consistent: Follows existing script patterns
- ✅ Simple: Just one line added to the array
- ✅ Maintainable: No special-case logic needed
- ✅ Clear: Uses same messaging format as other steps
- ✅ Automatic timing: Built-in timing display like other steps
Behavior:
- Runs last after all other checks pass
- Still fails fast if coverage is below 85% (exits with non-zero code)
- Shows clear error message from
cargo cov-check
- Uses existing error handling and timing infrastructure
Implementation Plan
Phase 1: Add Coverage Step (5 minutes)
"Running code coverage check|Coverage meets 85% threshold|(Informational only - does not block commits)||cargo cov-check"
Phase 2: Testing (10 minutes)
Acceptance Criteria
Notes
- Running coverage last ensures developers don't waste time waiting for coverage if linting fails
- The coverage check will fail fast and block commits if coverage drops below 85%
Parent Epic: #85
Overview
Add code coverage validation to the pre-commit script (
scripts/pre-commit.sh) as the last check in the steps array. The check uses thecargo cov-checkalias which validates that coverage meets the 85% threshold and will fail the pre-commit if coverage drops below this level.Goals
Specifications
Current Pre-commit Structure
The
scripts/pre-commit.shscript uses a step-based execution model with an array of checks. Each step follows the format:"description|success_message|optional_pre_message|optional_env_var|command"Proposed Change
Add coverage check as the last step in the
STEPSarray:"Running code coverage check|Coverage meets 85% threshold|(Informational only - does not block commits)||cargo cov-check"Why This Approach?
Advantages:
Behavior:
cargo cov-checkImplementation Plan
Phase 1: Add Coverage Step (5 minutes)
scripts/pre-commit.shdeclare -a STEPS=()array"Running code coverage check|Coverage meets 85% threshold|(Informational only - does not block commits)||cargo cov-check"Phase 2: Testing (10 minutes)
./scripts/pre-commit.shon current codebase (coverage should pass at 85.75%)cargo cov-checkAcceptance Criteria
STEPSarray inscripts/pre-commit.shcargo cov-checkalias (already exists in.cargo/config.toml)Notes