diff --git a/.appveyor.yml b/.appveyor.yml
index 6babdb74..50ec87fc 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -4,6 +4,8 @@
install:
# Update to latest NuGet version since we require 5.3.0 for embedded icon
- ps: nuget update -self
+ - ps: Install-Product node 14
+ - ps: choco install markdownlint-cli --no-progress
build_script:
- ps: .\build.ps1 -Target AppVeyor
@@ -27,4 +29,4 @@ branches:
# Build Cache #
#---------------------------------#
cache:
-- tools -> setup.cake
\ No newline at end of file
+- tools -> recipe.cake
\ No newline at end of file
diff --git a/Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec b/Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec
index 09dbe5fa..c8b5b7c6 100644
--- a/Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec
+++ b/Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec
@@ -19,6 +19,6 @@ See the Project Site for documentation and an overview of the whole ecosystem of
Copyright © Pascal Berger
Build Cake Cake.Issues Recipe
- https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.3.3
+ https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.3.4
\ No newline at end of file
diff --git a/Cake.Issues.Recipe/Content/addins.cake b/Cake.Issues.Recipe/Content/addins.cake
index c3bdc081..7c65af09 100644
--- a/Cake.Issues.Recipe/Content/addins.cake
+++ b/Cake.Issues.Recipe/Content/addins.cake
@@ -6,6 +6,7 @@
#addin nuget:?package=Cake.Issues&version=0.8.1
#addin nuget:?package=Cake.Issues.MsBuild&version=0.8.0
#addin nuget:?package=Cake.Issues.InspectCode&version=0.8.0
+#addin nuget:?package=Cake.Issues.Markdownlint&version=0.8.2
#addin nuget:?package=Cake.Issues.Reporting&version=0.8.0
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=0.8.2
#addin nuget:?package=Cake.Issues.PullRequests&version=0.8.1
diff --git a/Cake.Issues.Recipe/Content/build.cake b/Cake.Issues.Recipe/Content/build.cake
index 8a9f06df..71def00e 100644
--- a/Cake.Issues.Recipe/Content/build.cake
+++ b/Cake.Issues.Recipe/Content/build.cake
@@ -65,6 +65,22 @@ IssuesBuildTasks.ReadIssuesTask = Task("Read-Issues")
IssuesParameters.InputFiles.InspectCodeLogFilePath));
}
+ if (IssuesParameters.InputFiles.MarkdownlintCliLogFilePath != null)
+ {
+ issueProviders.Add(
+ MarkdownlintIssuesFromFilePath(
+ IssuesParameters.InputFiles.MarkdownlintCliLogFilePath,
+ MarkdownlintCliLogFileFormat));
+ }
+
+ if (IssuesParameters.InputFiles.MarkdownlintV1LogFilePath != null)
+ {
+ issueProviders.Add(
+ MarkdownlintIssuesFromFilePath(
+ IssuesParameters.InputFiles.MarkdownlintV1LogFilePath,
+ MarkdownlintLogFileFormat));
+ }
+
if (!issueProviders.Any())
{
Information("No files to process...");
@@ -98,7 +114,7 @@ IssuesBuildTasks.CreateFullIssuesReportTask = Task("Create-FullIssuesReport")
EnsureDirectoryExists(IssuesParameters.OutputDirectory);
// Create HTML report using DevExpress template.
- var settings =
+ var settings =
GenericIssueReportFormatSettings
.FromEmbeddedTemplate(GenericIssueReportTemplate.HtmlDxDataGrid)
.WithOption(HtmlDxDataGridOption.Theme, DevExtremeTheme.MaterialBlueLight);
diff --git a/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake b/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake
index c4e7a34d..8e5a69c1 100644
--- a/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake
+++ b/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake
@@ -17,4 +17,14 @@ public class IssuesParametersInputFiles
/// Gets or sets the path to the InspectCode log file.
///
public FilePath InspectCodeLogFilePath { get; set; }
+
+ ///
+ /// Gets or sets the path to the markdownlint-cli log file.
+ ///
+ public FilePath MarkdownlintCliLogFilePath { get; set; }
+
+ ///
+ /// Gets or sets the path to the markdownlint log file in version 1.
+ ///
+ public FilePath MarkdownlintV1LogFilePath { get; set; }
}
\ No newline at end of file
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 403178e3..02d5f0e2 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -14,14 +14,25 @@ jobs:
pool:
vmImage: 'vs2017-win2016'
steps:
+ - task: NodeTool@0
+ inputs:
+ versionSpec: '14.x'
+ - powershell: choco install markdownlint-cli --no-progress
+ displayName: 'Install required tools'
- powershell: ./build.ps1 -target Run-Integration-Tests
displayName: 'Integration Tests'
- job: macOS
pool:
vmImage: 'macOS-10.14'
steps:
+ - task: NodeTool@0
+ inputs:
+ versionSpec: '14.x'
+ - bash: |
+ npm install -g markdownlint-cli
+ displayName: 'Install required tools'
# To manually select a Xamarin SDK version on the Hosted macOS agent, enable this script with the SDK version you want to target
- # https://go.microsoft.com/fwlink/?linkid=871629
+ # https://go.microsoft.com/fwlink/?linkid=871629
- bash: |
sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_18_1
displayName: 'Select Mono 5.18.1'
diff --git a/docs/configuration.md b/docs/configuration.md
index 9339b06b..cb64e3df 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -20,7 +20,9 @@ and behavior of Cake.Issues.Recipe.
|---------------------------------------------------------------|---------------|--------------------------------------------------------|
| `IssuesParameters.InputFiles.MsBuildXmlFileLoggerLogFilePath` | `null` | Path to the MSBuild log file created by XmlFileLogger. |
| `IssuesParameters.InputFiles.MsBuildBinaryLogFilePath` | `null` | Path to the MSBuild binary log file. |
-| `IssuesParameters.InputFiles.InspectCodeLogFilePath` | `null` | Path to the JetBrains InspectCoe log file. |
+| `IssuesParameters.InputFiles.InspectCodeLogFilePath` | `null` | Path to the JetBrains InspectCode log file. |
+| `IssuesParameters.InputFiles.MarkdownlintCliLogFilePath` | `null` | Path to the markdownlint-cli log file. |
+| `IssuesParameters.InputFiles.MarkdownlintV1LogFilePath` | `null` | Path to the markdownlint log file in version 1. |
# Report creation
diff --git a/docs/supported-tools.md b/docs/supported-tools.md
index 4f265bec..136ee8a3 100644
--- a/docs/supported-tools.md
+++ b/docs/supported-tools.md
@@ -15,8 +15,12 @@ Cake.Issues.Recipe supports reading issues from output of the following tools:
| MsBuild | [MSBuild Extension Pack XmlFileLogger] | `IssuesParameters.InputFiles.MsBuildXmlFileLoggerLogFilePath` |
| MsBuild | Binary Log File | `IssuesParameters.InputFiles.MsBuildBinaryLogFilePath` |
| JetBrains InspectCode (ReSharper) | | `IssuesParameters.InputFiles.InspectCodeLogFilePath` |
+| markdownlint | [markdownlint-cli] | `IssuesParameters.InputFiles.MarkdownlintCliLogFilePath` |
+| markdownlint | [markdownlint] version 1 | `IssuesParameters.InputFiles.MarkdownlintV1LogFilePath` |
[MSBuild Extension Pack XmlFileLogger]: http://www.msbuildextensionpack.com/help/4.0.5.0/html/242ab4fd-c2e2-f6aa-325b-7588725aed24.htm
+[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
+[markdownlint]: https://github.com/DavidAnson/markdownlint
# Build systems
diff --git a/recipe.cake b/recipe.cake
index 3022b7bc..db60e174 100644
--- a/recipe.cake
+++ b/recipe.cake
@@ -1,4 +1,4 @@
-#load nuget:?package=Cake.Recipe&version=1.0.0
+#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&version=1.1.2-beta0001&prerelease
Environment.SetVariableNames();
diff --git a/tests/integration/buildData.cake b/tests/integration/buildData.cake
index c148d9c8..496cd4af 100644
--- a/tests/integration/buildData.cake
+++ b/tests/integration/buildData.cake
@@ -6,6 +6,8 @@ public class BuildData
public FilePath InspectCodeLogFilePath { get; }
+ public FilePath MarkdownlintCliLogFilePath { get; }
+
public BuildData(ICakeContext context)
{
if (context == null)
@@ -17,5 +19,6 @@ public class BuildData
this.MsBuildLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("msbuild.log");
this.InspectCodeLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("inspectCode.log");
+ this.MarkdownlintCliLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("markdownlintCli.log");
}
}
\ No newline at end of file
diff --git a/tests/integration/docs/index.md b/tests/integration/docs/index.md
new file mode 100644
index 00000000..68eae708
--- /dev/null
+++ b/tests/integration/docs/index.md
@@ -0,0 +1,7 @@
+# foo
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean fermentum dictum mauris, sed feugiat nibh rutrum eget. Fusce sed purus nec sem faucibus semper sed id est. Cras vestibulum leo nec ipsum posuere eleifend. Nullam iaculis quam in sapien efficitur consequat. In hac habitasse platea dictumst. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus pulvinar bibendum sapien ac ultrices. Sed imperdiet mi non felis imperdiet, at interdum ante volutpat. Pellentesque eu cursus dolor, non iaculis ipsum. Quisque in tortor viverra, sodales nibh vitae, vehicula urna. Integer dolor mauris, condimentum ac accumsan quis, placerat eget tellus. Duis volutpat interdum nisi, vel efficitur nisl viverra vitae. Maecenas eget lacus vel lacus congue lobortis. Etiam ornare dictum nulla nec commodo.
+
+# bar
+```
+Praesent euismod est vel quam volutpat ultrices. Cras luctus lorem quis nibh tincidunt, a auctor velit fermentum. Cras et nisl neque. Sed mi lorem, efficitur et purus eu, vehicula ornare felis. Aliquam sagittis ultricies sem, nec dignissim erat porta at. Suspendisse in justo lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque ornare neque porttitor tortor auctor lobortis posuere id dui. Phasellus et felis a nibh viverra cursus ut blandit ante. Suspendisse lacus tortor, pharetra non pulvinar vulputate, semper sed augue. Aenean feugiat finibus quam quis iaculis. Maecenas ac quam quis risus scelerisque rhoncus. Donec eget aliquam metus. Nam feugiat sem dui, quis consectetur lorem lobortis in. Maecenas eu bibendum sapien.
+```
\ No newline at end of file
diff --git a/tests/integration/tests.cake b/tests/integration/tests.cake
index 947f8ff0..6b1622d1 100644
--- a/tests/integration/tests.cake
+++ b/tests/integration/tests.cake
@@ -1,6 +1,8 @@
#load "../../Cake.Issues.Recipe/Content/build.cake"
#load "buildData.cake"
+#addin "Cake.Markdownlint"
+
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools"
#tool "nuget:?package=MSBuild.Extension.Pack"
@@ -47,7 +49,7 @@ Task("Build")
data.IssuesData.RepositoryRootDirectory
.Combine("src")
.CombineWithFilePath("ClassLibrary1.sln");
-
+
Information("Restoring NuGet package for {0}...", solutionFile);
NuGetRestore(solutionFile);
@@ -90,8 +92,23 @@ Task("Run-InspectCode")
IssuesParameters.InputFiles.InspectCodeLogFilePath = data.InspectCodeLogFilePath;
});
+Task("Lint-Documentation")
+ .Does((data) =>
+{
+ var settings =
+ MarkdownlintNodeJsRunnerSettings.ForDirectory(
+ data.IssuesData.RepositoryRootDirectory.Combine("docs"));
+ settings.OutputFile = data.MarkdownlintCliLogFilePath;
+ settings.ThrowOnIssue = false;
+ RunMarkdownlintNodeJs(settings);
+
+ // Pass path to markdownlint-cli log file to Cake.Issues.Recipe
+ IssuesParameters.InputFiles.MarkdownlintCliLogFilePath = data.MarkdownlintCliLogFilePath;
+});
+
Task("Lint")
- .IsDependentOn("Run-InspectCode");
+ .IsDependentOn("Run-InspectCode")
+ .IsDependentOn("Lint-Documentation");
// Make sure build and linters run before issues task.
IssuesBuildTasks.ReadIssuesTask