gocovsh icon indicating copy to clipboard operation
gocovsh copied to clipboard

Allow sorting files list by coverage

Open orlangure opened this issue 3 years ago • 7 comments

For larger projects, it might be useful to support sorting the entries in the list by their total coverage. Another potentially useful mode could be sorting by the number of non-covered statements: show the files with the most potential improvements to make first.

orlangure avatar Feb 19 '22 19:02 orlangure

@EwenQuim, this is the original issue I opened a while ago to remember this feature.

Answering your question in #30: no, there is no specific timeline, things move as soon as I (or other people) have time to work on them. I'd like to make incremental releases every 1-3 months, but it is not always possible 😼

I'm not closing this issue yet, because there is still work to do here: testing, in-program sorting mode toggle, ability to sort by the number of statements instead of total coverage, etc.

Please let me know if you wish to work on this in the near future. If yes, I'll work on something else. Otherwise, I'll take it from here 😼

orlangure avatar Jun 08 '22 18:06 orlangure

I can't work on it this week or the next one, but maybe in a few weeks

EwenQuim avatar Jun 10 '22 10:06 EwenQuim

Has anyone been working on this? I was thinking of implementing sort by coverage %. Have two options ASC / DSC.

aidanmatchette avatar Feb 25 '23 20:02 aidanmatchette

Hi @aidanmatchette, sorting by coverage percentage was already implemented before in #30, but:

  • there is no choice between asc/desc
  • sorting only works based on percentage, not statements number
  • there is no in-program toggle (like ? button toggles different help modes)

Would you like to start working on some or all of the above? Your help would be appreciated 😼

orlangure avatar Feb 25 '23 22:02 orlangure

Hey @orlangure, I am new to Go and really like this project. I was looking at the code base and saw that there was some sorting implemented. I think it would be a cool feature to have a toggle similar to ? that will toggle ascending or descending based on percentages. I would love to try to implement this. Probably will need some support as this will be the largest Go project I have worked on.

aidanmatchette avatar Feb 25 '23 22:02 aidanmatchette

#42 @orlangure Please check out my PR for the my initial solution. I would love to get your feedback and some tips on next steps. Thanks!

aidanmatchette avatar Feb 26 '23 04:02 aidanmatchette

@orlangure Made some updates based on your suggestions. Made a PR. Please check it out. Thanks!

aidanmatchette avatar Feb 27 '23 18:02 aidanmatchette