Skip to content

Commit

Permalink
#567: Added report type: MarkdownSummaryGithub
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpalme committed Dec 8, 2022
1 parent a07f9b3 commit e223c26
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Explanations:
Target directory: The directory where the generated report should be saved.
Report types: The output formats and scope (separated by semicolon).
Values: Badges, Clover, Cobertura, CsvSummary,
MarkdownSummary, MarkdownDeltaSummary
MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary
Html, Html_Light, Html_Dark,
HtmlChart, HtmlInline, HtmlSummary,
HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Light, HtmlInline_AzurePipelines_Dark,
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
h.appendChild(s);
}
</script>
<script src="runtime.3a967657a38b0761.js" type="module"></script><script src="polyfills.9a22b7af111a7897.js" type="module"></script><script src="scripts.58e82174560aba06.js" defer></script><script src="main.021491a4ae3ce5c3.js" type="module"></script>
<script src="runtime.3a967657a38b0761.js" type="module"></script><script src="polyfills.9a22b7af111a7897.js" type="module"></script><script src="scripts.58e82174560aba06.js" defer></script><script src="main.09ab324871208d92.js" type="module"></script>
</body></html>
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
h.appendChild(s);
}
</script>
<script src="runtime.3a967657a38b0761.js" type="module"></script><script src="polyfills.9a22b7af111a7897.js" type="module"></script><script src="scripts.58e82174560aba06.js" defer></script><script src="main.021491a4ae3ce5c3.js" type="module"></script>
<script src="runtime.3a967657a38b0761.js" type="module"></script><script src="polyfills.9a22b7af111a7897.js" type="module"></script><script src="scripts.58e82174560aba06.js" defer></script><script src="main.09ab324871208d92.js" type="module"></script>
</body></html>

Large diffs are not rendered by default.

Binary file modified docs/resources/SampleReports.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/AzureDevopsTask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To learn how to use *ReportGenerator* have a look at the:
inputs:
reports: 'coverage.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved.
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary
sourcedirs: '' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution.
plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon).
Expand Down
2 changes: 1 addition & 1 deletion src/AzureDevopsTask/ReportGenerator/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"label": "Report types",
"defaultValue": "HtmlInline_AzurePipelines;Cobertura",
"required": false,
"helpMarkDown": "The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary"
"helpMarkDown": "The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary"
},
{
"name": "sourcedirs",
Expand Down
6 changes: 5 additions & 1 deletion src/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The following output formats are supported by ReportGenerator:
-TeamCitySummary
-TextSummary, TextDeltaSummary
-CsvSummary
-MarkdownSummary, MarkdownDeltaSummary
-MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary
-PngChart
-Badges
-Custom formats (https://github.com/danielpalme/ReportGenerator/wiki/Custom-reports)
Expand Down Expand Up @@ -67,6 +67,10 @@ For further details take a look at LICENSE.txt.

CHANGELOG

5.1.13.0

* New: #567: Added report type: MarkdownSummaryGithub

5.1.12.0

* Fix: #548: Improved handling of OverflowException
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/ReportGenerator.Core/Properties/ReportResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,7 @@
<data name="Previous" xml:space="preserve">
<value>Previous</value>
</data>
<data name="Branch" xml:space="preserve">
<value>Branch</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using Palmmedia.ReportGenerator.Core.Common;
using Palmmedia.ReportGenerator.Core.Licensing;
using Palmmedia.ReportGenerator.Core.Logging;
using Palmmedia.ReportGenerator.Core.Parser.Analysis;
using Palmmedia.ReportGenerator.Core.Properties;
Expand Down Expand Up @@ -92,6 +92,8 @@ public void CreateSummaryReport(SummaryResult summaryResult)

Logger.InfoFormat(Resources.WritingReportFile, targetPath);

bool proVersion = this.ReportContext.ReportConfiguration.License.DetermineLicenseType() == LicenseType.Pro;

using (var reportTextWriter = File.CreateText(targetPath))
{
HistoricCoverage previous = historicCoverages[0];
Expand All @@ -118,9 +120,17 @@ public void CreateSummaryReport(SummaryResult summaryResult)
reportTextWriter.WriteLine("| **{0}** | {1} |", ReportResources.BranchCoverage2, this.ReportCoverageQuota(previous.BranchCoverageQuota, current.BranchCoverageQuota));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.CoveredBranches2, this.ReportValues(previous.CoveredBranches, current.CoveredBranches));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.TotalBranches, this.ReportValues(previous.TotalBranches, current.TotalBranches));
reportTextWriter.WriteLine("| **{0}** | {1} |", ReportResources.CodeElementCoverageQuota2, this.ReportCoverageQuota(previous.CodeElementCoverageQuota, current.CodeElementCoverageQuota));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.CoveredCodeElements, this.ReportValues(previous.CoveredCodeElements, current.CoveredCodeElements));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.TotalCodeElements, this.ReportValues(previous.TotalCodeElements, current.TotalCodeElements));

if (proVersion)
{
reportTextWriter.WriteLine("| **{0}** | {1} |", ReportResources.CodeElementCoverageQuota2, this.ReportCoverageQuota(previous.CodeElementCoverageQuota, current.CodeElementCoverageQuota));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.CoveredCodeElements, this.ReportValues(previous.CoveredCodeElements, current.CoveredCodeElements));
reportTextWriter.WriteLine("| {0} | {1} |", ReportResources.TotalCodeElements, this.ReportValues(previous.TotalCodeElements, current.TotalCodeElements));
}
else
{
reportTextWriter.WriteLine("| **{0}** | [{1}](https://reportgenerator.io/pro) |", ReportResources.CodeElementCoverageQuota2, ReportResources.MethodCoverageProVersion);
}

reportTextWriter.Flush();
}
Expand Down
Loading

0 comments on commit e223c26

Please sign in to comment.