This example shows how to aggregate confidence scores from multiple sources into a single report.
# Make executable
chmod +x aggregate.sh
# Run aggregation
./aggregate.sh
# Generate badge
confvis generate -c confidence.json -o ./badgesThe aggregate.sh script:
- Collects test coverage using
go test -cover - Runs linting with
golangci-lint - Runs security scans with
gosec(if installed) - Calculates weighted average with configurable weights
- Outputs
confidence.jsonready for confvis
Edit the script to:
- Add/remove metric sources
- Adjust weights for each factor
- Change scoring formulas
- Add other language tools (Jest, pytest, ESLint, etc.)
Default weights:
- Test Coverage: 40%
- Lint Score: 35%
- Security Scan: 25%
Modify the OVERALL calculation line to change weights.
Add to your CI pipeline after running tests:
- name: Aggregate metrics
run: ./examples/multi-source/aggregate.sh
- name: Generate badge
run: confvis generate -c confidence.json -o ./badges