From 115a5d064a3e6a783ba7fd7e40bc1db84d74700d Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 18:24:56 +0200 Subject: [PATCH 01/10] (GH-45) Multi-Target .NET Core 3.1, 5 & 6 instead of .NET Standard 2.0 (#61) --- ...Cake.Frosting.Issues.Reporting.Console.nuspec | 12 +++++++++--- .../nuget/Cake.Issues.Reporting.Console.nuspec | 16 ++++++++++++---- .../Cake.Issues.Reporting.Console.csproj | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec index 481f62b..4c97e14 100644 --- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec +++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec @@ -40,8 +40,14 @@ The addin requires Cake Frosting 1.2.0 or higher. - - - + + + + + + + + + \ No newline at end of file diff --git a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec index dfae3c4..1d80563 100644 --- a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec +++ b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec @@ -32,9 +32,17 @@ The addin requires Cake 1.2.0 or higher. - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj index e06b22c..c6b73ad 100644 --- a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj +++ b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0 + netcoreapp3.1;net5.0;net6.0 Support for reporting issues to the console for the Cake.Issues addin for Cake Build Automation System Pascal Berger Cake.Issues From da8980f31bab887250ab6ea99bfc4db6b53817dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:36:05 +0000 Subject: [PATCH 02/10] Bump xunit.runner.visualstudio from 2.4.3 to 2.4.5 in /src (#58) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.3 to 2.4.5. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/commits) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Cake.Issues.Reporting.Console.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj index d3da3f9..87287ad 100644 --- a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj +++ b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj @@ -53,7 +53,7 @@ 2.4.1 - 2.4.3 + 2.4.5 runtime; build; native; contentfiles; analyzers all From 9205f42a8921287ef2f8928ae2ef3a3b2bc5ce77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:36:45 +0000 Subject: [PATCH 03/10] Bump Microsoft.NET.Test.Sdk from 17.0.0 to 17.2.0 in /src (#59) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.0.0 to 17.2.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v17.0.0...v17.2.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Cake.Issues.Reporting.Console.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj index 87287ad..cb0631d 100644 --- a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj +++ b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj @@ -48,7 +48,7 @@ runtime; build; native; contentfiles; analyzers all - + 2.4.1 From f7b3387264588edcde487b727c09c6e19622aa21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 19:49:55 +0200 Subject: [PATCH 04/10] Bump Errata from 0.6.0 to 0.10.0 in /src (#53) Bumps [Errata](https://github.com/spectreconsole/errata) from 0.6.0 to 0.10.0. - [Release notes](https://github.com/spectreconsole/errata/releases) - [Commits](https://github.com/spectreconsole/errata/compare/0.6.0...0.10.0) --- updated-dependencies: - dependency-name: Errata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Cake.Issues.Reporting.Console.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj index c6b73ad..955bc22 100644 --- a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj +++ b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj @@ -32,7 +32,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 06dafe19c07d9b420b02559466b90c62773336d9 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 20:13:28 +0200 Subject: [PATCH 05/10] (GH-46) Build against Cake 2.0 (#64) --- .../Cake.Issues.Reporting.Console.Tests.csproj | 8 ++++---- .../Cake.Issues.Reporting.Console.csproj | 8 ++++---- .../ConsoleIssueReportGenerator.cs | 2 +- src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs | 2 +- tests/frosting/net5.0/build/Build.csproj | 6 +++--- tests/script-runner/.config/dotnet-tools.json | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj index cb0631d..3704203 100644 --- a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj +++ b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj @@ -29,16 +29,16 @@ - 1.0.0 + 2.0.0-beta0001 - 1.0.0 + 2.0.0-beta0001 - 1.0.0 + 2.0.0-beta0001 - 1.2.0 + 2.0.0 4.0.3 diff --git a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj index 955bc22..58afce1 100644 --- a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj +++ b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj @@ -29,9 +29,9 @@ - - - + + + all @@ -42,4 +42,4 @@ runtime; build; native; contentfiles; analyzers - \ No newline at end of file + diff --git a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs index 0645114..c038343 100644 --- a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs +++ b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs @@ -54,7 +54,7 @@ protected override FilePath InternalCreateReport(IEnumerable 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)); } diff --git a/src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs b/src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs index e69beb8..4db9712 100644 --- a/src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs +++ b/src/Cake.Issues.Reporting.Console/IssueDiagnostic.cs @@ -27,7 +27,7 @@ public IssueDiagnostic(IIssue issue) /// /// Issues which the diagnostic should describe. public IssueDiagnostic(IEnumerable issues) - : base(issues.First().Rule) + : base(issues.First().RuleId) { this.issues = issues; diff --git a/tests/frosting/net5.0/build/Build.csproj b/tests/frosting/net5.0/build/Build.csproj index 255e8f8..6aaac7b 100644 --- a/tests/frosting/net5.0/build/Build.csproj +++ b/tests/frosting/net5.0/build/Build.csproj @@ -5,9 +5,9 @@ $(MSBuildProjectDirectory) - - - + + + \ No newline at end of file diff --git a/tests/script-runner/.config/dotnet-tools.json b/tests/script-runner/.config/dotnet-tools.json index 4123dc6..31e896e 100644 --- a/tests/script-runner/.config/dotnet-tools.json +++ b/tests/script-runner/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "1.2.0", + "version": "2.0.0", "commands": [ "dotnet-cake" ] From 55062f30cc11f2271c0dd41881ee1e793458bc6a Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 22:54:51 +0200 Subject: [PATCH 06/10] Ignore Cake 2.x updates (#65) --- .github/dependabot.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7c249b8..da91e7a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" \ No newline at end of file From 5ac5eef6b360ceb742f56c6a02bb9316da15092b Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 23:45:31 +0200 Subject: [PATCH 07/10] (GH-47) Fix exception if no issues are passed and ShowProviderSummary is enabled (#66) --- .../ConsoleIssueReportGeneratorTests.cs | 56 ++++++++++++++++++- .../ConsoleIssueReportGenerator.cs | 6 ++ 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.Reporting.Console.Tests/ConsoleIssueReportGeneratorTests.cs b/src/Cake.Issues.Reporting.Console.Tests/ConsoleIssueReportGeneratorTests.cs index 3ccb6a3..57b607f 100644 --- a/src/Cake.Issues.Reporting.Console.Tests/ConsoleIssueReportGeneratorTests.cs +++ b/src/Cake.Issues.Reporting.Console.Tests/ConsoleIssueReportGeneratorTests.cs @@ -2,6 +2,8 @@ { using Cake.Issues.Testing; using Cake.Testing; + using System.Collections.Generic; + using System.Linq; using Xunit; public sealed class ConsoleIssueReportGeneratorTests @@ -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 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(), + @"c:\Source\Cake.Issues.Reporting.Console"); // Then } diff --git a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs index c038343..e2e89ea 100644 --- a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs +++ b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs @@ -89,6 +89,12 @@ protected override FilePath InternalCreateReport(IEnumerable issues) /// List of issues. private void PrintSummary(IEnumerable issues) { + if (!issues.Any()) + { + AnsiConsole.WriteLine("No issues"); + return; + } + AnsiConsole.WriteLine(); AnsiConsole.WriteLine(); var rule = new Rule("Summary").Centered(); From afa264e812d0dc0998007588a7893decedbdec40 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 23:48:32 +0200 Subject: [PATCH 08/10] Replace AnsiConsole.Render with Write() (#67) --- .../ConsoleIssueReportGenerator.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs index e2e89ea..8d9114f 100644 --- a/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs +++ b/src/Cake.Issues.Reporting.Console/ConsoleIssueReportGenerator.cs @@ -98,7 +98,7 @@ private void PrintSummary(IEnumerable issues) AnsiConsole.WriteLine(); AnsiConsole.WriteLine(); var rule = new Rule("Summary").Centered(); - AnsiConsole.Render(rule); + AnsiConsole.Write(rule); AnsiConsole.WriteLine(); var providerChart = new BarChart(); @@ -148,18 +148,18 @@ private void PrintSummary(IEnumerable 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); } } } From ec60543a057ed68a22c8c27ab2102b1a817f7535 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 27 Jul 2022 23:55:07 +0200 Subject: [PATCH 09/10] Update release notes link --- nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec | 2 +- nuspec/nuget/Cake.Issues.Reporting.Console.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec index a65200e..a842a8e 100644 --- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec +++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec @@ -28,7 +28,7 @@ The addin requires Cake Frosting 1.2.0 or higher. Copyright © Pascal Berger cake cake-addin cake-issues cake-reportformat issues reporting console - https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/1.0.0 + https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/2.0.0 diff --git a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec index 360b7bd..4907910 100644 --- a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec +++ b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec @@ -28,7 +28,7 @@ The addin requires Cake 1.2.0 or higher. Copyright © Pascal Berger cake cake-addin cake-issues cake-reportformat issues reporting console - https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/1.0.0 + https://github.com/cake-contrib/Cake.Issues.Reporting.Console/releases/tag/2.0.0 From e5a46432d591e027e6c8995c207a4a91c92be665 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Fri, 9 Dec 2022 22:59:24 +0100 Subject: [PATCH 10/10] Update to Cake.Issues 2.0 --- .../Cake.Issues.Reporting.Console.Tests.csproj | 6 +++--- .../Cake.Issues.Reporting.Console.csproj | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj index 3704203..dda4f63 100644 --- a/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj +++ b/src/Cake.Issues.Reporting.Console.Tests/Cake.Issues.Reporting.Console.Tests.csproj @@ -29,13 +29,13 @@ - 2.0.0-beta0001 + 2.0.0 - 2.0.0-beta0001 + 2.0.0 - 2.0.0-beta0001 + 2.0.0 2.0.0 diff --git a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj index 58afce1..a74131a 100644 --- a/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj +++ b/src/Cake.Issues.Reporting.Console/Cake.Issues.Reporting.Console.csproj @@ -30,8 +30,8 @@ - - + + all