Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Dec 9, 2022
2 parents 3ba5383 + e5a4643 commit 4db42b8
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 36 deletions.
7 changes: 5 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ updates:
ignore:
- dependency-name: Cake.Core
versions:
- "> 1.0.0, < 2"
- "(,3.0)"
- dependency-name: Cake.Testing
versions:
- "> 1.0.0, < 2"
- "(,3.0)"
- dependency-name: Cake.Issues
versions:
- "> 1.0.0, < 2"
- dependency-name: Cake.Issues.Testing
versions:
- "> 1.0.0, < 2"
14 changes: 10 additions & 4 deletions nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The addin requires Cake Frosting 1.2.0 or higher.
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Reporting.Console.git"/>
<copyright>Copyright © Pascal Berger</copyright>
<tags>cake cake-addin cake-issues cake-reportformat issues reporting console</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/1.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/2.0.0</releaseNotes>
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Cake.Core" version="[1.2,2.0)" exclude="Build,Analyzers" />
Expand All @@ -40,8 +40,14 @@ The addin requires Cake Frosting 1.2.0 or higher.
</metadata>
<files>
<file src="icon.png" target="" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netstandard2.0\Cake.Issues.Reporting.Console.dll" target="lib\netstandard2.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netstandard2.0\Cake.Issues.Reporting.Console.pdb" target="lib\netstandard2.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netstandard2.0\Cake.Issues.Reporting.Console.xml" target="lib\netstandard2.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netcoreapp3.1\Cake.Issues.Reporting.Console.dll" target="lib\netcoreapp3.1" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netcoreapp3.1\Cake.Issues.Reporting.Console.pdb" target="lib\netcoreapp3.1" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\netcoreapp3.1\Cake.Issues.Reporting.Console.xml" target="lib\netcoreapp3.1" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net5.0\Cake.Issues.Reporting.Console.dll" target="lib\net5.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net5.0\Cake.Issues.Reporting.Console.pdb" target="lib\net5.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net5.0\Cake.Issues.Reporting.Console.xml" target="lib\net5.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net6.0\Cake.Issues.Reporting.Console.dll" target="lib\net6.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net6.0\Cake.Issues.Reporting.Console.pdb" target="lib\net6.0" />
<file src="..\..\src\Cake.Issues.Reporting.Console\bin\Release\net6.0\Cake.Issues.Reporting.Console.xml" target="lib\net6.0" />
</files>
</package>
18 changes: 13 additions & 5 deletions nuspec/nuget/Cake.Issues.Reporting.Console.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ The addin requires Cake 1.2.0 or higher.
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Reporting.Console.git"/>
<copyright>Copyright © Pascal Berger</copyright>
<tags>cake cake-addin cake-issues cake-reportformat issues reporting console</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/1.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/2.0.0</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
<file src="netstandard2.0/Cake.Issues.Reporting.Console.dll" target="lib\netstandard2.0" />
<file src="netstandard2.0/Cake.Issues.Reporting.Console.pdb" target="lib\netstandard2.0" />
<file src="netstandard2.0/Cake.Issues.Reporting.Console.xml" target="lib\netstandard2.0" />
<file src="netstandard2.0/Errata.dll" target="lib\netstandard2.0" />
<file src="netcoreapp3.1/Cake.Issues.Reporting.Console.dll" target="lib\netcoreapp3.1" />
<file src="netcoreapp3.1/Cake.Issues.Reporting.Console.pdb" target="lib\netcoreapp3.1" />
<file src="netcoreapp3.1/Cake.Issues.Reporting.Console.xml" target="lib\netcoreapp3.1" />
<file src="netcoreapp3.1/Errata.dll" target="lib\netcoreapp3.1" />
<file src="net5.0/Cake.Issues.Reporting.Console.dll" target="lib\net5.0" />
<file src="net5.0/Cake.Issues.Reporting.Console.pdb" target="lib\net5.0" />
<file src="net5.0/Cake.Issues.Reporting.Console.xml" target="lib\net5.0" />
<file src="net5.0/Errata.dll" target="lib\net5.0" />
<file src="net6.0/Cake.Issues.Reporting.Console.dll" target="lib\net6.0" />
<file src="net6.0/Cake.Issues.Reporting.Console.pdb" target="lib\net6.0" />
<file src="net6.0/Cake.Issues.Reporting.Console.xml" target="lib\net6.0" />
<file src="net6.0/Errata.dll" target="lib\net6.0" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Issues">
<Version>1.0.0</Version>
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Cake.Issues.Reporting">
<Version>1.0.0</Version>
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Cake.Issues.Testing">
<Version>1.0.0</Version>
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Cake.Testing">
<Version>1.2.0</Version>
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Shouldly">
<Version>4.0.3</Version>
Expand All @@ -48,12 +48,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="xunit">
<Version>2.4.1</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.3</Version>
<Version>2.4.5</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
using Cake.Issues.Testing;
using Cake.Testing;
using System.Collections.Generic;
using System.Linq;
using Xunit;

public sealed class ConsoleIssueReportGeneratorTests
Expand Down Expand Up @@ -37,14 +39,62 @@ public void Should_Throw_If_Settings_Are_Null()

public sealed class TheInternalCreateReportMethod
{
[Fact]
public void Should_Generate_Report()
public static IEnumerable<object[]> ReportFormatSettingsCombinations =>
from b1 in new[] { false, true }
from b2 in new[] { false, true }
from b3 in new[] { false, true }
from b4 in new[] { false, true }
from b5 in new[] { false, true }
select new object[] { b1, b2, b3, b4, b5 };

[Theory]
[MemberData(nameof(ReportFormatSettingsCombinations))]
public void Should_Generate_Report(
bool showDiagnostics,
bool compact,
bool groupByRule,
bool showProviderSummary,
bool showPrioritySummary)
{
// Given
var fixture = new ConsoleIssueReportFixture();
fixture.ConsoleIssueReportFormatSettings.ShowDiagnostics = showDiagnostics;
fixture.ConsoleIssueReportFormatSettings.Compact = compact;
fixture.ConsoleIssueReportFormatSettings.GroupByRule = groupByRule;
fixture.ConsoleIssueReportFormatSettings.ShowProviderSummary = showProviderSummary;
fixture.ConsoleIssueReportFormatSettings.ShowPrioritySummary = showPrioritySummary;

// When
var logContents =
fixture.CreateReport(
"Testfiles.issues.json",
@"c:\Source\Cake.Issues.Reporting.Console");

// Then
}

[Theory]
[MemberData(nameof(ReportFormatSettingsCombinations))]
public void Should_Generate_Report_With_No_Issues(
bool showDiagnostics,
bool compact,
bool groupByRule,
bool showProviderSummary,
bool showPrioritySummary)
{
// Given
var fixture = new ConsoleIssueReportFixture();
fixture.ConsoleIssueReportFormatSettings.ShowDiagnostics = showDiagnostics;
fixture.ConsoleIssueReportFormatSettings.Compact = compact;
fixture.ConsoleIssueReportFormatSettings.GroupByRule = groupByRule;
fixture.ConsoleIssueReportFormatSettings.ShowProviderSummary = showProviderSummary;
fixture.ConsoleIssueReportFormatSettings.ShowPrioritySummary = showPrioritySummary;

// When
var logContents = fixture.CreateReport("Testfiles.issues.json", @"c:\Source\Cake.Issues.Reporting.Console");
var logContents =
fixture.CreateReport(
new List<IIssue>(),
@"c:\Source\Cake.Issues.Reporting.Console");

// Then
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<Description>Support for reporting issues to the console for the Cake.Issues addin for Cake Build Automation System</Description>
<Authors>Pascal Berger</Authors>
<Product>Cake.Issues</Product>
Expand All @@ -29,9 +29,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="1.2.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues.Reporting" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Core" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues.Reporting" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Errata" Version="0.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -42,4 +42,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
</Project>
18 changes: 12 additions & 6 deletions src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override FilePath InternalCreateReport(IEnumerable<IIssue> issues)

if (this.consoleIssueReportFormatSettings.GroupByRule)
{
foreach (var issueGroup in diagnosticIssues.GroupBy(x => x.Rule))
foreach (var issueGroup in diagnosticIssues.GroupBy(x => x.RuleId))
{
report.AddDiagnostic(new IssueDiagnostic(issueGroup));
}
Expand Down Expand Up @@ -89,10 +89,16 @@ protected override FilePath InternalCreateReport(IEnumerable<IIssue> issues)
/// <param name="issues">List of issues.</param>
private void PrintSummary(IEnumerable<IIssue> issues)
{
if (!issues.Any())
{
AnsiConsole.WriteLine("No issues");
return;
}

AnsiConsole.WriteLine();
AnsiConsole.WriteLine();
var rule = new Rule("Summary").Centered();
AnsiConsole.Render(rule);
AnsiConsole.Write(rule);
AnsiConsole.WriteLine();

var providerChart = new BarChart();
Expand Down Expand Up @@ -142,18 +148,18 @@ private void PrintSummary(IEnumerable<IIssue> issues)

if (this.consoleIssueReportFormatSettings.ShowProviderSummary)
{
AnsiConsole.Render(new Markup("[bold]Issues per provider & run[/]").Centered());
AnsiConsole.Write(new Markup("[bold]Issues per provider & run[/]").Centered());
AnsiConsole.WriteLine();
AnsiConsole.WriteLine();
AnsiConsole.Render(providerChart);
AnsiConsole.Write(providerChart);
AnsiConsole.WriteLine();
}

if (this.consoleIssueReportFormatSettings.ShowPrioritySummary)
{
AnsiConsole.Render(new Markup("[bold]Issues per priority[/]").Centered());
AnsiConsole.Write(new Markup("[bold]Issues per priority[/]").Centered());
AnsiConsole.WriteLine();
AnsiConsole.Render(priorityTable);
AnsiConsole.Write(priorityTable);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public IssueDiagnostic(IIssue issue)
/// </summary>
/// <param name="issues">Issues which the diagnostic should describe.</param>
public IssueDiagnostic(IEnumerable<IIssue> issues)
: base(issues.First().Rule)
: base(issues.First().RuleId)
{
this.issues = issues;

Expand Down
6 changes: 3 additions & 3 deletions tests/frosting/net5.0/build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="1.2.0" />
<PackageReference Include="Cake.Issues" Version="1.0.0" />
<PackageReference Include="Cake.Issues.Reporting" Version="1.0.0" />
<PackageReference Include="Cake.Frosting" Version="2.0.0" />
<PackageReference Include="Cake.Issues" Version="2.0.0-beta0001" />
<PackageReference Include="Cake.Issues.Reporting" Version="2.0.0-beta0001" />
<PackageReference Include="Cake.Issues.Reporting.Console" Version="*-*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/script-runner/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "1.2.0",
"version": "2.0.0",
"commands": [
"dotnet-cake"
]
Expand Down

0 comments on commit 4db42b8

Please sign in to comment.