Topic
Step-by-step tutorial for setting up per-function CRAP regression detection using gaze's baseline comparison feature.
Target Audience
Go developers using gaze in CI pipelines who want to detect CRAP score regressions on every PR.
Suggested Structure
- Prerequisites: gaze installed, Go project with tests, CI pipeline (GitHub Actions)
- Create initial baseline: Run
gaze crap --format=json --coverprofile=coverage.out ./... > .gaze/baseline.json, commit to VCS
- CI integration: Add baseline comparison step to GitHub Actions workflow (auto-detection, no flags needed)
- Understanding output: Reading regression/improvement/new/removed classifications
- Tuning sensitivity: Adjusting epsilon and new-function threshold in
.gaze.yaml
- Refreshing the baseline: When and how to update the baseline (after releases, after intentional score changes)
- Troubleshooting: Common issues (stale baseline, config drift, function renames)
Prerequisites
- gaze v0.x.x+ (version with baseline comparison)
- Go 1.24+
- GitHub Actions (or equivalent CI)
PR Reference
unbound-force/gaze PR #120 (branch: opsx/baseline-comparison)
Topic
Step-by-step tutorial for setting up per-function CRAP regression detection using gaze's baseline comparison feature.
Target Audience
Go developers using gaze in CI pipelines who want to detect CRAP score regressions on every PR.
Suggested Structure
gaze crap --format=json --coverprofile=coverage.out ./... > .gaze/baseline.json, commit to VCS.gaze.yamlPrerequisites
PR Reference
unbound-force/gazePR #120 (branch:opsx/baseline-comparison)