From 14a82530b1f8f9cdf860635dfe9c71122ee18811 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Fri, 22 Dec 2017 22:10:14 +0100 Subject: [PATCH 01/10] (GH-7) Upgrade to Cake 0.23.0 --- cake.config | 3 +++ setup.cake | 3 ++- tools/packages.config | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 cake.config diff --git a/cake.config b/cake.config new file mode 100644 index 0000000..8615723 --- /dev/null +++ b/cake.config @@ -0,0 +1,3 @@ +[Nuget] +; Use the new InProcess client, because some packages have long file paths. +UseInProcessClient=true \ No newline at end of file diff --git a/setup.cake b/setup.cake index 55fdd3a..b8c3ee2 100644 --- a/setup.cake +++ b/setup.cake @@ -9,7 +9,8 @@ BuildParameters.SetParameters( title: "Cake.Issues.Markdownlint", repositoryOwner: "cake-contrib", repositoryName: "Cake.Issues.Markdownlint", - appVeyorAccountName: "cakecontrib"); + appVeyorAccountName: "cakecontrib", + shouldRunCodecov: false); BuildParameters.PrintParameters(Context); diff --git a/tools/packages.config b/tools/packages.config index 3b95cb1..af3212e 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,4 +1,4 @@ - + \ No newline at end of file From 6cd0eff05d88b5f446094904562223786f56cf81 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 17:21:35 +0200 Subject: [PATCH 02/10] Update XUnit to 2.3.1 --- .../Cake.Issues.Markdownlint.Tests.csproj | 21 ++++++++++++------- .../packages.config | 13 ++++++------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index 4edc4f5..28e963d 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -1,6 +1,7 @@  - + + Debug @@ -62,14 +63,14 @@ ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll - - ..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll + + ..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll - - ..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll + + ..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll - - ..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll + + ..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll @@ -97,12 +98,16 @@ + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + + + + \ No newline at end of file diff --git a/src/Cake.Issues.Markdownlint.Tests/packages.config b/src/Cake.Issues.Markdownlint.Tests/packages.config index 14de413..acd1242 100644 --- a/src/Cake.Issues.Markdownlint.Tests/packages.config +++ b/src/Cake.Issues.Markdownlint.Tests/packages.config @@ -6,11 +6,12 @@ - + - - - - - + + + + + + \ No newline at end of file From a8c3eefc634faf6c52a691bae019353fc8eca461 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 17:22:10 +0200 Subject: [PATCH 03/10] Update Shouldly to 3.0.0 --- .../Cake.Issues.Markdownlint.Tests.csproj | 4 ++-- src/Cake.Issues.Markdownlint.Tests/packages.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index 28e963d..b421e84 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -49,8 +49,8 @@ ..\packages\Cake.Testing.0.22.0\lib\net46\Cake.Testing.dll - - ..\packages\Shouldly.2.8.3\lib\net451\Shouldly.dll + + ..\packages\Shouldly.3.0.0\lib\net451\Shouldly.dll diff --git a/src/Cake.Issues.Markdownlint.Tests/packages.config b/src/Cake.Issues.Markdownlint.Tests/packages.config index acd1242..21bdf8c 100644 --- a/src/Cake.Issues.Markdownlint.Tests/packages.config +++ b/src/Cake.Issues.Markdownlint.Tests/packages.config @@ -4,7 +4,7 @@ - + From 5284dddf7badcadf7d63336f610b4f324a1fa26e Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 17:25:29 +0200 Subject: [PATCH 04/10] Target .NET Framework 4.6.1 --- nuspec/nuget/Cake.Issues.Markdownlint.nuspec | 6 +++--- .../Cake.Issues.Markdownlint.Tests.csproj | 2 +- src/Cake.Issues.Markdownlint.sln | 2 +- .../Cake.Issues.Markdownlint.csproj | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec index dd1332b..e1e8f46 100644 --- a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec +++ b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec @@ -26,8 +26,8 @@ See the Project Site for an overview of the whole ecosystem of addins for workin https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.1.0 - - - + + + \ No newline at end of file diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index b421e84..8f95b80 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -11,7 +11,7 @@ Properties Cake.Issues.Markdownlint.Tests Cake.Issues.Markdownlint.Tests - v4.6 + v4.6.1 512 diff --git a/src/Cake.Issues.Markdownlint.sln b/src/Cake.Issues.Markdownlint.sln index f3aa237..230814d 100644 --- a/src/Cake.Issues.Markdownlint.sln +++ b/src/Cake.Issues.Markdownlint.sln @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CE25C309 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuspec", "nuspec", "{0E6A55DD-0E2C-42C5-9444-F5F894A0A11E}" ProjectSection(SolutionItems) = preProject - ..\nuspec\Cake.Issues.Markdownlint.nuspec = ..\nuspec\Cake.Issues.Markdownlint.nuspec + ..\nuspec\nuget\Cake.Issues.Markdownlint.nuspec = ..\nuspec\nuget\Cake.Issues.Markdownlint.nuspec EndProjectSection EndProject Global diff --git a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj index 2c60e07..a966de6 100644 --- a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj +++ b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj @@ -9,7 +9,7 @@ Properties Cake.Issues.Markdownlint Cake.Issues.Markdownlint - v4.6 + v4.6.1 512 From 20458a8e7208edac079bdce6709c48c80cdcd1d3 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 17:27:00 +0200 Subject: [PATCH 05/10] (GH-9) Update to Cake.Issues 0.2.0 --- .../Cake.Issues.Markdownlint.Tests.csproj | 8 ++++---- src/Cake.Issues.Markdownlint.Tests/packages.config | 4 ++-- .../Cake.Issues.Markdownlint.csproj | 4 ++-- src/Cake.Issues.Markdownlint/packages.config | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index 8f95b80..54864a5 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -40,11 +40,11 @@ ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll - - ..\packages\Cake.Issues.0.1.0\lib\net45\Cake.Issues.dll + + ..\packages\Cake.Issues.0.2.0\lib\netstandard2.0\Cake.Issues.dll - - ..\packages\Cake.Issues.Testing.0.1.0\lib\net45\Cake.Issues.Testing.dll + + ..\packages\Cake.Issues.Testing.0.2.0\lib\netstandard2.0\Cake.Issues.Testing.dll ..\packages\Cake.Testing.0.22.0\lib\net46\Cake.Testing.dll diff --git a/src/Cake.Issues.Markdownlint.Tests/packages.config b/src/Cake.Issues.Markdownlint.Tests/packages.config index 21bdf8c..8e5955f 100644 --- a/src/Cake.Issues.Markdownlint.Tests/packages.config +++ b/src/Cake.Issues.Markdownlint.Tests/packages.config @@ -1,8 +1,8 @@  - - + + diff --git a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj index a966de6..639c896 100644 --- a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj +++ b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj @@ -40,8 +40,8 @@ ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll - - ..\packages\Cake.Issues.0.1.0\lib\net45\Cake.Issues.dll + + ..\packages\Cake.Issues.0.2.0\lib\netstandard2.0\Cake.Issues.dll ..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll diff --git a/src/Cake.Issues.Markdownlint/packages.config b/src/Cake.Issues.Markdownlint/packages.config index d248840..b748017 100644 --- a/src/Cake.Issues.Markdownlint/packages.config +++ b/src/Cake.Issues.Markdownlint/packages.config @@ -1,7 +1,7 @@  - + From dc41cb03789ab554f3c47ffef097284f255e4d89 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 17:28:01 +0200 Subject: [PATCH 06/10] (GH-11) Build against Cake 0.26.0 --- .../Cake.Issues.Markdownlint.Tests.csproj | 8 ++++---- src/Cake.Issues.Markdownlint.Tests/packages.config | 4 ++-- .../Cake.Issues.Markdownlint.csproj | 4 ++-- src/Cake.Issues.Markdownlint/packages.config | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index 54864a5..e7cd763 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -37,8 +37,8 @@ ..\Cake.Issues.Markdownlint.Tests.ruleset - - ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll + + ..\packages\Cake.Core.0.26.0\lib\net46\Cake.Core.dll ..\packages\Cake.Issues.0.2.0\lib\netstandard2.0\Cake.Issues.dll @@ -46,8 +46,8 @@ ..\packages\Cake.Issues.Testing.0.2.0\lib\netstandard2.0\Cake.Issues.Testing.dll - - ..\packages\Cake.Testing.0.22.0\lib\net46\Cake.Testing.dll + + ..\packages\Cake.Testing.0.26.0\lib\net46\Cake.Testing.dll ..\packages\Shouldly.3.0.0\lib\net451\Shouldly.dll diff --git a/src/Cake.Issues.Markdownlint.Tests/packages.config b/src/Cake.Issues.Markdownlint.Tests/packages.config index 8e5955f..4bcb8fe 100644 --- a/src/Cake.Issues.Markdownlint.Tests/packages.config +++ b/src/Cake.Issues.Markdownlint.Tests/packages.config @@ -1,9 +1,9 @@  - + - + diff --git a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj index 639c896..ae4cebc 100644 --- a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj +++ b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj @@ -37,8 +37,8 @@ ..\Cake.Issues.Markdownlint.ruleset - - ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll + + ..\packages\Cake.Core.0.26.0\lib\net46\Cake.Core.dll ..\packages\Cake.Issues.0.2.0\lib\netstandard2.0\Cake.Issues.dll diff --git a/src/Cake.Issues.Markdownlint/packages.config b/src/Cake.Issues.Markdownlint/packages.config index b748017..cf00460 100644 --- a/src/Cake.Issues.Markdownlint/packages.config +++ b/src/Cake.Issues.Markdownlint/packages.config @@ -1,6 +1,6 @@  - + From f119dda6179ce4a474705de3427d867154bc13bf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 19:37:17 +0200 Subject: [PATCH 07/10] (GH-12) Add support for markdownlint-cli --- setup.cake | 9 +- .../Cake.Issues.Markdownlint.Tests.csproj | 11 +- .../MarkdownlintIssuesProviderFixture.cs | 3 +- .../MarkdownlintIssuesProviderTests.cs | 3 +- .../MarkdownlintIssuesSettingsTests.cs | 3 +- .../MarkdownlintCliIssuesProviderFixture.cs | 48 ++++++ .../MarkdownlintCliIssuesProviderTests.cs | 156 ++++++++++++++++++ .../MarkdownlintCliIssuesSettingsTests.cs | 112 +++++++++++++ .../Testfiles/markdownlint-cli.log | 8 + .../Cake.Issues.Markdownlint.csproj | 9 +- .../MarkdownlintIssuesProvider.cs | 2 +- .../MarkdownlintIssuesSettings.cs | 2 +- .../MarkdownlintCliIssuesProvider.cs | 86 ++++++++++ .../MarkdownlintCliIssuesSettings.cs | 65 ++++++++ .../MarkdownlintIssuesAliases.Markdownlint.cs | 122 ++++++++++++++ ...rkdownlintIssuesAliases.MarkdownlintCli.cs | 125 ++++++++++++++ .../MarkdownlintIssuesAliases.cs | 109 +----------- 17 files changed, 754 insertions(+), 119 deletions(-) rename src/Cake.Issues.Markdownlint.Tests/{ => Markdownlint}/MarkdownlintIssuesProviderFixture.cs (93%) rename src/Cake.Issues.Markdownlint.Tests/{ => Markdownlint}/MarkdownlintIssuesProviderTests.cs (97%) rename src/Cake.Issues.Markdownlint.Tests/{ => Markdownlint}/MarkdownlintIssuesSettingsTests.cs (97%) create mode 100644 src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderFixture.cs create mode 100644 src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderTests.cs create mode 100644 src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesSettingsTests.cs create mode 100644 src/Cake.Issues.Markdownlint.Tests/Testfiles/markdownlint-cli.log rename src/Cake.Issues.Markdownlint/{ => Markdownlint}/MarkdownlintIssuesProvider.cs (97%) rename src/Cake.Issues.Markdownlint/{ => Markdownlint}/MarkdownlintIssuesSettings.cs (97%) create mode 100644 src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesProvider.cs create mode 100644 src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesSettings.cs create mode 100644 src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.Markdownlint.cs create mode 100644 src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.MarkdownlintCli.cs diff --git a/setup.cake b/setup.cake index b8c3ee2..f2c14f0 100644 --- a/setup.cake +++ b/setup.cake @@ -16,7 +16,14 @@ BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings( context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint.Tests/*.cs" }, + dupFinderExcludePattern: new string[] + { + BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesSettings.cs", + BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesSettings.cs", + BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint.Tests/*.cs", + BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint.Tests/Markdownlint/*.cs", + BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/*.cs" + }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Cake.Issues]* -[Cake.Issues.Testing]*", testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); diff --git a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj index e7cd763..831e6f4 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj +++ b/src/Cake.Issues.Markdownlint.Tests/Cake.Issues.Markdownlint.Tests.csproj @@ -74,9 +74,12 @@ - - - + + + + + + @@ -94,12 +97,14 @@ + + diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderFixture.cs b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderFixture.cs similarity index 93% rename from src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderFixture.cs rename to src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderFixture.cs index 4c031c1..e9248c1 100644 --- a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderFixture.cs +++ b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderFixture.cs @@ -1,7 +1,8 @@ -namespace Cake.Issues.Markdownlint.Tests +namespace Cake.Issues.Markdownlint.Tests.Markdownlint { using System.Collections.Generic; using System.IO; + using Cake.Issues.Markdownlint.Markdownlint; using Cake.Testing; using Core.Diagnostics; diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderTests.cs b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderTests.cs similarity index 97% rename from src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderTests.cs rename to src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderTests.cs index 4b45334..080a365 100644 --- a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesProviderTests.cs +++ b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesProviderTests.cs @@ -1,6 +1,7 @@ -namespace Cake.Issues.Markdownlint.Tests +namespace Cake.Issues.Markdownlint.Tests.Markdownlint { using System.Linq; + using Cake.Issues.Markdownlint.Markdownlint; using Cake.Testing; using Core.IO; using Shouldly; diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesSettingsTests.cs b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesSettingsTests.cs similarity index 97% rename from src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesSettingsTests.cs rename to src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesSettingsTests.cs index fcbd45e..d77979e 100644 --- a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintIssuesSettingsTests.cs +++ b/src/Cake.Issues.Markdownlint.Tests/Markdownlint/MarkdownlintIssuesSettingsTests.cs @@ -1,9 +1,10 @@ -namespace Cake.Issues.Markdownlint.Tests +namespace Cake.Issues.Markdownlint.Tests.Markdownlint { using System; using System.IO; using System.Linq; using System.Text; + using Cake.Issues.Markdownlint.Markdownlint; using Shouldly; using Testing; using Xunit; diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderFixture.cs b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderFixture.cs new file mode 100644 index 0000000..4c84ad6 --- /dev/null +++ b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderFixture.cs @@ -0,0 +1,48 @@ +namespace Cake.Issues.Markdownlint.Tests.MarkdownlintCli +{ + using System.Collections.Generic; + using System.IO; + using Cake.Issues.Markdownlint.MarkdownlintCli; + using Cake.Testing; + using Core.Diagnostics; + + internal class MarkdownlintCliIssuesProviderFixture + { + public MarkdownlintCliIssuesProviderFixture(string fileResourceName) + { + this.Log = new FakeLog { Verbosity = Verbosity.Normal }; + + using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Markdownlint.Tests.Testfiles." + fileResourceName)) + { + using (var sr = new StreamReader(stream)) + { + this.Settings = + MarkdownlintCliIssuesSettings.FromContent( + sr.ReadToEnd()); + } + } + + this.RepositorySettings = + new RepositorySettings(@"c:\Source\Cake.Issues"); + } + + public FakeLog Log { get; set; } + + public MarkdownlintCliIssuesSettings Settings { get; set; } + + public RepositorySettings RepositorySettings { get; set; } + + public MarkdownlintCliIssuesProvider Create() + { + var provider = new MarkdownlintCliIssuesProvider(this.Log, this.Settings); + provider.Initialize(this.RepositorySettings); + return provider; + } + + public IEnumerable ReadIssues() + { + var issueProvider = this.Create(); + return issueProvider.ReadIssues(IssueCommentFormat.PlainText); + } + } +} diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderTests.cs b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderTests.cs new file mode 100644 index 0000000..f2f37e6 --- /dev/null +++ b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesProviderTests.cs @@ -0,0 +1,156 @@ +namespace Cake.Issues.Markdownlint.Tests.MarkdownlintCli +{ + using System.Linq; + using Cake.Issues.Markdownlint.MarkdownlintCli; + using Cake.Testing; + using Core.IO; + using Shouldly; + using Testing; + using Xunit; + + public sealed class MarkdownlintCliIssuesProviderTests + { + public sealed class TheCtor + { + [Fact] + public void Should_Throw_If_Log_Is_Null() + { + // Given / When + var result = Record.Exception(() => + new MarkdownlintCliIssuesProvider( + null, + MarkdownlintCliIssuesSettings.FromContent("Foo"))); + + // Then + result.IsArgumentNullException("log"); + } + + [Fact] + public void Should_Throw_If_Settings_Are_Null() + { + var result = Record.Exception(() => + new MarkdownlintCliIssuesProvider( + new FakeLog(), + null)); + + // Then + result.IsArgumentNullException("settings"); + } + } + + public sealed class TheReadIssuesMethod + { + [Fact] + public void Should_Read_Issue_Correct() + { + // Given + var fixture = new MarkdownlintCliIssuesProviderFixture("markdownlint-cli.log"); + + // When + var issues = fixture.ReadIssues().ToList(); + + // Then + issues.Count.ShouldBe(8); + CheckIssue( + issues[0], + @"docs/index.md", + 1, + "MD022", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022", + 0, + "Headers should be surrounded by blank lines [Context: \"# foo\"]"); + CheckIssue( + issues[1], + @"docs/index.md", + 2, + "MD009", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md009", + 0, + "Trailing spaces [Expected: 2; Actual: 1]"); + CheckIssue( + issues[2], + @"docs/index.md", + 2, + "MD013", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013", + 0, + "Line length [Expected: 100; Actual: 811]"); + CheckIssue( + issues[3], + @"docs/index.md", + 4, + "MD022", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022", + 0, + "Headers should be surrounded by blank lines [Context: \"# bar\"]"); + CheckIssue( + issues[4], + @"docs/index.md", + 4, + "MD025", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md025", + 0, + "Multiple top level headers in the same document [Context: \"# bar\"]"); + CheckIssue( + issues[5], + @"docs/index.md", + 5, + "MD031", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md031", + 0, + "Fenced code blocks should be surrounded by blank lines [Context: \"```\"]"); + CheckIssue( + issues[6], + @"docs/index.md", + 5, + "MD040", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md040", + 0, + "Fenced code blocks should have a language specified [Context: \"```\"]"); + CheckIssue( + issues[7], + @"docs/index.md", + 6, + "MD009", + "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md009", + 0, + "Trailing spaces [Expected: 2; Actual: 1]"); + } + + private static void CheckIssue( + IIssue issue, + string affectedFileRelativePath, + int? line, + string rule, + string ruleUrl, + int priority, + string message) + { + if (issue.AffectedFileRelativePath == null) + { + affectedFileRelativePath.ShouldBeNull(); + } + else + { + issue.AffectedFileRelativePath.ToString().ShouldBe(new FilePath(affectedFileRelativePath).ToString()); + issue.AffectedFileRelativePath.IsRelative.ShouldBe(true, "Issue path is not relative"); + } + + issue.Line.ShouldBe(line); + issue.Rule.ShouldBe(rule); + + if (issue.RuleUrl == null) + { + ruleUrl.ShouldBeNull(); + } + else + { + issue.RuleUrl.ToString().ShouldBe(ruleUrl); + } + + issue.Priority.ShouldBe(priority); + issue.Message.ShouldBe(message); + } + } + } +} diff --git a/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesSettingsTests.cs b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesSettingsTests.cs new file mode 100644 index 0000000..0eea153 --- /dev/null +++ b/src/Cake.Issues.Markdownlint.Tests/MarkdownlintCli/MarkdownlintCliIssuesSettingsTests.cs @@ -0,0 +1,112 @@ +namespace Cake.Issues.Markdownlint.Tests.MarkdownlintCli +{ + using System; + using System.IO; + using System.Linq; + using System.Text; + using Cake.Issues.Markdownlint.MarkdownlintCli; + using Shouldly; + using Testing; + using Xunit; + + public sealed class MarkdownlintCliIssuesSettingsTests + { + public sealed class TheCtor + { + [Fact] + public void Should_Throw_If_LogFilePath_Is_Null() + { + // Given / When + var result = Record.Exception(() => + MarkdownlintCliIssuesSettings.FromFilePath(null)); + + // Then + result.IsArgumentNullException("logFilePath"); + } + + [Fact] + public void Should_Throw_If_LogFileContent_Is_Null() + { + // Given / When + var result = Record.Exception(() => + MarkdownlintCliIssuesSettings.FromContent(null)); + + // Then + result.IsArgumentNullException("logFileContent"); + } + + [Fact] + public void Should_Throw_If_LogFileContent_Is_Empty() + { + // Given / When + var result = Record.Exception(() => + MarkdownlintCliIssuesSettings.FromContent(string.Empty)); + + // Then + result.IsArgumentOutOfRangeException("logFileContent"); + } + + [Fact] + public void Should_Throw_If_LogFileContent_Is_WhiteSpace() + { + // Given / When + var result = Record.Exception(() => + MarkdownlintCliIssuesSettings.FromContent(" ")); + + // Then + result.IsArgumentOutOfRangeException("logFileContent"); + } + + [Fact] + public void Should_Set_Property_Values_Passed_To_Constructor() + { + // Given + const string logFileContent = "foo"; + + // When + var settings = MarkdownlintCliIssuesSettings.FromContent(logFileContent); + + // Then + settings.LogFileContent.ShouldBe(logFileContent); + } + + [Fact] + public void Should_Read_File_From_Disk() + { + var fileName = Path.GetTempFileName(); + try + { + // Given + string expected; + using (var ms = new MemoryStream()) + using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Markdownlint.Tests.Testfiles.markdownlint-cli.log")) + { + stream.CopyTo(ms); + var data = ms.ToArray(); + + using (var file = new FileStream(fileName, FileMode.Create, FileAccess.Write)) + { + file.Write(data, 0, data.Length); + } + + expected = Encoding.UTF8.GetString(data); + } + + // When + var settings = + MarkdownlintCliIssuesSettings.FromFilePath(fileName); + + // Then + settings.LogFileContent.ShouldBe(expected); + } + finally + { + if (File.Exists(fileName)) + { + File.Delete(fileName); + } + } + } + } + } +} diff --git a/src/Cake.Issues.Markdownlint.Tests/Testfiles/markdownlint-cli.log b/src/Cake.Issues.Markdownlint.Tests/Testfiles/markdownlint-cli.log new file mode 100644 index 0000000..8a11f8a --- /dev/null +++ b/src/Cake.Issues.Markdownlint.Tests/Testfiles/markdownlint-cli.log @@ -0,0 +1,8 @@ +C:/Git/Test/Cake.Prca/docs/index.md: 1: MD022/blanks-around-headers Headers should be surrounded by blank lines [Context: "# foo"] +C:/Git/Test/Cake.Prca/docs/index.md: 2: MD009/no-trailing-spaces Trailing spaces [Expected: 2; Actual: 1] +C:/Git/Test/Cake.Prca/docs/index.md: 2: MD013/line-length Line length [Expected: 100; Actual: 811] +C:/Git/Test/Cake.Prca/docs/index.md: 4: MD022/blanks-around-headers Headers should be surrounded by blank lines [Context: "# bar"] +C:/Git/Test/Cake.Prca/docs/index.md: 4: MD025/single-h1 Multiple top level headers in the same document [Context: "# bar"] +C:/Git/Test/Cake.Prca/docs/index.md: 5: MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] +C:/Git/Test/Cake.Prca/docs/index.md: 5: MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] +C:/Git/Test/Cake.Prca/docs/index.md: 6: MD009/no-trailing-spaces Trailing spaces [Expected: 2; Actual: 1] \ No newline at end of file diff --git a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj index ae4cebc..a0d5248 100644 --- a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj +++ b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj @@ -61,8 +61,12 @@ - - + + + + + + @@ -78,6 +82,7 @@ + diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesProvider.cs b/src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesProvider.cs similarity index 97% rename from src/Cake.Issues.Markdownlint/MarkdownlintIssuesProvider.cs rename to src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesProvider.cs index 6edbb2f..1ea3d2b 100644 --- a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesProvider.cs +++ b/src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesProvider.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Markdownlint +namespace Cake.Issues.Markdownlint.Markdownlint { using System.Collections.Generic; using System.Linq; diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesSettings.cs b/src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesSettings.cs similarity index 97% rename from src/Cake.Issues.Markdownlint/MarkdownlintIssuesSettings.cs rename to src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesSettings.cs index a7eae34..d45d4ab 100644 --- a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesSettings.cs +++ b/src/Cake.Issues.Markdownlint/Markdownlint/MarkdownlintIssuesSettings.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Markdownlint +namespace Cake.Issues.Markdownlint.Markdownlint { using System.IO; using Core.IO; diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesProvider.cs b/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesProvider.cs new file mode 100644 index 0000000..5d482f4 --- /dev/null +++ b/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesProvider.cs @@ -0,0 +1,86 @@ +namespace Cake.Issues.Markdownlint.MarkdownlintCli +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Text.RegularExpressions; + using Core.Diagnostics; + + /// + /// Provider for issues reported by markdownlint-cli. + /// + internal class MarkdownlintCliIssuesProvider : IssueProvider + { + private readonly MarkdownlintCliIssuesSettings settings; + + /// + /// Initializes a new instance of the class. + /// + /// The Cake log context. + /// Settings for reading the log file. + public MarkdownlintCliIssuesProvider(ICakeLog log, MarkdownlintCliIssuesSettings settings) + : base(log) + { + settings.NotNull(nameof(settings)); + + this.settings = settings; + } + + /// + protected override IEnumerable InternalReadIssues(IssueCommentFormat format) + { + var regex = new Regex(@"(.*): (\d*): (MD\d*)/((?:\w*-*)*) (.*)"); + + foreach (var line in this.settings.LogFileContent.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None).ToList().Where(s => !string.IsNullOrEmpty(s))) + { + var groups = regex.Match(line).Groups; + + // Read affected file from the line. + if (!this.TryGetFile(groups, this.Settings, out string fileName)) + { + continue; + } + + var lineNumber = int.Parse(groups[2].Value); + var rule = groups[3].Value; + var ruleDescription = groups[5].Value; + + yield return + new Issue( + fileName, + lineNumber, + ruleDescription, + 0, + rule, + MarkdownlintRuleUrlResolver.Instance.ResolveRuleUrl(rule)); + } + } + + /// + /// Reads the affected file path from a parsed entry. + /// + /// Parsed values of a line in the log file. + /// Repository settings to use. + /// Returns the full path to the affected file. + /// True if the file path could be parsed. + private bool TryGetFile( + GroupCollection values, + RepositorySettings repositorySettings, + out string fileName) + { + fileName = values[1].Value; + + // Make path relative to repository root. + fileName = fileName.Substring(repositorySettings.RepositoryRoot.FullPath.Length); + + // Remove leading directory separator. + if (fileName.StartsWith("/")) + { + fileName = fileName.Substring(1); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesSettings.cs b/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesSettings.cs new file mode 100644 index 0000000..02072b1 --- /dev/null +++ b/src/Cake.Issues.Markdownlint/MarkdownlintCli/MarkdownlintCliIssuesSettings.cs @@ -0,0 +1,65 @@ +namespace Cake.Issues.Markdownlint.MarkdownlintCli +{ + using System.IO; + using Core.IO; + + /// + /// Settings for . + /// + public class MarkdownlintCliIssuesSettings + { + /// + /// Initializes a new instance of the class. + /// + /// Path to the the Markdownlint log file. + protected MarkdownlintCliIssuesSettings(FilePath logFilePath) + { + logFilePath.NotNull(nameof(logFilePath)); + + using (var stream = new FileStream(logFilePath.FullPath, FileMode.Open, FileAccess.Read)) + { + using (var sr = new StreamReader(stream)) + { + this.LogFileContent = sr.ReadToEnd(); + } + } + } + + /// + /// Initializes a new instance of the class. + /// + /// Content of the the Markdownlint log file. + protected MarkdownlintCliIssuesSettings(string logFileContent) + { + logFileContent.NotNullOrWhiteSpace(nameof(logFileContent)); + + this.LogFileContent = logFileContent; + } + + /// + /// Gets the content of the log file. + /// + public string LogFileContent { get; private set; } + + /// + /// Returns a new instance of the class from a log file on disk. + /// + /// Path to the Markdownlint log file. + /// Instance of the class. + public static MarkdownlintCliIssuesSettings FromFilePath(FilePath logFilePath) + { + return new MarkdownlintCliIssuesSettings(logFilePath); + } + + /// + /// Returns a new instance of the class from the content + /// of a Markdownlint log file. + /// + /// Content of the Markdownlint log file. + /// Instance of the class. + public static MarkdownlintCliIssuesSettings FromContent(string logFileContent) + { + return new MarkdownlintCliIssuesSettings(logFileContent); + } + } +} diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.Markdownlint.cs b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.Markdownlint.cs new file mode 100644 index 0000000..b9ecbdb --- /dev/null +++ b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.Markdownlint.cs @@ -0,0 +1,122 @@ +namespace Cake.Issues.Markdownlint +{ + using Cake.Issues.Markdownlint.Markdownlint; + using Core; + using Core.Annotations; + using Core.IO; + +#pragma warning disable SA1601 // Partial elements must be documented + public static partial class MarkdownlintIssuesAliases +#pragma warning restore SA1601 // Partial elements must be documented + { + /// + /// Gets the name of the Markdownlint issue provider. + /// This name can be used to identify issues based on the property. + /// + /// The context. + /// Name of the Markdownlint issue provider. + [CakePropertyAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.Markdownlint")] + public static string MarkdownlintIssuesProviderTypeName( + this ICakeContext context) + { + context.NotNull(nameof(context)); + + return Issue.GetProviderTypeName(); + } + + /// + /// Gets an instance of a provider for issues reported by Markdownlint using a log file from disk. + /// + /// The context. + /// Path to the the Markdownlint log file. + /// Instance of a provider for issues reported by Markdownlint. + /// + /// Read issues reported by Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.Markdownlint")] + public static IIssueProvider MarkdownlintIssuesFromFilePath( + this ICakeContext context, + FilePath logFilePath) + { + context.NotNull(nameof(context)); + logFilePath.NotNull(nameof(logFilePath)); + + return context.MarkdownlintIssues(MarkdownlintIssuesSettings.FromFilePath(logFilePath)); + } + + /// + /// Gets an instance of a provider for issues reported by Markdownlint using log file content. + /// + /// The context. + /// Content of the the Markdownlint log file. + /// Instance of a provider for issues reported by Markdownlint. + /// + /// Read issues reported by Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.Markdownlint")] + public static IIssueProvider MarkdownlintIssuesFromContent( + this ICakeContext context, + string logFileContent) + { + context.NotNull(nameof(context)); + logFileContent.NotNullOrWhiteSpace(nameof(logFileContent)); + + return context.MarkdownlintIssues(MarkdownlintIssuesSettings.FromContent(logFileContent)); + } + + /// + /// Gets an instance of a provider for issues reported by Markdownlint using specified settings. + /// + /// The context. + /// Settings for reading the Markdownlint log. + /// Instance of a provider for issues reported by Markdownlint. + /// + /// Read issues reported by Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.Markdownlint")] + public static IIssueProvider MarkdownlintIssues( + this ICakeContext context, + MarkdownlintIssuesSettings settings) + { + context.NotNull(nameof(context)); + settings.NotNull(nameof(settings)); + + return new MarkdownlintIssuesProvider(context.Log, settings); + } + } +} diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.MarkdownlintCli.cs b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.MarkdownlintCli.cs new file mode 100644 index 0000000..33858a5 --- /dev/null +++ b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.MarkdownlintCli.cs @@ -0,0 +1,125 @@ +namespace Cake.Issues.Markdownlint +{ + using Cake.Issues.Markdownlint.MarkdownlintCli; + using Core; + using Core.Annotations; + using Core.IO; + +#pragma warning disable SA1601 // Partial elements must be documented + public static partial class MarkdownlintIssuesAliases +#pragma warning restore SA1601 // Partial elements must be documented + { + /// + /// Gets the name of the markdownlint-cli issue provider. + /// This name can be used to identify issues based on the property. + /// + /// The context. + /// Name of the markdownlint-cli issue provider. + [CakePropertyAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.MarkdownlintCli")] + public static string MarkdownlintCliIssuesProviderTypeName( + this ICakeContext context) + { + context.NotNull(nameof(context)); + + return Issue.GetProviderTypeName(); + } + + /// + /// Gets an instance of a provider for issues reported by markdownlint-cli or Cake.Markdownlint + /// using a log file from disk. + /// + /// The context. + /// Path to the the markdownlint-cli log file. + /// Instance of a provider for issues reported by markdownlint-cli. + /// + /// Read issues reported by markdownlint-cli or Cake.Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.MarkdownlintCli")] + public static IIssueProvider MarkdownlintCliIssuesFromFilePath( + this ICakeContext context, + FilePath logFilePath) + { + context.NotNull(nameof(context)); + logFilePath.NotNull(nameof(logFilePath)); + + return context.MarkdownlintCliIssues(MarkdownlintCliIssuesSettings.FromFilePath(logFilePath)); + } + + /// + /// Gets an instance of a provider for issues reported by markdownlint-cli or Cake.Markdownlint + /// using log file content. + /// + /// The context. + /// Content of the the markdownlint-cli log file. + /// Instance of a provider for issues reported by markdownlint-cli. + /// + /// Read issues reported by markdownlint-cli or Cake.Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.MarkdownlintCli")] + public static IIssueProvider MarkdownlintCliIssuesFromContent( + this ICakeContext context, + string logFileContent) + { + context.NotNull(nameof(context)); + logFileContent.NotNullOrWhiteSpace(nameof(logFileContent)); + + return context.MarkdownlintCliIssues(MarkdownlintCliIssuesSettings.FromContent(logFileContent)); + } + + /// + /// Gets an instance of a provider for issues reported by markdownlint-cli or Cake.Markdownlint + /// using specified settings. + /// + /// The context. + /// Settings for reading the markdownlint-cli log. + /// Instance of a provider for issues reported by markdownlint-cli. + /// + /// Read issues reported by markdownlint-cli or Cake.Markdownlint: + /// + /// + /// + /// + [CakeMethodAlias] + [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] + [CakeNamespaceImport("Cake.Issues.Markdownlint.MarkdownlintCli")] + public static IIssueProvider MarkdownlintCliIssues( + this ICakeContext context, + MarkdownlintCliIssuesSettings settings) + { + context.NotNull(nameof(context)); + settings.NotNull(nameof(settings)); + + return new MarkdownlintCliIssuesProvider(context.Log, settings); + } + } +} diff --git a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.cs b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.cs index cb3bc78..a5320c3 100644 --- a/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.cs +++ b/src/Cake.Issues.Markdownlint/MarkdownlintIssuesAliases.cs @@ -1,119 +1,12 @@ namespace Cake.Issues.Markdownlint { - using Core; using Core.Annotations; - using Core.IO; /// /// Contains functionality for reading issues from Markdownlint log files. /// [CakeAliasCategory(IssuesAliasConstants.MainCakeAliasCategory)] - public static class MarkdownlintIssuesAliases + public static partial class MarkdownlintIssuesAliases { - /// - /// Gets the name of the Markdownlint issue provider. - /// This name can be used to identify issues based on the property. - /// - /// The context. - /// Name of the Markdownlint issue provider. - [CakePropertyAlias] - [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] - public static string MarkdownlintIssuesProviderTypeName( - this ICakeContext context) - { - context.NotNull(nameof(context)); - - return Issue.GetProviderTypeName(); - } - - /// - /// Gets an instance of a provider for issues reported by Markdownlint using a log file from disk. - /// - /// The context. - /// Path to the the Markdownlint log file. - /// Instance of a provider for issues reported by Markdownlint. - /// - /// Read issues reported by Markdownlint: - /// - /// - /// - /// - [CakeMethodAlias] - [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] - public static IIssueProvider MarkdownlintIssuesFromFilePath( - this ICakeContext context, - FilePath logFilePath) - { - context.NotNull(nameof(context)); - logFilePath.NotNull(nameof(logFilePath)); - - return context.MarkdownlintIssues(MarkdownlintIssuesSettings.FromFilePath(logFilePath)); - } - - /// - /// Gets an instance of a provider for issues reported by Markdownlint using log file content. - /// - /// The context. - /// Content of the the Markdownlint log file. - /// Instance of a provider for issues reported by Markdownlint. - /// - /// Read issues reported by Markdownlint: - /// - /// - /// - /// - [CakeMethodAlias] - [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] - public static IIssueProvider MarkdownlintIssuesFromContent( - this ICakeContext context, - string logFileContent) - { - context.NotNull(nameof(context)); - logFileContent.NotNullOrWhiteSpace(nameof(logFileContent)); - - return context.MarkdownlintIssues(MarkdownlintIssuesSettings.FromContent(logFileContent)); - } - - /// - /// Gets an instance of a provider for issues reported by Markdownlint using specified settings. - /// - /// The context. - /// Settings for reading the Markdownlint log. - /// Instance of a provider for issues reported by Markdownlint. - /// - /// Read issues reported by Markdownlint: - /// - /// - /// - /// - [CakeMethodAlias] - [CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)] - public static IIssueProvider MarkdownlintIssues( - this ICakeContext context, - MarkdownlintIssuesSettings settings) - { - context.NotNull(nameof(context)); - settings.NotNull(nameof(settings)); - - return new MarkdownlintIssuesProvider(context.Log, settings); - } } } From 885bd990ad87e39a75abec6cd32e1528dc16ac4c Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 21:47:11 +0200 Subject: [PATCH 08/10] Update release notes link --- nuspec/nuget/Cake.Issues.Markdownlint.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec index e1e8f46..fbc29b3 100644 --- a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec +++ b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec @@ -23,7 +23,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin false Copyright © 2017 BBT Software AG and contributors Cake Script Cake-Issues Cake-IssueProvider Linting Markdownlint - https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.1.0 + https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.2.0 From 67d8770705b27c71c4219618ac3dc4a1b9a6fda3 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 21:48:13 +0200 Subject: [PATCH 09/10] Remove year from copyright --- nuspec/nuget/Cake.Issues.Markdownlint.nuspec | 2 +- src/Cake.Issues.Markdownlint.Tests/Properties/AssemblyInfo.cs | 2 +- src/Cake.Issues.Markdownlint/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec index fbc29b3..e36dd1b 100644 --- a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec +++ b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec @@ -21,7 +21,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin https://github.com/cake-contrib/Cake.Issues.Markdownlint https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png false - Copyright © 2017 BBT Software AG and contributors + Copyright © BBT Software AG and contributors Cake Script Cake-Issues Cake-IssueProvider Linting Markdownlint https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.2.0 diff --git a/src/Cake.Issues.Markdownlint.Tests/Properties/AssemblyInfo.cs b/src/Cake.Issues.Markdownlint.Tests/Properties/AssemblyInfo.cs index b6f0042..7752953 100644 --- a/src/Cake.Issues.Markdownlint.Tests/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Markdownlint.Tests/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BBT Software AG")] [assembly: AssemblyProduct("Cake.Issues")] -[assembly: AssemblyCopyright("Copyright © 2017 BBT Software AG and contributors")] +[assembly: AssemblyCopyright("Copyright © BBT Software AG and contributors")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/Cake.Issues.Markdownlint/Properties/AssemblyInfo.cs b/src/Cake.Issues.Markdownlint/Properties/AssemblyInfo.cs index 194ae80..5d2e2c9 100644 --- a/src/Cake.Issues.Markdownlint/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Markdownlint/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BBT Software AG")] [assembly: AssemblyProduct("Cake.Issues")] -[assembly: AssemblyCopyright("Copyright © 2017 BBT Software AG and contributors")] +[assembly: AssemblyCopyright("Copyright © BBT Software AG and contributors")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] From 9417cdc9f5ef086287126d31dd94a707d8e5747a Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 27 May 2018 21:50:44 +0200 Subject: [PATCH 10/10] Update FxCop Analyzers to 2.6.0 --- .../Cake.Issues.Markdownlint.csproj | 20 +++++++++++++++---- src/Cake.Issues.Markdownlint/packages.config | 11 +++++----- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj index a0d5248..36615f8 100644 --- a/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj +++ b/src/Cake.Issues.Markdownlint/Cake.Issues.Markdownlint.csproj @@ -1,5 +1,9 @@  + + + + Debug @@ -75,12 +79,16 @@ - - + + + + + + - - + + @@ -90,6 +98,10 @@ + + + + diff --git a/src/Cake.Issues.Markdownlint/packages.config b/src/Cake.Issues.Markdownlint/packages.config index cf00460..4bc732a 100644 --- a/src/Cake.Issues.Markdownlint/packages.config +++ b/src/Cake.Issues.Markdownlint/packages.config @@ -3,13 +3,12 @@ - - - + + + + - - - + \ No newline at end of file