Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Aug 22, 2020
2 parents 836e131 + 7981ffb commit 3f0d339
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These owners will be the default owners for everything in the repo and
# will be requested for review when someone opens a pull request.
* @pascalberger @christianbumann @x-jokay @silanosa @georgesgoetz
* @cake-contrib/team-bbt @x-jokay
34 changes: 20 additions & 14 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,26 @@ The [Cake.Issues.Markdownlint addin] provides the following features.

# Supported IIssue properties

| | Property | Remarks |
|--------------------------------------------------------------------|-----------------------------------|--------------------------------|
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.ProviderType` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.ProviderName` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.ProjectName` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.ProjectFileRelativePath` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.AffectedFileRelativePath` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Line` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.MessageText` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.MessageHtml` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.MessageMarkdown` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Priority` | Always [IssuePriority.Warning] |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.PriorityName` | Always `Warning` |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Rule` | |
| | Property | Remarks |
|--------------------------------------------------------------------|-----------------------------------|----------------------------------|
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.ProviderType` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.ProviderName` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.Run` | Can be set while reading issues |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Identifier` | Set to `IIssue.MessageText` |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.ProjectName` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.ProjectFileRelativePath` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.AffectedFileRelativePath` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Line` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.EndLine` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.Column` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.EndColumn` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.FileLink` | Can be set while reading issues |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.MessageText` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.MessageHtml` | |
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.MessageMarkdown` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Priority` | Always [IssuePriority.Warning] |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.PriorityName` | Always `Warning` |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Rule` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.RuleUrl` | Support for custom rules can be added through a custom [MarkdownlintAddRuleUrlResolver] |

[Cake.Issues.Markdownlint addin]: https://www.nuget.org/packages/Cake.Issues.Markdownlint
Expand Down
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.Markdownlint.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Markdownlint.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Cake-IssueProvider Linting Markdownlint</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.8.2</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Markdownlint/releases/tag/0.9.0</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Testfiles\MarkdownlintCliLogFileFormat\markdownlint-cli-0.22.0.log" />
<EmbeddedResource Include="Testfiles\MarkdownlintLogFileFormat\markdownlint.json" />
<EmbeddedResource Include="Testfiles\MarkdownlintV1LogFileFormat\markdownlint.json" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand All @@ -38,10 +38,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Issues">
<Version>0.8.0</Version>
<Version>0.9.0</Version>
</PackageReference>
<PackageReference Include="Cake.Issues.Testing">
<Version>0.8.0</Version>
<Version>0.9.0</Version>
</PackageReference>
<PackageReference Include="Cake.Testing">
<Version>0.33.0</Version>
Expand All @@ -54,11 +54,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit">
<Version>2.4.1</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.1</Version>
<Version>2.4.2</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 @@ -7,15 +7,15 @@
using Shouldly;
using Xunit;

public sealed class MarkdownlintLogFileFormatTests
public sealed class MarkdownlintV1LogFileFormatTests
{
public sealed class TheCtor
{
[Fact]
public void Should_Throw_If_Log_Is_Null()
{
// Given / When
var result = Record.Exception(() => new MarkdownlintLogFileFormat(null));
var result = Record.Exception(() => new MarkdownlintV1LogFileFormat(null));

// Then
result.IsArgumentNullException("log");
Expand All @@ -28,7 +28,7 @@ public sealed class TheReadIssuesMethod
public void Should_Read_Issues_Correct()
{
// Given
var fixture = new MarkdownlintIssuesProviderFixture<MarkdownlintLogFileFormat>("markdownlint.json");
var fixture = new MarkdownlintIssuesProviderFixture<MarkdownlintV1LogFileFormat>("markdownlint.json");

// When
var issues = fixture.ReadIssues().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ internal class MarkdownlintIssuesProviderFixture<T>
public MarkdownlintIssuesProviderFixture(string fileResourceName)
: base(fileResourceName)
{
this.RepositorySettings =
new RepositorySettings(@"c:\Source\Cake.Issues");
this.ReadIssuesSettings =
new ReadIssuesSettings(@"c:\Source\Cake.Issues");
}

protected override string FileResourceNamespace => "Cake.Issues.Markdownlint.Tests.Testfiles." + typeof(T).Name + ".";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Should_Throw_If_Log_Is_Null()
var result = Record.Exception(() =>
new MarkdownlintIssuesProvider(
log,
new MarkdownlintIssuesSettings("Foo".ToByteArray(), new MarkdownlintLogFileFormat(new FakeLog()))));
new MarkdownlintIssuesSettings("Foo".ToByteArray(), new MarkdownlintV1LogFileFormat(new FakeLog()))));

// Then
result.IsArgumentNullException("log");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Should_Throw_If_LogFilePath_Is_Null()
{
// Given
FilePath logFilePath = null;
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var result = Record.Exception(() =>
Expand All @@ -34,7 +34,7 @@ public void Should_Throw_If_Format_For_LogFilePath_Is_Null()
// Given
BaseMarkdownlintLogFileFormat format = null;

using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintLogFileFormat.markdownlint.json"))
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintV1LogFileFormat.markdownlint.json"))
{
// When
var result = Record.Exception(() =>
Expand All @@ -50,7 +50,7 @@ public void Should_Throw_If_LogFileContent_Is_Null()
{
// Given
byte[] logFileContent = null;
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var result = Record.Exception(() =>
Expand Down Expand Up @@ -80,7 +80,7 @@ public void Should_Set_LogFileContent()
{
// Given
var logFileContent = "Foo".ToByteArray();
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var settings = new MarkdownlintIssuesSettings(logFileContent, format);
Expand All @@ -94,7 +94,7 @@ public void Should_Set_LogFileContent_If_Empty()
{
// Given
byte[] logFileContent = Array.Empty<byte>();
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var settings = new MarkdownlintIssuesSettings(logFileContent, format);
Expand All @@ -107,8 +107,8 @@ public void Should_Set_LogFileContent_If_Empty()
public void Should_Set_LogFileContent_From_LogFilePath()
{
// Given
var format = new MarkdownlintLogFileFormat(new FakeLog());
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintLogFileFormat.markdownlint.json"))
var format = new MarkdownlintV1LogFileFormat(new FakeLog());
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintV1LogFileFormat.markdownlint.json"))
{
// When
var settings = new MarkdownlintIssuesSettings(tempFile.FileName, format);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Version>0.33.0</Version>
</PackageReference>
<PackageReference Include="Cake.Issues">
<Version>0.8.0</Version>
<Version>0.9.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<Version>3.0.0</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MarkdownlintCliLogFileFormat(ICakeLog log)
/// <inheritdoc />
public override IEnumerable<IIssue> ReadIssues(
MarkdownlintIssuesProvider issueProvider,
RepositorySettings repositorySettings,
IRepositorySettings repositorySettings,
MarkdownlintIssuesSettings markdownlintIssuesSettings)
{
issueProvider.NotNull(nameof(issueProvider));
Expand Down Expand Up @@ -65,7 +65,7 @@ public override IEnumerable<IIssue> ReadIssues(
/// <returns>True if the file path could be parsed.</returns>
private bool TryGetFile(
GroupCollection values,
RepositorySettings repositorySettings,
IRepositorySettings repositorySettings,
out string fileName)
{
fileName = values["filePath"].Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text;
using Cake.Core.Diagnostics;

/// <summary>
/// Logfile format as written by Markdownlint.
/// Logfile format as written by Markdownlint with <c>options.resultVersion</c> set to 1.
/// </summary>
internal class MarkdownlintLogFileFormat : BaseMarkdownlintLogFileFormat
internal class MarkdownlintV1LogFileFormat : BaseMarkdownlintLogFileFormat
{
/// <summary>
/// Initializes a new instance of the <see cref="MarkdownlintLogFileFormat"/> class.
/// Initializes a new instance of the <see cref="MarkdownlintV1LogFileFormat"/> class.
/// </summary>
/// <param name="log">The Cake log instance.</param>
public MarkdownlintLogFileFormat(ICakeLog log)
public MarkdownlintV1LogFileFormat(ICakeLog log)
: base(log)
{
}

/// <inheritdoc />
public override IEnumerable<IIssue> ReadIssues(
MarkdownlintIssuesProvider issueProvider,
RepositorySettings repositorySettings,
IRepositorySettings repositorySettings,
MarkdownlintIssuesSettings markdownlintIssuesSettings)
{
issueProvider.NotNull(nameof(issueProvider));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
public static partial class MarkdownlintIssuesAliases
{
/// <summary>
/// Gets an instance for the log format as written by Markdownlint.
/// Gets an instance for the log format as written by Markdownlint with <c>options.resultVersion</c> set to 1.
/// </summary>
/// <param name="context">The context.</param>
/// <returns>Instance for the Markdownlint log format.</returns>
/// <returns>Instance for the Markdownlint V1 log format.</returns>
[CakePropertyAlias]
[CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)]
public static BaseMarkdownlintLogFileFormat MarkdownlintLogFileFormat(
public static BaseMarkdownlintLogFileFormat MarkdownlintV1LogFileFormat(
this ICakeContext context)
{
context.NotNull(nameof(context));

return new MarkdownlintLogFileFormat(context.Log);
return new MarkdownlintV1LogFileFormat(context.Log);
}
}
}
2 changes: 1 addition & 1 deletion src/Cake.Issues.Markdownlint/MarkdownlintIssuesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public MarkdownlintIssuesProvider(ICakeLog log, MarkdownlintIssuesSettings setti
/// This name can be used to identify issues based on the <see cref="IIssue.ProviderType"/> property.
/// </summary>
public static string ProviderTypeName => typeof(MarkdownlintIssuesProvider).FullName;

/// <inheritdoc />
public override string ProviderName => "markdownlint";
}
Expand Down

0 comments on commit 3f0d339

Please sign in to comment.