danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.63k stars 283 forks source link

Markdown - collapsing lines #567

Closed leahy268 closed 1 year ago

leahy268 commented 1 year ago

Hi,

I have been using your report generator for GitHub action. Which works wonderfully thank you.

However I would love to be able to collapse the lines in Markdown. It would make it much more readable.

See below:

ComponentLibrary

ComponentLibrary,Function1

ComponentLibrary.Function2

danielpalme commented 1 year ago

Looks great here on GitHub. But I'm not sure how other Markdown parsers will handle those custom elements.

leahy268 commented 1 year ago

Unfortunately at the moment the default MarkDown is unusable as currently the lines are far too wide for gitHub to handle. This means for users to actually see the full comment they have to kind of click on a line and drag to the right to see the actual coverage and then drag back.

image

danielpalme commented 1 year ago

Since the current MarkdownSummary is to wide for GitHub, I plan to implement a new report type named MarkdownSummaryGithub. This report has fewer columns and long class names a splitted into several lines.

Here's a sample with my current implemenation. What do you think?

Summary

Summary ||| |:---|:---| | Generated on: | 08.12.2022 - 23:07:56 | | Parser: | OpenCover | | Assemblies: | 1 | | Classes: | 17 | | Files: | 15 | | **Line coverage:** | 63.6% (121 of 190) | | Covered lines: | 121 | | Uncovered lines: | 69 | | Coverable lines: | 190 | | Total lines: | 508 | | **Branch coverage:** | 62.5% (5 of 8) | | Covered branches: | 5 | | Total branches: | 8 | | **Method coverage:** | 57.6% (30 of 52) | | Covered methods: | 30 | | Total methods: | 52 |

Coverage

Assembly 1 - 63.6% |**Name**|**Line**|**Branch**|**Method**| |:---|---:|---:|---:| |**Assembly 1**|**63.6%**|**62.5%**|**57.6%**| |Test.AbstractClass|100%||100%| |Test.AbstractClass_SampleImpl1|50%||33.3%| |Test.AbstractClass_SampleImpl2|50%||33.3%| |Test.AbstractGenericClass`2|0%||0%| |Test.AnalyzerTestClass|0%||0%| |Test.AsyncClass|100%||100%| |Test.ClassWithExcludes|100%||100%| |Test.CodeContract_Contract|0%||0%| |Test.CodeContract_Target|100%|100%|100%| |Test.GenericClass`2|100%||100%| |Test.PartialClass|54.5%|50%|50%| |Test.PartialClassWithAutoProperties|66.6%||80%| |Test.Program|79.5%||66.6%| |Test.SomeClass|100%||100%| |Test.SomeModel|||| |Test.TestClass|57.1%|50%|50%| |Test.TestClass2|63.1%|50%|60%| |Test.TestClassWithAVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVer
yLongLongName|63.1%|50%|60%|
Assembly 2 - 63.6% |**Name**|**Line**|**Branch**|**Method**| |:---|---:|---:|---:| |**Assembly 2**|**63.6%**|**62.5%**|**57.6%**| |Test.AbstractClass|100%||100%| |Test.AbstractClass_SampleImpl1|50%||33.3%| |Test.AbstractClass_SampleImpl2|50%||33.3%| |Test.AbstractGenericClass`2|0%||0%| |Test.AnalyzerTestClass|0%||0%| |Test.AsyncClass|100%||100%| |Test.ClassWithExcludes|100%||100%| |Test.CodeContract_Contract|0%||0%| |Test.CodeContract_Target|100%|100%|100%| |Test.GenericClass`2|100%||100%| |Test.PartialClass|54.5%|50%|50%| |Test.PartialClassWithAutoProperties|66.6%||80%| |Test.Program|79.5%||66.6%| |Test.SomeClass|100%||100%| |Test.SomeModel|||| |Test.TestClass|57.1%|50%|50%| |Test.TestClass2|63.1%|50%|60%| |Test.TestClassWithAVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVer
yLongLongName|63.1%|50%|60%|
leahy268 commented 1 year ago

That looks heaps better.. When can I start using it 😊

danielpalme commented 1 year ago

The next release will contain the new report type.

I will let you know once it's published.

EricStG commented 1 year ago

Will there be a Delta version of this, similar to MarkdownDeltaSummary?

danielpalme commented 1 year ago

Will there be a Delta version of this, similar to MarkdownDeltaSummary?

I don't think that this is necessary. The MarkdownDeltaSummary report contains very limited information. No need to collapse anything.

Here a sample report:

Delta Summary

Generated on: 08.12.2022 - 23:25
Description Previous Current Delta
Coverage date: 09.02.2022 - 20:50 08.12.2022 - 23:25
Line coverage: 58.4% 66.4% 8.0%
Covered lines: 73 83 10
Coverable lines: 125 125 0
Total lines: 260 260 0
Branch coverage: 45% 50% 5%
Covered branches: 27 3 -24
Total branches: 60 6 -54
Method coverage: 66.6% 58.3% -8.3%
Covered methods: 16 14 -2
Total methods: 24 24 0
danielpalme commented 1 year ago

Release 5.1.13 has been published.