Skip to content

[anecdotal/opinion] report: interspersed branch / uncovered lines are much less readable than 4.x era #955

Closed
@asottile

Description

@asottile

in coverage 5.x (or at least, that's when I noticed it) the missing branches are now interspersed with missing lines in the coverage report terminal display

Here's an example:

babi/highlight.py              389     15    116     11    93%   93->94, 94, 101->102, 102, 109->110, 110, 119->120, 120-121, 122->123, 123-124, 159->160, 160, 163->164, 164, 184-185, 199->200, 200, 201->202, 202, 652->653, 653, 679->680, 680

prior to coverage 5, the output looked like this:

babi/highlight.py              389     15    116     11    93%   94, 102, 110, 120-121, 123-124, 160, 164, 184-185, 200, 202, 653, 680, 93->94, 101->102, 109->110, 119->120, 122->123, 159->160, 163->164, 199->200, 201->202, 652->653, 679->680

I prefer the older output because:

  • when I am looking to increase coverage, I'm first going to try and increase the line coverage. This will always necessarily increase the branch coverage as well
  • with branches and lines interspersed, it is difficult to see at a glance what the next line to fix is (this is especially difficult when ##-## looks very much like ##->##)

A hacky, and far-from-perfect workaround that I'm using right now is coverage report | sed -r 's/[0-9]+->[0-9]+//g;s/,( ,)+/,/g' which (mostly) hides the missed branches until I'm ready to work on the missing branch coverage

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions