mozilla / grcov

Rust tool to collect and aggregate code coverage data for multiple source files
Mozilla Public License 2.0
1.17k stars 148 forks source link

Request: markdown output alphabetically order files #1057

Closed hsdk123 closed 10 months ago

hsdk123 commented 1 year ago

Hi, when choosing the markdown output, I get output like the below:

| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/80.Obj/Sprite/Basic/NSprite.h                                                              | 0.00%    | 0 / 6      | 15-33                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/81.Components/Terrain/Terrain_save.cpp                                                     | 40.00%   | 2 / 5      | 26-35                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/88.Managers/BufferMgr/BufferMgr.cpp                                                        | 50.00%   | 4 / 8      | 79-87                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/88.Managers/TweenMgr/Tween/TweenInfo.h                                                     | 0.00%    | 0 / 3      | 162-175                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/88.Managers/TweenMgr/Tween/TweenInfo_save.cpp                                              | 76.92%   | 30 / 39    | 82-84, 88-90, 94-96                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| C:/Users/daego/Desktop/Projects/Light.vn-core/core/src/Code/80.Obj/Empty/NEmpty.h                                                                      | 0.00%    | 0 / 6      | 10-41                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

As you can see, the files seem to come out in random order, whereas it would be much easier to read if the filenames were alphabetically ordered.

marco-c commented 1 year ago

Sounds like a good idea, PRs welcome!

zax-xyz commented 1 year ago

Should this be just for Markdown output? Seems like it would make sense in general for all output types. Happy to put in a PR for this

marco-c commented 1 year ago

@zaxutic markdown is the only "human readable", so it makes the most sense for that one. It definitely doesn't hurt implementing it for all output types though!

zax-xyz commented 1 year ago

markdown is the only "human readable", so it makes the most sense for that one

Yeah that makes sense, although one could argue it's not the only "human readable" format (files is one that comes to mind), but that's probably not the intended purpose as much as it is for markdown haha

It definitely doesn't hurt implementing it for all output types though!

Alright, it's fairly trivial to implement for all of them instead of just one, since we can just sort the results before passing it to any of the format-specific handlers, so I'll probably do that then 😄