We absorbed simplecov-html and simplecov_json_formatter into the gem. The three formats that downstream tools actually consume are still third-party gems.
- LCOV is the lingua franca. Coveralls, Codecov,
genhtml, and the Coverage Gutters extension for VS Code all read it.
- Cobertura XML is what Jenkins, GitLab, and Azure Pipelines ingest.
- SARIF puts uncovered lines into GitHub code scanning, which is how they get annotated on the diff without a bot account posting comments.
Each one is a few hundred lines against SourceFile and a fixture-based spec, and each replaces a dependency that projects carry for no reason other than getting their numbers into a service. Bundling them also means the formats stay correct when the resultset shape changes, which is not true of a formatter gem that nobody has touched since branch coverage landed.
The related cheap win is --annotate github on simplecov uncovered, emitting ::warning file=lib/foo.rb,line=41::Line not covered. That gets inline diff annotations in a plain workflow with no upload step and no code scanning permissions.
Prior art for bundling rather than farming out: go tool cover writes its own profile format and coverage.py ships xml, lcov, json, and html in the box.
We absorbed
simplecov-htmlandsimplecov_json_formatterinto the gem. The three formats that downstream tools actually consume are still third-party gems.genhtml, and the Coverage Gutters extension for VS Code all read it.Each one is a few hundred lines against
SourceFileand a fixture-based spec, and each replaces a dependency that projects carry for no reason other than getting their numbers into a service. Bundling them also means the formats stay correct when the resultset shape changes, which is not true of a formatter gem that nobody has touched since branch coverage landed.The related cheap win is
--annotate githubonsimplecov uncovered, emitting::warning file=lib/foo.rb,line=41::Line not covered. That gets inline diff annotations in a plain workflow with no upload step and no code scanning permissions.Prior art for bundling rather than farming out:
go tool coverwrites its own profile format andcoverage.pyshipsxml,lcov,json, andhtmlin the box.