report
The report command analyzes a pre-generated coverage profile and evaluates policies. Use this when you have coverage data from a previous run or CI artifact.
coverctl report [flags]Configuration
Section titled “Configuration”| Flag | Description | Default |
|---|---|---|
-c, --config | Config file path | .coverctl.yaml |
-p, --profile | Coverage profile path | .cover/coverage.out |
-d, --domain | Filter to specific domain (repeatable) | all domains |
-o, --output | Output format: text, json, html | text |
Analysis Options
Section titled “Analysis Options”| Flag | Description |
|---|---|
--uncovered | Show only files with 0% coverage |
--diff <ref> | Show coverage for files changed since git ref |
--merge <profile> | Merge additional coverage profile (repeatable) |
--show-delta | Show coverage change from previous run |
--history | History file path for delta display |
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”# Analyze default profilecoverctl report
# Analyze specific profilecoverctl report -p coverage.outOutput Formats
Section titled “Output Formats”# JSON output for CI/parsingcoverctl report -o json
# HTML reportcoverctl report -o html > coverage.htmlFilter Files
Section titled “Filter Files”# Show only uncovered filescoverctl report --uncovered
# Show coverage for changed files onlycoverctl report --diff origin/mainMerge Profiles
Section titled “Merge Profiles”# Merge unit and integration profilescoverctl report --merge integration.out --merge e2e.outCoverage Delta
Section titled “Coverage Delta”# Show change from previous runcoverctl report --show-delta
# Use custom history filecoverctl report --show-delta --history .coverage-history.jsonOutput Formats
Section titled “Output Formats”Text (default)
Section titled “Text (default)”Domain Coverage Required Status─────────────────────────────────────core 87.3% 85% PASSapi 81.2% 80% PASScli 76.4% 75% PASS─────────────────────────────────────Overall 82.1% 75% PASS{ "passed": true, "domains": [ { "name": "core", "covered": 1234, "total": 1414, "percent": 87.3, "required": 85, "status": "pass" } ], "files": [ { "file": "internal/core/service.go", "covered": 45, "total": 50, "percent": 90.0 } ]}Generates a visual report with:
- Domain summary table
- Per-file coverage breakdown
- Color-coded status indicators
- Sortable columns
coverctl report -o html > coverage.htmlopen coverage.htmlUse Cases
Section titled “Use Cases”CI Artifact Analysis
Section titled “CI Artifact Analysis”# Download coverage artifactcurl -O https://ci.example.com/artifacts/coverage.out
# Analyze without running testscoverctl report -p coverage.out -o jsonDiff-Based Review
Section titled “Diff-Based Review”# Show coverage for files in PRcoverctl report --diff origin/main
# Combined with HTML outputcoverctl report --diff origin/main -o html > pr-coverage.htmlProfile Merging
Section titled “Profile Merging”When you have separate coverage profiles (unit, integration, e2e):
coverctl report \ -p unit.out \ --merge integration.out \ --merge e2e.outExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Report generated successfully |
1 | Policy violation detected |
2 | Invalid configuration or arguments |
3 | Profile parsing failed |
See Also
Section titled “See Also”- check - Run tests and check coverage
- Configuration - Policy configuration