Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asottile opened this issue Mar 11, 2020 · 3 comments · Fixed by #1128
Labels
enhancement New feature or request fixed
Milestone

Comments

@asottile
Copy link
Contributor

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

@asottile asottile added the enhancement New feature or request label Mar 11, 2020
@tolomea
Copy link

tolomea commented Nov 30, 2020

I think this enhancement I just suggested would greatly improve the situation for you #1065

@tolomea
Copy link

tolomea commented Nov 30, 2020

Out of curiosity I looked through your output, none of the branch reports there are adding useful information and they could all be omitted leaving 94, 102, 110, 120-121, 123-124, 160, 164, 184-185, 200, 202, 653, 680

@nedbat nedbat added this to the 5.next milestone Feb 28, 2021
nedbat added a commit that referenced this issue Feb 28, 2021
nedbat added a commit that referenced this issue Feb 28, 2021
@nedbat nedbat added the fixed label Feb 28, 2021
@nedbat
Copy link
Owner

nedbat commented Feb 28, 2021

This is now released as part of coverage 5.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants