tools icon indicating copy to clipboard operation
tools copied to clipboard

[coverage] Coverage v2

Open liamappelbe opened this issue 8 months ago • 0 comments

This is a collection of things I want to change in package:coverage v2.0.0. I'll add things as I think of them.

  • Delete all deprecated flags/params/functions
  • Simplify/unify the tools.
    • Are there any use cases for keeping collect_coverage, format_coverage, or run_and_collect, or are all use cases covered by test_with_coverage?
    • We should at least be able to merge format_coverage into the other tools.
  • There are several different ways of filtering coverage data by filename/package. Do we need all of them?
    • test_with_coverage runs the full workflow and only uses collect's scopedOutput.
    • The formatters have two more filtering options: reportOn and ignoreGlobs. I don't know of any legit use cases for these. reportOn does the same job as scopedOutput, and ignoreGlobs is a bit of a hack that's probably better handled by // coverage:ignore-file comments.
  • Merge collect's resume and waitPaused flags. For all known use cases they're either both true or both false, and merging them would let us remove some edge cases.
  • Wrap the Map<String, HitMap> type in a class (CoverageData?)
  • collect should return CoverageData, rather than converting it to JSON. CoverageData should be the canonical representation. Conversion to JSON should be a separate step.
  • Change the ignoredLines variables from List<List<int>> to List<Range>
  • Remove line ignoring from the json parser functions
    • Actually, if we don't have a separate format tool, then we probably don't need the JSON parser
    • Are there any use cases for the JSON format at all? Or does everyone just use lcov?

liamappelbe avatar Jul 09 '25 01:07 liamappelbe