From 862a2a1deaa2452af180536a241a347a98e825bd Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Sat, 14 Oct 2017 15:42:09 -0400 Subject: [PATCH 01/26] Modify tests that rely on checking invalid path chars, so that they use an char that is invalid in both windows & linux --- src/Cake.Issues.Tests/IssueOfTTests.cs | 4 ++-- src/Cake.Issues.Tests/IssueTests.cs | 2 +- src/Cake.Issues.Tests/StringPathExtensionsTests.cs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Cake.Issues.Tests/IssueOfTTests.cs b/src/Cake.Issues.Tests/IssueOfTTests.cs index a612eb1ae..944774887 100644 --- a/src/Cake.Issues.Tests/IssueOfTTests.cs +++ b/src/Cake.Issues.Tests/IssueOfTTests.cs @@ -10,7 +10,7 @@ public class IssueOfTTests public sealed class TheCtor { [Theory] - [InlineData(@"foo @"c:\foo "c:\\foo\tbar".IsFullPath()); // Then result.IsArgumentException("path"); @@ -183,7 +183,7 @@ public void Should_Throw_If_Path_Is_WhiteSpace() public void Should_Throw_If_Path_Is_Invalid() { // Given / When - var result = Record.Exception(() => @"c:\foo "c:\\foo\tbar".IsSubpathOf(@"c:\foo")); // Then result.IsArgumentException("path"); @@ -223,7 +223,7 @@ public void Should_Throw_If_BaseDirPath_Is_WhiteSpace() public void Should_Throw_If_BaseDirPath_Is_Invalid() { // Given / When - var result = Record.Exception(() => @"c:\foo\bar".IsSubpathOf(@"c:\f @"c:\foo\bar".IsSubpathOf("c:\\f\to")); // Then result.IsArgumentException("baseDirPath"); @@ -361,7 +361,7 @@ public void Should_Throw_If_Path_Is_WhiteSpace() public void Should_Throw_If_Path_Is_Invalid() { // Given / When - var result = Record.Exception(() => @"c:\foo "c:\\foo\tbar".NormalizePath()); // Then result.IsArgumentException("path"); From 76679b11fa52d68b25f6bbdbd13348651a8a179e Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Sat, 14 Oct 2017 15:46:59 -0400 Subject: [PATCH 02/26] - convert to new solution format - multi-target .net standard 1.6 & framework 4.6 --- .../Cake.Issues.Testing.csproj | 97 +++---------- .../Properties/AssemblyInfo.cs | 25 ---- src/Cake.Issues.Testing/packages.config | 12 -- .../Cake.Issues.Tests.csproj | 137 +++++------------- .../Properties/AssemblyInfo.cs | 24 +-- src/Cake.Issues.Tests/packages.config | 14 -- src/Cake.Issues/Cake.Issues.csproj | 105 +++----------- src/Cake.Issues/Properties/AssemblyInfo.cs | 26 ---- src/Cake.Issues/packages.config | 11 -- 9 files changed, 74 insertions(+), 377 deletions(-) delete mode 100644 src/Cake.Issues.Testing/packages.config delete mode 100644 src/Cake.Issues.Tests/packages.config delete mode 100644 src/Cake.Issues/packages.config diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index 217864679..ecb27be7a 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -1,81 +1,28 @@ - - - + + - Debug - AnyCPU - {95CB4393-DCAE-4E92-960F-98C4236D703E} - Library - Properties - Cake.Issues.Testing - Cake.Issues.Testing - v4.6 - 512 - - - + netstandard1.6;net46 + Common helpers for testing addins based on Cake.Issues + BBT Software AG + BBT Software AG + Copyright © 2017 BBT Software AG and contributors + Cake.Issues - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Cake.Issues.Testing.xml - ..\Cake.Issues.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Cake.Issues.Testing.xml - ..\Cake.Issues.ruleset - - - - ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll - - - - - - - - - - - ..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll - - - - - - - - - - - - - {956ee163-6e8b-44a9-ae58-50185de4f878} - Cake.Issues - - + - + + + + + + + + + + - - - - - - + - - \ No newline at end of file + + diff --git a/src/Cake.Issues.Testing/Properties/AssemblyInfo.cs b/src/Cake.Issues.Testing/Properties/AssemblyInfo.cs index 35c320168..7ca23649b 100644 --- a/src/Cake.Issues.Testing/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Testing/Properties/AssemblyInfo.cs @@ -3,18 +3,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cake.Issues.Testing")] -[assembly: AssemblyDescription("Common helpers for testing addins based on Cake.Issues")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("BBT Software AG")] -[assembly: AssemblyProduct("Cake.Issues")] -[assembly: AssemblyCopyright("Copyright © 2017 BBT Software AG and contributors")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -23,18 +11,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("95cb4393-dcae-4e92-960f-98c4236d703e")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Cake.Issues.Tests")] \ No newline at end of file diff --git a/src/Cake.Issues.Testing/packages.config b/src/Cake.Issues.Testing/packages.config deleted file mode 100644 index c3ea7ae7e..000000000 --- a/src/Cake.Issues.Testing/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index afd962474..fc8c5fa58 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -1,110 +1,39 @@ - - - - + + - Debug - AnyCPU - {6602FB4A-353A-40B5-8469-69502F189113} - Library - Properties - Cake.Issues.Tests - Cake.Issues.Tests - v4.6 - 512 - - - + netcoreapp2.0;net46 + + false + + Cake.Issues + + Copyright © 2017 BBT Software AG and contributors + + Tests for the Cake.Issues addin + + BBT Software AG + + BBT Software AG - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\Cake.Issues.Tests.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - ..\Cake.Issues.Tests.ruleset - - - - ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll - - - ..\packages\Cake.Testing.0.22.0\lib\net46\Cake.Testing.dll - - - ..\packages\Shouldly.2.8.3\lib\net451\Shouldly.dll - - - - - - - - - - - ..\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.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll - - - ..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll - - - - - - - - - - - - - - - - - - - {95cb4393-dcae-4e92-960f-98c4236d703e} - Cake.Issues.Testing - - - {956ee163-6e8b-44a9-ae58-50185de4f878} - Cake.Issues - - - - - + - + + + + + + + + + + + + + - - + + - - - - 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.Tests/Properties/AssemblyInfo.cs b/src/Cake.Issues.Tests/Properties/AssemblyInfo.cs index e7fc5f385..cab692263 100644 --- a/src/Cake.Issues.Tests/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Tests/Properties/AssemblyInfo.cs @@ -1,17 +1,8 @@ -using System.Reflection; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Cake.Issues.Tests")] -[assembly: AssemblyDescription("Tests for the Cake.Issues addin")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("BBT Software AG")] -[assembly: AssemblyProduct("Cake.Issues")] -[assembly: AssemblyCopyright("Copyright © 2017 BBT Software AG and contributors")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -20,16 +11,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6602fb4a-353a-40b5-8469-69502f189113")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Cake.Issues.Tests/packages.config b/src/Cake.Issues.Tests/packages.config deleted file mode 100644 index 999de422a..000000000 --- a/src/Cake.Issues.Tests/packages.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 07252cfe8..7b0b5fbda 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -1,91 +1,22 @@ - - - + + - Debug - AnyCPU - {956EE163-6E8B-44A9-AE58-50185DE4F878} - Library - Properties - Cake.Issues - Cake.Issues - v4.6 - 512 - - - + netstandard1.6;net46 + Addin for reading code analyzer or linter issues for the Cake build automation system + BBT Software AG + BBT Software AG + Copyright © 2017 BBT Software AG and contributors - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\Cake.Issues.ruleset - bin\Debug\Cake.Issues.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Cake.Issues.xml - ..\Cake.Issues.ruleset - - - - ..\packages\Cake.Core.0.22.0\lib\net46\Cake.Core.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + + + + + + - - \ No newline at end of file + + diff --git a/src/Cake.Issues/Properties/AssemblyInfo.cs b/src/Cake.Issues/Properties/AssemblyInfo.cs index 0e3638e9b..4f059550c 100644 --- a/src/Cake.Issues/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues/Properties/AssemblyInfo.cs @@ -1,20 +1,7 @@ using System; -using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cake.Issues")] -[assembly: AssemblyDescription("Addin for reading code analyzer or linter issues for the Cake build automation system")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("BBT Software AG")] -[assembly: AssemblyProduct("Cake.Issues")] -[assembly: AssemblyCopyright("Copyright © 2017 BBT Software AG and contributors")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -23,18 +10,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("956ee163-6e8b-44a9-ae58-50185de4f878")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Cake.Issues.Tests")] \ No newline at end of file diff --git a/src/Cake.Issues/packages.config b/src/Cake.Issues/packages.config deleted file mode 100644 index a9329ce58..000000000 --- a/src/Cake.Issues/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file From a6cb676675e14dd947729bad14eca250a930984a Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Sat, 14 Oct 2017 20:28:17 -0400 Subject: [PATCH 03/26] changes from code review: - include xml comments, and analysis rulesets Clean compile now. --- .../Cake.Issues.Testing.csproj | 22 ++++++++++++++++++- .../Cake.Issues.Tests.csproj | 11 +++++----- src/Cake.Issues/Cake.Issues.csproj | 20 +++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index ecb27be7a..b425426fc 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -1,4 +1,4 @@ - + netstandard1.6;net46 @@ -9,6 +9,26 @@ Cake.Issues + + ..\Cake.Issues.ruleset + + + + bin\Debug\netstandard1.6\Cake.Issues.Testing.xml + + + + bin\Release\netstandard1.6\Cake.Issues.Testing.xml + + + + bin\Debug\net46\Cake.Issues.Testing.xml + + + + bin\Release\net46\Cake.Issues.Testing.xml + + diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index fc8c5fa58..e1b3ef1e9 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -2,20 +2,19 @@ netcoreapp2.0;net46 - false - Cake.Issues - Copyright © 2017 BBT Software AG and contributors - Tests for the Cake.Issues addin - BBT Software AG - BBT Software AG + + + ..\Cake.Issues.Tests.ruleset + + diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 7b0b5fbda..c0c134cb3 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -8,6 +8,26 @@ Copyright © 2017 BBT Software AG and contributors + + ..\Cake.Issues.ruleset + + + + bin\Debug\netstandard1.6\Cake.Issues.xml + + + + bin\Release\netstandard1.6\Cake.Issues.xml + + + + bin\Debug\net46\Cake.Issues.xml + + + + bin\Release\net46\Cake.Issues.xml + + From e7c076d16406b2cb52c1ebe43bacf745ce4cf740 Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Sat, 14 Oct 2017 22:38:37 -0400 Subject: [PATCH 04/26] use RunDotNetCore, and add extra exclusion for generated *.AssemblyInfo files --- setup.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cake b/setup.cake index 2634e7ee7..f9e3e42cd 100644 --- a/setup.cake +++ b/setup.cake @@ -15,9 +15,9 @@ BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings( context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Tests/*.cs" }, + dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Tests/*.cs", BuildParameters.RootDirectoryPath + "/src/Cake.Issues*/**/*.AssemblyInfo.cs" }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ", testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); -Build.Run(); +Build.RunDotNetCore(); From 6b2f8e7fbb1f4e5e831b1ddc40f960c0971050c4 Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Sat, 14 Oct 2017 22:39:27 -0400 Subject: [PATCH 05/26] Update nuspec files to include a netstandard1.6 set of files. --- nuspec/nuget/Cake.Issues.Testing.nuspec | 9 ++++++--- nuspec/nuget/Cake.Issues.nuspec | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Testing.nuspec b/nuspec/nuget/Cake.Issues.Testing.nuspec index e78d9cdbe..94c728816 100644 --- a/nuspec/nuget/Cake.Issues.Testing.nuspec +++ b/nuspec/nuget/Cake.Issues.Testing.nuspec @@ -19,8 +19,11 @@ Common helpers for testing add-ins based on Cake.Issues https://github.com/cake-contrib/Cake.Issues/releases/tag/0.1.0 - - - + + + + + + \ No newline at end of file diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec index 083a9597b..d636d9078 100644 --- a/nuspec/nuget/Cake.Issues.nuspec +++ b/nuspec/nuget/Cake.Issues.nuspec @@ -26,8 +26,11 @@ See the Project Site for an overview of the whole ecosystem of addins for workin https://github.com/cake-contrib/Cake.Issues/releases/tag/0.1.0 - - - + + + + + + \ No newline at end of file From f33519907a6791f5980901abf120c063def6de6e Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 15 Oct 2017 21:59:49 +0200 Subject: [PATCH 06/26] (GH-5) Add project to issue --- src/Cake.Issues.Tests/IssueOfTTests.cs | 51 +++++++++++++++++++++++ src/Cake.Issues.Tests/IssueTests.cs | 41 +++++++++++++++++++ src/Cake.Issues/IIssue.cs | 5 +++ src/Cake.Issues/Issue.cs | 56 ++++++++++++++++++++++++++ src/Cake.Issues/Issue{T}.cs | 48 ++++++++++++++++++++++ 5 files changed, 201 insertions(+) diff --git a/src/Cake.Issues.Tests/IssueOfTTests.cs b/src/Cake.Issues.Tests/IssueOfTTests.cs index 944774887..f09d40743 100644 --- a/src/Cake.Issues.Tests/IssueOfTTests.cs +++ b/src/Cake.Issues.Tests/IssueOfTTests.cs @@ -121,6 +121,57 @@ public void Should_Throw_If_Rule_Is_Null() result.IsArgumentNullException("rule"); } + [Fact] + public void Should_Throw_If_Provider_Type_Is_WhiteSpace() + { + // Given / When + var result = Record.Exception(() => new Issue(@"src\foo.cs", 100, "foo", 1, "foo", " ")); + + // Then + result.IsArgumentOutOfRangeException("providerType"); + } + + [Fact] + public void Should_Handle_Projects_Which_Are_Null() + { + // Given / When + var issue = new Issue(null, @"src\foo.cs", null, "Foo", 1, "Bar"); + + // Then + issue.Project.ShouldBe(null); + } + + [Fact] + public void Should_Handle_Projects_Which_Are_WhiteSpace() + { + // Given / When + var issue = new Issue(" ", @"src\foo.cs", null, "Foo", 1, "Bar"); + + // Then + issue.Project.ShouldBe(" "); + } + + [Fact] + public void Should_Handle_Projects_Which_Are_Empty() + { + // Given / When + var issue = new Issue(string.Empty, @"src\foo.cs", null, "Foo", 1, "Bar"); + + // Then + issue.Project.ShouldBe(string.Empty); + } + + [Theory] + [InlineData("project")] + public void Should_Set_Project(string project) + { + // Given / When + var issue = new Issue(project, @"src\foo.cs", null, "Foo", 1, "Bar"); + + // Then + issue.Project.ShouldBe(project); + } + [Fact] public void Should_Handle_File_Paths_Which_Are_Null() { diff --git a/src/Cake.Issues.Tests/IssueTests.cs b/src/Cake.Issues.Tests/IssueTests.cs index d670aadf1..0826937b2 100644 --- a/src/Cake.Issues.Tests/IssueTests.cs +++ b/src/Cake.Issues.Tests/IssueTests.cs @@ -133,6 +133,47 @@ public void Should_Throw_If_Provider_Type_Is_WhiteSpace() result.IsArgumentOutOfRangeException("providerType"); } + [Fact] + public void Should_Handle_Projects_Which_Are_Null() + { + // Given / When + var issue = new Issue(null, @"src\foo.cs", null, "Foo", 1, "Bar", "foo"); + + // Then + issue.Project.ShouldBe(null); + } + + [Fact] + public void Should_Handle_Projects_Which_Are_WhiteSpace() + { + // Given / When + var issue = new Issue(" ", @"src\foo.cs", null, "Foo", 1, "Bar", "foo"); + + // Then + issue.Project.ShouldBe(" "); + } + + [Fact] + public void Should_Handle_Projects_Which_Are_Empty() + { + // Given / When + var issue = new Issue(string.Empty, @"src\foo.cs", null, "Foo", 1, "Bar", "foo"); + + // Then + issue.Project.ShouldBe(string.Empty); + } + + [Theory] + [InlineData("project")] + public void Should_Set_Project(string project) + { + // Given / When + var issue = new Issue(project, @"src\foo.cs", null, "Foo", 1, "Bar", "foo"); + + // Then + issue.Project.ShouldBe(project); + } + [Fact] public void Should_Handle_File_Paths_Which_Are_Null() { diff --git a/src/Cake.Issues/IIssue.cs b/src/Cake.Issues/IIssue.cs index d10e1d8b6..af60e083c 100644 --- a/src/Cake.Issues/IIssue.cs +++ b/src/Cake.Issues/IIssue.cs @@ -8,6 +8,11 @@ /// public interface IIssue { + /// + /// Gets the name of the project to which the file affected by the issue belongs. + /// + string Project { get; } + /// /// Gets the path to the file affacted by the issue. /// The path is relative to the repository root. diff --git a/src/Cake.Issues/Issue.cs b/src/Cake.Issues/Issue.cs index f49f45d0f..b55b9d035 100644 --- a/src/Cake.Issues/Issue.cs +++ b/src/Cake.Issues/Issue.cs @@ -52,6 +52,58 @@ public Issue( string rule, Uri ruleUrl, string providerType) + : this(null, filePath, line, message, priority, rule, ruleUrl, providerType) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the project to which the file affected by the issue belongs + /// The path to the file affacted by the issue. + /// The path needs to be relative to the repository root. + /// null or if issue is not related to a change in a file. + /// The line in the file where the issues has occurred. + /// Nothing if the issue affects the whole file or an asssembly. + /// The message of the issue. + /// The priority of the message. + /// The rule of the issue. + /// The type of the issue provider. + public Issue( + string project, + string filePath, + int? line, + string message, + int priority, + string rule, + string providerType) + : this(project, filePath, line, message, priority, rule, null, providerType) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the project to which the file affected by the issue belongs + /// The path to the file affacted by the issue. + /// The path needs to be relative to the repository root. + /// null or if issue is not related to a change in a file. + /// The line in the file where the issues has occurred. + /// Nothing if the issue affects the whole file or an asssembly. + /// The message of the issue. + /// The priority of the message. + /// The rule of the issue. + /// The URL containing information about the failing rule. + /// The type of the issue provider. + public Issue( + string project, + string filePath, + int? line, + string message, + int priority, + string rule, + Uri ruleUrl, + string providerType) { line?.NotNegativeOrZero(nameof(line)); message.NotNullOrWhiteSpace(nameof(message)); @@ -79,6 +131,7 @@ public Issue( throw new ArgumentOutOfRangeException(nameof(line), "Cannot specify a line while not specifying a file."); } + this.Project = project; this.Line = line; this.Message = message; this.Priority = priority; @@ -87,6 +140,9 @@ public Issue( this.ProviderType = providerType; } + /// + public string Project { get; } + /// public FilePath AffectedFileRelativePath { get; } diff --git a/src/Cake.Issues/Issue{T}.cs b/src/Cake.Issues/Issue{T}.cs index d976aef8e..d40282236 100644 --- a/src/Cake.Issues/Issue{T}.cs +++ b/src/Cake.Issues/Issue{T}.cs @@ -53,6 +53,54 @@ public Issue( { } + /// + /// Initializes a new instance of the class. + /// + /// Name of the project to which the file affected by the issue belongs + /// The path to the file affacted by the issue. + /// The path needs to be relative to the repository root. + /// null or if issue is not related to a change in a file. + /// The line in the file where the issues has occurred. + /// Nothing if the issue affects the whole file or an asssembly. + /// The message of the issue. + /// The priority of the message. + /// The rule of the issue. + public Issue( + string project, + string filePath, + int? line, + string message, + int priority, + string rule) + : base(project, filePath, line, message, priority, rule, null, GetProviderTypeName()) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the project to which the file affected by the issue belongs + /// The path to the file affacted by the issue. + /// The path needs to be relative to the repository root. + /// null or if issue is not related to a change in a file. + /// The line in the file where the issues has occurred. + /// Nothing if the issue affects the whole file or an asssembly. + /// The message of the issue. + /// The priority of the message. + /// The rule of the issue. + /// The URL containing information about the failing rule. + public Issue( + string project, + string filePath, + int? line, + string message, + int priority, + string rule, + Uri ruleUrl) + : base(project, filePath, line, message, priority, rule, ruleUrl, GetProviderTypeName()) + { + } + /// /// Gets the name of the issue provider as it will be set to in the property. /// From 10bb8d837a29ef9db1fc48ccdfc8193ed6e514a4 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 15 Oct 2017 22:17:36 +0200 Subject: [PATCH 07/26] Update release notes --- nuspec/nuget/Cake.Issues.Testing.nuspec | 2 +- nuspec/nuget/Cake.Issues.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Testing.nuspec b/nuspec/nuget/Cake.Issues.Testing.nuspec index 94c728816..f03e7215e 100644 --- a/nuspec/nuget/Cake.Issues.Testing.nuspec +++ b/nuspec/nuget/Cake.Issues.Testing.nuspec @@ -16,7 +16,7 @@ Common helpers for testing add-ins based on Cake.Issues false Copyright © 2017 BBT Software AG and contributors Cake Script Cake-Issues Issues Testing - https://github.com/cake-contrib/Cake.Issues/releases/tag/0.1.0 + https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec index d636d9078..cf720121e 100644 --- a/nuspec/nuget/Cake.Issues.nuspec +++ b/nuspec/nuget/Cake.Issues.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 CodeAnalysis Linting Issues - https://github.com/cake-contrib/Cake.Issues/releases/tag/0.1.0 + https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 From e3a3a897ec6ee6dd540a57263c8dded33731826f Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 15 Oct 2017 22:42:01 +0200 Subject: [PATCH 08/26] (GH-8) Upgrade XUnit to 2.3.0 --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 2 +- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index b425426fc..d363f91a6 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index e1b3ef1e9..6e2f64bb1 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -21,13 +21,13 @@ - + - - - - - + + + + + From b373bd2b00f310f19e84491ce7f43a95c983b66d Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 16 Oct 2017 17:21:19 +0200 Subject: [PATCH 09/26] Use full PDB format since OpenCover doesn't support portable PDBs --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 2 ++ src/Cake.Issues/Cake.Issues.csproj | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index d363f91a6..0716885f7 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -10,6 +10,8 @@ + full + true ..\Cake.Issues.ruleset diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index c0c134cb3..75435e9c7 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -9,6 +9,8 @@ + full + true ..\Cake.Issues.ruleset From abd0003cda17b39fb20f6bc846e751f5b8662fb7 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 16 Oct 2017 17:24:26 +0200 Subject: [PATCH 10/26] Fix test cases --- src/Cake.Issues.Tests/StringPathExtensionsTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.Tests/StringPathExtensionsTests.cs b/src/Cake.Issues.Tests/StringPathExtensionsTests.cs index e3b2dd402..c84feaa8f 100644 --- a/src/Cake.Issues.Tests/StringPathExtensionsTests.cs +++ b/src/Cake.Issues.Tests/StringPathExtensionsTests.cs @@ -49,7 +49,7 @@ public void Should_Throw_If_Path_Is_WhiteSpace() [InlineData(@"c:\foo\")] [InlineData(@"c:\foo\bar")] [InlineData(@"/foo")] - [InlineData(@"/foo")] + [InlineData(@"/foo/")] [InlineData(@"/foo/bar")] public void Should_Return_True_If_Valid_Path(string path) { @@ -135,7 +135,7 @@ public void Should_Return_True_If_Full_Path(string path) [InlineData(@"\foo\")] [InlineData(@"\foo\bar")] [InlineData(@"/foo")] - [InlineData(@"/foo")] + [InlineData(@"/foo/")] [InlineData(@"/foo/bar")] public void Should_Return_False_If_Not_Full_Path(string path) { @@ -250,7 +250,7 @@ public void Should_Return_True_If_SubPath(string path, string baseDir) [InlineData(@"c:\foobar\a.txt", @"c:\foo")] [InlineData(@"c:\foobar\a.txt", @"c:\foo\")] [InlineData(@"c:\foo\a.txt", @"c:\foobar")] - [InlineData(@"c:\foo\a.txt", @"c:\foobar")] + [InlineData(@"c:\foo\a.txt", @"c:\foobar\")] public void Should_Return_False_If_Not_SubPath(string path, string baseDir) { // Given / When From ecaf6946b32fea6baafb025d9467123343708fcf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 16 Oct 2017 18:56:20 +0200 Subject: [PATCH 11/26] Fix examples --- src/Cake.Issues/Aliases.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cake.Issues/Aliases.cs b/src/Cake.Issues/Aliases.cs index 11f2cf697..3867af454 100644 --- a/src/Cake.Issues/Aliases.cs +++ b/src/Cake.Issues/Aliases.cs @@ -26,7 +26,7 @@ public static class Aliases /// MsBuildIssuesFromFilePath( /// @"C:\build\msbuild.log", /// MsBuildXmlFileLoggerFormat), - /// new DirectoryPath("c:\repo"))); + /// @"c:\repo")); /// ]]> /// /// @@ -68,7 +68,7 @@ public static IEnumerable ReadIssues( /// @"C:\build\inspectcode.log", /// MsBuildXmlFileLoggerFormat) /// }, - /// new DirectoryPath("c:\repo"))); + /// @"c:\repo")); /// ]]> /// /// @@ -104,7 +104,7 @@ public static IEnumerable ReadIssues( /// /// ReadIssues( /// /// Date: Wed, 20 Dec 2017 17:35:28 +0100 Subject: [PATCH 12/26] (GH-10) Update to Cake 0.23.0 (#11) --- 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 000000000..8615723e8 --- /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 f9e3e42cd..24d61f30f 100644 --- a/setup.cake +++ b/setup.cake @@ -9,7 +9,8 @@ BuildParameters.SetParameters( title: "Cake.Issues", repositoryOwner: "cake-contrib", repositoryName: "Cake.Issues", - appVeyorAccountName: "cakecontrib"); + appVeyorAccountName: "cakecontrib", + shouldRunCodecov: false); BuildParameters.PrintParameters(Context); diff --git a/tools/packages.config b/tools/packages.config index ea7b9500f..af3212e12 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,4 +1,4 @@ - + \ No newline at end of file From 731fed580efb4de48735b9450f881a4f83fd61dc Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 24 Dec 2017 12:21:50 +0100 Subject: [PATCH 13/26] Update XUnit to 2.3.1 (#12) --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 2 +- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index 0716885f7..b3b5b6a20 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -40,7 +40,7 @@ - + diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index 6e2f64bb1..41d88f25f 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -21,13 +21,13 @@ - + - - - - - + + + + + From b80b14680826a14f138886abc4f220a4f8a9927e Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 25 Dec 2017 14:51:16 +0100 Subject: [PATCH 14/26] Package folder is now global --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2dde0f9b3..1dbceb116 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,5 +27,4 @@ branches: # Build Cache # #---------------------------------# cache: -- src\packages -> src\**\packages.config - tools -> setup.cake From 7899e31361c362b3b1b07d560e2c30559d5f0391 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 1 Jan 2018 21:27:35 +0100 Subject: [PATCH 15/26] Remove year from copyright --- nuspec/nuget/Cake.Issues.Testing.nuspec | 2 +- nuspec/nuget/Cake.Issues.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Testing.nuspec b/nuspec/nuget/Cake.Issues.Testing.nuspec index f03e7215e..08153b367 100644 --- a/nuspec/nuget/Cake.Issues.Testing.nuspec +++ b/nuspec/nuget/Cake.Issues.Testing.nuspec @@ -14,7 +14,7 @@ Common helpers for testing add-ins based on Cake.Issues http://cake-contrib.github.io/Cake.Issues.Website/ 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 Issues Testing https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec index cf720121e..c42cf6296 100644 --- a/nuspec/nuget/Cake.Issues.nuspec +++ b/nuspec/nuget/Cake.Issues.nuspec @@ -21,7 +21,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin http://cake-contrib.github.io/Cake.Issues.Website/ 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 CodeAnalysis Linting Issues https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 From 38d1e618b506f0085d504ac1149e68cec55d789a Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Tue, 6 Mar 2018 21:17:45 +0100 Subject: [PATCH 16/26] Pin Cake.Recipe version (#15) Fix version due to https://github.com/cake-contrib/Cake.Recipe/issues/200 --- setup.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cake b/setup.cake index 24d61f30f..aeb5a5940 100644 --- a/setup.cake +++ b/setup.cake @@ -1,4 +1,4 @@ -#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease +#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&version=0.3.0-unstable0350 Environment.SetVariableNames(); From 85b94213a6783803733763940aab3275cfcb08b4 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Tue, 6 Mar 2018 22:57:31 +0100 Subject: [PATCH 17/26] Use latest version of Cake.Recipe --- setup.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cake b/setup.cake index aeb5a5940..24d61f30f 100644 --- a/setup.cake +++ b/setup.cake @@ -1,4 +1,4 @@ -#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&version=0.3.0-unstable0350 +#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease Environment.SetVariableNames(); From ee0fb20e10bf74fd5e1f03618e52ebbfd4689ce3 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 4 Mar 2018 21:24:06 +0100 Subject: [PATCH 18/26] Target .NET Standard 2.0 --- nuspec/nuget/Cake.Issues.Testing.nuspec | 6 +++--- nuspec/nuget/Cake.Issues.nuspec | 6 +++--- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 10 +++++----- src/Cake.Issues/Cake.Issues.csproj | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Testing.nuspec b/nuspec/nuget/Cake.Issues.Testing.nuspec index 08153b367..d3efe0035 100644 --- a/nuspec/nuget/Cake.Issues.Testing.nuspec +++ b/nuspec/nuget/Cake.Issues.Testing.nuspec @@ -22,8 +22,8 @@ Common helpers for testing add-ins based on Cake.Issues - - - + + + \ No newline at end of file diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec index c42cf6296..ba946a2f5 100644 --- a/nuspec/nuget/Cake.Issues.nuspec +++ b/nuspec/nuget/Cake.Issues.nuspec @@ -29,8 +29,8 @@ See the Project Site for an overview of the whole ecosystem of addins for workin - - - + + + \ No newline at end of file diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index b3b5b6a20..3f90d1f29 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -1,7 +1,7 @@  - netstandard1.6;net46 + netstandard2.0;net46 Common helpers for testing addins based on Cake.Issues BBT Software AG BBT Software AG @@ -15,12 +15,12 @@ ..\Cake.Issues.ruleset - - bin\Debug\netstandard1.6\Cake.Issues.Testing.xml + + bin\Debug\netstandard2.0\Cake.Issues.Testing.xml - - bin\Release\netstandard1.6\Cake.Issues.Testing.xml + + bin\Release\netstandard2.0\Cake.Issues.Testing.xml diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 75435e9c7..311b42e5f 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -1,7 +1,7 @@  - netstandard1.6;net46 + netstandard2.0;net46 Addin for reading code analyzer or linter issues for the Cake build automation system BBT Software AG BBT Software AG @@ -14,12 +14,12 @@ ..\Cake.Issues.ruleset - - bin\Debug\netstandard1.6\Cake.Issues.xml + + bin\Debug\netstandard2.0\Cake.Issues.xml - - bin\Release\netstandard1.6\Cake.Issues.xml + + bin\Release\netstandard2.0\Cake.Issues.xml From 86c9c446780518a10a97890f9ecc84cccc3351db Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 4 Mar 2018 21:25:47 +0100 Subject: [PATCH 19/26] (GH-13) Build against Cake 0.26.0 --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 2 +- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 4 ++-- src/Cake.Issues/Cake.Issues.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index 3f90d1f29..2298050e2 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index 41d88f25f..64896e0ea 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 311b42e5f..2cfc9167b 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -31,7 +31,7 @@ - + From 1a39e5faeafb3e12f490f08be3118afdb1bbcf98 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 7 Mar 2018 21:54:38 +0100 Subject: [PATCH 20/26] Remove year from copyright in package properties --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 2 +- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 2 +- src/Cake.Issues/Cake.Issues.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index 2298050e2..c7221c4af 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -5,7 +5,7 @@ Common helpers for testing addins based on Cake.Issues BBT Software AG BBT Software AG - Copyright © 2017 BBT Software AG and contributors + Copyright © BBT Software AG and contributors Cake.Issues diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index 64896e0ea..59801adc1 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -4,7 +4,7 @@ netcoreapp2.0;net46 false Cake.Issues - Copyright © 2017 BBT Software AG and contributors + Copyright © BBT Software AG and contributors Tests for the Cake.Issues addin BBT Software AG BBT Software AG diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 2cfc9167b..304be7b36 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -5,7 +5,7 @@ Addin for reading code analyzer or linter issues for the Cake build automation system BBT Software AG BBT Software AG - Copyright © 2017 BBT Software AG and contributors + Copyright © BBT Software AG and contributors From e8102032c7cb31696a9cf97eedf54a349446e362 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 7 Mar 2018 22:02:40 +0100 Subject: [PATCH 21/26] Only target .NET Standard 2.0 --- nuspec/nuget/Cake.Issues.Testing.nuspec | 3 --- nuspec/nuget/Cake.Issues.nuspec | 3 --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 10 +--------- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 3 +-- src/Cake.Issues/Cake.Issues.csproj | 10 +--------- 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.Testing.nuspec b/nuspec/nuget/Cake.Issues.Testing.nuspec index d3efe0035..7e2d46a55 100644 --- a/nuspec/nuget/Cake.Issues.Testing.nuspec +++ b/nuspec/nuget/Cake.Issues.Testing.nuspec @@ -19,9 +19,6 @@ Common helpers for testing add-ins based on Cake.Issues https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 - - - diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec index ba946a2f5..505d2d2f2 100644 --- a/nuspec/nuget/Cake.Issues.nuspec +++ b/nuspec/nuget/Cake.Issues.nuspec @@ -26,9 +26,6 @@ See the Project Site for an overview of the whole ecosystem of addins for workin https://github.com/cake-contrib/Cake.Issues/releases/tag/0.2.0 - - - diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index c7221c4af..9e3727099 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net46 + netstandard2.0 Common helpers for testing addins based on Cake.Issues BBT Software AG BBT Software AG @@ -23,14 +23,6 @@ bin\Release\netstandard2.0\Cake.Issues.Testing.xml - - bin\Debug\net46\Cake.Issues.Testing.xml - - - - bin\Release\net46\Cake.Issues.Testing.xml - - diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index 59801adc1..f7befa70a 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0;net46 + netcoreapp2.0 false Cake.Issues Copyright © BBT Software AG and contributors @@ -10,7 +10,6 @@ BBT Software AG - ..\Cake.Issues.Tests.ruleset diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 304be7b36..4c0d68447 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net46 + netstandard2.0 Addin for reading code analyzer or linter issues for the Cake build automation system BBT Software AG BBT Software AG @@ -22,14 +22,6 @@ bin\Release\netstandard2.0\Cake.Issues.xml - - bin\Debug\net46\Cake.Issues.xml - - - - bin\Release\net46\Cake.Issues.xml - - From 62c68fa894bb578dc89312e3d52d5617b3355cbf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 7 Mar 2018 22:19:28 +0100 Subject: [PATCH 22/26] Update to Microsoft.CodeAnalysis.FxCopAnalyzers 2.6.0 --- src/Cake.Issues.Testing/Cake.Issues.Testing.csproj | 7 +------ src/Cake.Issues/Cake.Issues.csproj | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj index 9e3727099..267e309db 100644 --- a/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj +++ b/src/Cake.Issues.Testing/Cake.Issues.Testing.csproj @@ -25,13 +25,8 @@ - - - + - - - diff --git a/src/Cake.Issues/Cake.Issues.csproj b/src/Cake.Issues/Cake.Issues.csproj index 4c0d68447..9fca9f598 100644 --- a/src/Cake.Issues/Cake.Issues.csproj +++ b/src/Cake.Issues/Cake.Issues.csproj @@ -24,13 +24,8 @@ - - - + - - - From a9109079ea797380e473b39083265a10d41e8ccf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 7 Mar 2018 22:20:20 +0100 Subject: [PATCH 23/26] Update Shouldly to 3.0.0 --- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index f7befa70a..da1b408f0 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -18,7 +18,7 @@ - + From 461d1360ec83c95881b8ca9d50bf5377d89fec19 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 7 Mar 2018 22:21:32 +0100 Subject: [PATCH 24/26] Update Microsoft.NET.Test.Sdk to 15.6.0 --- src/Cake.Issues.Tests/Cake.Issues.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj index da1b408f0..68c8829cd 100644 --- a/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj +++ b/src/Cake.Issues.Tests/Cake.Issues.Tests.csproj @@ -15,7 +15,7 @@ - + From 1a073b796ade4304c25224926c8d171ba13a286d Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 21 May 2018 21:25:18 +0200 Subject: [PATCH 25/26] Improve comments --- src/Cake.Issues.Tests/IssueTests.cs | 1 + src/Cake.Issues/IIssue.cs | 4 +++- src/Cake.Issues/Issue.cs | 32 ++++++++++++++++++----------- src/Cake.Issues/Issue{T}.cs | 32 ++++++++++++++++++----------- 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/src/Cake.Issues.Tests/IssueTests.cs b/src/Cake.Issues.Tests/IssueTests.cs index 0826937b2..07c732de8 100644 --- a/src/Cake.Issues.Tests/IssueTests.cs +++ b/src/Cake.Issues.Tests/IssueTests.cs @@ -249,6 +249,7 @@ public void Should_Set_Message(string message) } [Theory] + [InlineData("")] [InlineData("rule")] public void Should_Set_Rule(string rule) { diff --git a/src/Cake.Issues/IIssue.cs b/src/Cake.Issues/IIssue.cs index af60e083c..02f2d0369 100644 --- a/src/Cake.Issues/IIssue.cs +++ b/src/Cake.Issues/IIssue.cs @@ -10,6 +10,7 @@ public interface IIssue { /// /// Gets the name of the project to which the file affected by the issue belongs. + /// Can be null or if issue is not related to a project. /// string Project { get; } @@ -22,7 +23,7 @@ public interface IIssue /// /// Gets the line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// int? Line { get; } @@ -38,6 +39,7 @@ public interface IIssue /// /// Gets the rule of the issue. + /// Can be if the issue provider provides no rule. /// string Rule { get; } diff --git a/src/Cake.Issues/Issue.cs b/src/Cake.Issues/Issue.cs index b55b9d035..a5d990539 100644 --- a/src/Cake.Issues/Issue.cs +++ b/src/Cake.Issues/Issue.cs @@ -15,10 +15,11 @@ public class Issue : IIssue /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. + /// The rule of the issue. + /// if issue has no specific rule ID. /// The type of the issue provider. public Issue( string filePath, @@ -38,11 +39,13 @@ public Issue( /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. - /// The URL containing information about the failing rule. + /// The rule of the issue. + /// if issue has no specific rule ID. + /// The URL containing information about the failing rule. + /// null if no URL is available. /// The type of the issue provider. public Issue( string filePath, @@ -59,15 +62,17 @@ public Issue( /// /// Initializes a new instance of the class. /// - /// Name of the project to which the file affected by the issue belongs + /// Name of the project to which the file affected by the issue belongs. + /// null or if issue is not related to a project. /// The path to the file affacted by the issue. /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. + /// The rule of the issue. + /// if issue has no specific rule ID. /// The type of the issue provider. public Issue( string project, @@ -84,16 +89,19 @@ public Issue( /// /// Initializes a new instance of the class. /// - /// Name of the project to which the file affected by the issue belongs + /// Name of the project to which the file affected by the issue belongs. + /// null or if issue is not related to a project. /// The path to the file affacted by the issue. /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. - /// The URL containing information about the failing rule. + /// The rule of the issue. + /// if issue has no specific rule ID. + /// The URL containing information about the failing rule. + /// null if no URL is available. /// The type of the issue provider. public Issue( string project, diff --git a/src/Cake.Issues/Issue{T}.cs b/src/Cake.Issues/Issue{T}.cs index d40282236..a0635a9f2 100644 --- a/src/Cake.Issues/Issue{T}.cs +++ b/src/Cake.Issues/Issue{T}.cs @@ -16,10 +16,11 @@ public class Issue : Issue /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. + /// The rule of the issue. + /// if issue has no specific rule ID. public Issue( string filePath, int? line, @@ -37,11 +38,13 @@ public Issue( /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. - /// The URL containing information about the failing rule. + /// The rule of the issue. + /// if issue has no specific rule ID. + /// The URL containing information about the failing rule. + /// null if no URL is available. public Issue( string filePath, int? line, @@ -56,15 +59,17 @@ public Issue( /// /// Initializes a new instance of the class. /// - /// Name of the project to which the file affected by the issue belongs + /// Name of the project to which the file affected by the issue belongs. + /// null or if issue is not related to a project. /// The path to the file affacted by the issue. /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. + /// The rule of the issue. + /// if issue has no specific rule ID. public Issue( string project, string filePath, @@ -79,16 +84,19 @@ public Issue( /// /// Initializes a new instance of the class. /// - /// Name of the project to which the file affected by the issue belongs + /// Name of the project to which the file affected by the issue belongs. + /// null or if issue is not related to a project. /// The path to the file affacted by the issue. /// The path needs to be relative to the repository root. /// null or if issue is not related to a change in a file. /// The line in the file where the issues has occurred. - /// Nothing if the issue affects the whole file or an asssembly. + /// null if the issue affects the whole file or an asssembly. /// The message of the issue. /// The priority of the message. - /// The rule of the issue. - /// The URL containing information about the failing rule. + /// The rule of the issue. + /// if issue has no specific rule ID. + /// The URL containing information about the failing rule. + /// null if no URL is available. public Issue( string project, string filePath, From 2861b52a82eb5502e966d0857e9619f5a1a2dc6d Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 21 May 2018 22:08:43 +0200 Subject: [PATCH 26/26] (GH-20) Support null for IIssue.Rule --- src/Cake.Issues.Tests/IssueOfTTests.cs | 28 ++++---------------------- src/Cake.Issues.Tests/IssueTests.cs | 11 +--------- src/Cake.Issues/IIssue.cs | 2 +- src/Cake.Issues/Issue.cs | 9 ++++----- src/Cake.Issues/Issue{T}.cs | 8 ++++---- 5 files changed, 14 insertions(+), 44 deletions(-) diff --git a/src/Cake.Issues.Tests/IssueOfTTests.cs b/src/Cake.Issues.Tests/IssueOfTTests.cs index f09d40743..93f1badc7 100644 --- a/src/Cake.Issues.Tests/IssueOfTTests.cs +++ b/src/Cake.Issues.Tests/IssueOfTTests.cs @@ -109,18 +109,6 @@ public void Should_Throw_If_Message_Is_WhiteSpace() result.IsArgumentOutOfRangeException("message"); } - [Fact] - public void Should_Throw_If_Rule_Is_Null() - { - // Given / When - var result = - Record.Exception(() => - new Issue(@"src\foo.cs", 100, "foo", 1, null)); - - // Then - result.IsArgumentNullException("rule"); - } - [Fact] public void Should_Throw_If_Provider_Type_Is_WhiteSpace() { @@ -247,6 +235,8 @@ public void Should_Set_Message(string message) } [Theory] + [InlineData(null)] + [InlineData("")] [InlineData("rule")] public void Should_Set_Rule(string rule) { @@ -370,18 +360,6 @@ public void Should_Throw_If_Message_Is_WhiteSpace() result.IsArgumentOutOfRangeException("message"); } - [Fact] - public void Should_Throw_If_Rule_Is_Null() - { - // Given / When - var result = - Record.Exception(() => - new Issue(@"src\foo.cs", 100, "foo", 1, null, new Uri("https://google.com"))); - - // Then - result.IsArgumentNullException("rule"); - } - [Fact] public void Should_Handle_File_Paths_Which_Are_Null() { @@ -457,6 +435,8 @@ public void Should_Set_Message(string message) } [Theory] + [InlineData(null)] + [InlineData("")] [InlineData("rule")] public void Should_Set_Rule(string rule) { diff --git a/src/Cake.Issues.Tests/IssueTests.cs b/src/Cake.Issues.Tests/IssueTests.cs index 07c732de8..71ebd0db1 100644 --- a/src/Cake.Issues.Tests/IssueTests.cs +++ b/src/Cake.Issues.Tests/IssueTests.cs @@ -93,16 +93,6 @@ public void Should_Throw_If_Message_Is_WhiteSpace() result.IsArgumentOutOfRangeException("message"); } - [Fact] - public void Should_Throw_If_Rule_Is_Null() - { - // Given / When - var result = Record.Exception(() => new Issue(@"src\foo.cs", 100, "foo", 1, null, "foo")); - - // Then - result.IsArgumentNullException("rule"); - } - [Fact] public void Should_Throw_If_Provider_Type_Is_Null() { @@ -249,6 +239,7 @@ public void Should_Set_Message(string message) } [Theory] + [InlineData(null)] [InlineData("")] [InlineData("rule")] public void Should_Set_Rule(string rule) diff --git a/src/Cake.Issues/IIssue.cs b/src/Cake.Issues/IIssue.cs index 02f2d0369..954723119 100644 --- a/src/Cake.Issues/IIssue.cs +++ b/src/Cake.Issues/IIssue.cs @@ -39,7 +39,7 @@ public interface IIssue /// /// Gets the rule of the issue. - /// Can be if the issue provider provides no rule. + /// Can be null or if the issue provider provides no rule. /// string Rule { get; } diff --git a/src/Cake.Issues/Issue.cs b/src/Cake.Issues/Issue.cs index a5d990539..1bf9e8902 100644 --- a/src/Cake.Issues/Issue.cs +++ b/src/Cake.Issues/Issue.cs @@ -19,7 +19,7 @@ public class Issue : IIssue /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The type of the issue provider. public Issue( string filePath, @@ -43,7 +43,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The URL containing information about the failing rule. /// null if no URL is available. /// The type of the issue provider. @@ -72,7 +72,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The type of the issue provider. public Issue( string project, @@ -99,7 +99,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The URL containing information about the failing rule. /// null if no URL is available. /// The type of the issue provider. @@ -115,7 +115,6 @@ public Issue( { line?.NotNegativeOrZero(nameof(line)); message.NotNullOrWhiteSpace(nameof(message)); - rule.NotNull(nameof(rule)); providerType.NotNullOrWhiteSpace(nameof(providerType)); // File path needs to be relative to the repository root. diff --git a/src/Cake.Issues/Issue{T}.cs b/src/Cake.Issues/Issue{T}.cs index a0635a9f2..a30944791 100644 --- a/src/Cake.Issues/Issue{T}.cs +++ b/src/Cake.Issues/Issue{T}.cs @@ -20,7 +20,7 @@ public class Issue : Issue /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. public Issue( string filePath, int? line, @@ -42,7 +42,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The URL containing information about the failing rule. /// null if no URL is available. public Issue( @@ -69,7 +69,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. public Issue( string project, string filePath, @@ -94,7 +94,7 @@ public Issue( /// The message of the issue. /// The priority of the message. /// The rule of the issue. - /// if issue has no specific rule ID. + /// null or if issue has no specific rule ID. /// The URL containing information about the failing rule. /// null if no URL is available. public Issue(