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

Commit

Permalink
Merge branch 'release/0.9.1' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Oct 20, 2020
2 parents 60a849a + 08ed83f commit 0be730c
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
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.
* @cake-contrib/team-bbt @x-jokay
* @cake-contrib/team-cake-issues
6 changes: 3 additions & 3 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The [Cake.Issues.MsBuild addin] provides the following features.

# Basic features

* Reads warnings from MSBuild log files.
* Reads errors and warnings from MSBuild log files.
* Provides URLs for all code analysis (`CA*`) and StyleCop (`SA*`) warnings.
* Support for custom URL resolving using the [MsBuildAddRuleUrlResolver] alias.

Expand Down Expand Up @@ -35,8 +35,8 @@ The [Cake.Issues.MsBuild addin] provides the following features.
| <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.Priority` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.PriorityName` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Rule` | |
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.RuleUrl` | For code analysis (`CA*`) and StyleCop (`SA*`) warnings. Support for additional rules can be added through a custom [MsBuildAddRuleUrlResolver] |

Expand Down
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.MsBuild.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.MsBuild.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Cake-IssueProvider CodeAnalysis Linting MsBuild</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/0.9.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/0.9.1</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand Down
1 change: 1 addition & 0 deletions recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BuildParameters.SetParameters(
repositoryName: "Cake.Issues.MsBuild",
appVeyorAccountName: "cakecontrib",
shouldGenerateDocumentation: false,
shouldPublishMyGet: false,
shouldRunCodecov: false,
shouldRunGitVersion: true);

Expand Down
30 changes: 5 additions & 25 deletions src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,28 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Testfiles\FullLog.binlog" />
<None Remove="Testfiles\FullLog.xml" />
<None Remove="Testfiles\IssueWithFile.xml" />
<None Remove="Testfiles\IssueWithLineZero.xml" />
<None Remove="Testfiles\IssueWithOnlyFileName.xml" />
<None Remove="Testfiles\IssueWithoutCode.xml" />
<None Remove="Testfiles\IssueWithoutFile.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\IssueWithAbsoluteFileNameAndWithoutTask.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\IssueWithoutMessage.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\LogWithControlChars.xml" />
<None Remove="Testfiles\**\*" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Testfiles\BinaryLogFileFormat\FullLog.binlog" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\FullLog.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithoutCode.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithFile.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithLineZero.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithOnlyFileName.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithoutMessage.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithoutFile.xml" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\LogWithControlChars.xml" />
<EmbeddedResource Include="Testfiles\BinaryLogFileFormat\*.binlog" />
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\*.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Cake.Issues" Version="0.9.0" />
<PackageReference Include="Cake.Issues.Testing" Version="0.9.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Cake.Issues.MsBuild\Cake.Issues.MsBuild.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithAbsoluteFileNameAndWithoutTask.xml" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,62 @@ public void Should_Read_Issue_With_Absolute_FileName_And_Without_Task()
}
}
}

[Fact]
public void Should_Read_Errors()
{
// Given
var fixture = new MsBuildIssuesProviderFixture<XmlFileLoggerLogFileFormat>("IssueWithError.xml");

// When
var issues = fixture.ReadIssues().ToList();

// Then
issues.Count.ShouldBe(1);
IssueChecker.Check(
issues[0],
IssueBuilder.NewIssue(
@"'ConfigurationManager.GetSortedConfigFiles(String)': not all code paths return a value",
"Cake.Issues.MsBuild.MsBuildIssuesProvider",
"MSBuild")
.InProjectOfName(string.Empty)
.InFile(@"src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs", 1311)
.OfRule("CS0161", null)
.WithPriority(IssuePriority.Error));
}

[Fact]
public void Should_Read_Both_Warnings_And_Errors()
{
// Given
var fixture = new MsBuildIssuesProviderFixture<XmlFileLoggerLogFileFormat>("IssueWithBothWarningAndErrors.xml");

// When
var issues = fixture.ReadIssues().ToList();

// Then
issues.Count.ShouldBe(2);
IssueChecker.Check(
issues[0],
IssueBuilder.NewIssue(
@"Microsoft.Usage : 'ConfigurationManager.GetSortedConfigFiles(String)' creates an exception of type 'ApplicationException', an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type.",
"Cake.Issues.MsBuild.MsBuildIssuesProvider",
"MSBuild")
.InProjectOfName(string.Empty)
.InFile(@"src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs", 1311)
.OfRule("CA2201", new Uri("https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com"))
.WithPriority(IssuePriority.Warning));
IssueChecker.Check(
issues[1],
IssueBuilder.NewIssue(
@"'ConfigurationManager.GetSortedConfigFiles(String)': not all code paths return a value",
"Cake.Issues.MsBuild.MsBuildIssuesProvider",
"MSBuild")
.InProjectOfName(string.Empty)
.InFile(@"src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs", 1311)
.OfRule("CS0161", null)
.WithPriority(IssuePriority.Error));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<build started="3/7/2017 8:31:20 AM">
<warning code="CA2201" file="src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs" line="1311" column="0"><![CDATA[Microsoft.Usage : 'ConfigurationManager.GetSortedConfigFiles(String)' creates an exception of type 'ApplicationException', an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type.]]></warning>
<error code="CS0161" file="src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs" line="1311" column="0"><![CDATA['ConfigurationManager.GetSortedConfigFiles(String)': not all code paths return a value]]></error>
</build>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<build started="3/7/2017 8:31:20 AM">
<error code="CS0161" file="src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs" line="1311" column="0"><![CDATA['ConfigurationManager.GetSortedConfigFiles(String)': not all code paths return a value]]></error>
</build>
2 changes: 1 addition & 1 deletion src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Issues" Version="0.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.0.174" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 0be730c

Please sign in to comment.