Spot untested code like a pro with CoverOps — your go-to coverage companion for any project.
CoverOps is a powerful, cross-platform CLI tool that helps you track test coverage on new or modified code. By combining Git diffs with LCOV or JSON coverage reports, it generates insightful HTML, JSON, and console reports that highlight what’s tested — and what’s not. Whether you’re building in Dart, Python, JavaScript, or anything else, CoverOps keeps your code accountable and clean.
- ✅ Track New Code – Pinpoints untested lines in changed or newly added code.
- 🔎 Cross-language Coverage – Supports any project using Git with LCOV or JSON coverage files.
- 🌐 Multiple Report Formats – Generates HTML, JSON, and console summaries.
- ⚡ Lightweight & Fast – Built with performance in mind.
- 🧩 Plug & Play – Use it directly or integrate into your CI pipeline.
- 🛠️ Configurable – Use a JSON config file to simplify complex commands.
CoverOps highlights what’s tested — and what’s not — in your changed code.
Screen.Recording.2025-05-16.at.11.23.21.PM.mov
✅ Green = Covered lines in changed code ❌ Red = Missed lines in changed code 📄 Grey = Unchanged or ignored lines
- Track test coverage of only new or modified code.
- Works across languages (Dart, Python, JS, etc.).
- Easy-to-read, linkable HTML reports, machine-readable JSON, and quick console summaries.
- Supports multiple output formats:
html
,json
,console
— or even all three at once. - Use a JSON config file for easy setup and reuse.
- Quick Start
- What You Need
- Installation
- Commands
- Report Types
- Usage Example
- Script It Up
- Contributing
- License
- Get in Touch
# Clone the repo
git clone https://github.com/kannel-outis/CoverOps.git
cd CoverOps
# Run coverage analysis
cover report --lcov=coverage/lcov.info --target-branch=main --source-branch=HEAD --output=coverage --report-format=html,console
# Or use a config file
cover report --config=config/coverops.json
# Open the HTML report
open file://$(pwd)/coverage/lcov_html/index.html
- Git: Required to detect changed files.
- Coverage File: LCOV (
lcov.info
) or JSON (coverage-final.json
) from tools likelcov
,coverage.py
, orjest
. - Optional – Dart SDK: Only if you want to run it via
dart run
. Not required when using platform executables inbin/
.
If your bin/
folder already contains the appropriate cover
binary for your platform, just run:
./install.sh # or (bash ./install.sh or zsh ./install.sh) to specify shell
This will:
- Ensure the
bin/
folder exists, - Add it to your shell’s PATH (e.g.,
.bashrc
,.zshrc
,.bash_profile
), - Let you run
cover
from anywhere in your terminal.
After that, reload your shell:
source ~/.bashrc # or ~/.zshrc or ~/.bash_profile
Now you can run:
cover --help # or cover -h
Want to build from source? Run:
./install.sh --build
This will:
- Detect your OS (Linux, macOS, or Windows),
- Build the
cover
binary using Dart, - Set up your
bin/
directory for easy access.
Make sure the Dart SDK is installed and in your PATH
. Get it here: https://dart.dev/get-dart
Analyze code changes between branches.
cover git --target-branch=main --source-branch=feature-branch --output-dir=coverage
Process LCOV or JSON coverage files and match against Git diff data.
cover lcov --lcov=coverage/lcov.info --gitParserFile=coverage/.gitparser.json --output=coverage
Runs both git
and lcov
commands in one go.
cover report --lcov=coverage/lcov.info --target-branch=main --source-branch=feature-branch --output=coverage
You can also pass a config file instead of CLI arguments:
cover report --config=config/coverops.json
CoverOps supports multiple report formats, which can be combined with a comma-separated list.
Format | Description |
---|---|
html |
Fully styled, browsable report with annotations |
json |
Structured, CI/CD-ready output |
console |
Human-readable summary printed to stdout |
# Single format
cover report --report-format=html
# Multiple formats
cover report --report-format=html,console,json
Default format is html
if none is specified.
You can simplify command-line usage by placing arguments in a config file:
cover report --config=config/coverops.json
{
"lcov": "coverage/lcov.info"
"targetBranch": "main"
"sourceBranch": "HEAD"
"output": "coverage"
"reportFormat": ["html","console"]
}
Use this in scripts or CI for consistency and clarity.
For different project types:
flutter test --coverage
lcov --remove coverage/lcov.info '*.g.dart' '*.part.dart' -o coverage/lcov.info
cover report --lcov=coverage/lcov.info --target-branch=main --output=coverage --report-format=html,console
pytest --cov=src --cov-report=lcov:coverage/lcov.info
cover report --lcov=coverage/lcov.info --target-branch=main --output=coverage --report-format=html
jest --coverage --coverageReporters=json
cover report --lcov=coverage/coverage-final.json --target-branch=main --output=coverage --report-format=console
Want to automate the workflow? Here's a generic script example for any project type:
#!/bin/bash
# run_coverops.sh
# Optional: Ensure coverage directory is ignored
item="coverage/"
if [ ! -f .gitignore ] || ! grep -q "^$item" .gitignore; then
echo "$item" >> .gitignore
echo "Added '$item' to .gitignore"
fi
# Run your own coverage command here
echo "Run your test suite and generate LCOV/JSON coverage..."
# Example: pytest --cov=src --cov-report=lcov:coverage/lcov.info
# Option 1: CLI flags
cover report --lcov=coverage/lcov.info --target-branch=main --source-branch=HEAD --output=coverage --report-format=html,console,json
# Option 2: Config file
# cover report --config=config/coverops.yaml
# Open the HTML report
report_path="coverage/lcov_html/index.html"
if [ -f "$report_path" ]; then
echo "Coverage report generated at: file://$PWD/$report_path"
read -p "Open report in browser? (y/n): " choice
if [[ "$choice" == "y" ]]; then
open "file://$PWD/$report_path"
fi
else
echo "Report not found at $report_path"
fi
Make executable:
chmod +x run_coverops.sh
./run_coverops.sh
We welcome contributions of all kinds!
- Fork the repo
- Create a feature branch
- Use Conventional Commits
- Test your changes
- Submit a pull request
CoverOps is licensed under the MIT License.
- GitHub Issues
- Maintainer: kannel-outis
CoverOps helps you keep your codebase covered, clean, and deployment-ready. 💪