From dcba6b3be81504723bb9f12e21b8ca50817b854c Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 29 Oct 2018 10:16:05 -0400 Subject: [PATCH] Adding the code to the title --- .../Services/BinaryLogProcessorTests.cs | 26 +++++++++---------- .../Services/BuildLogProcessorTests.cs | 6 ++--- src/BCC.MSBuildLog.v3.ncrunchsolution | 6 +++++ .../Services/BinaryLogProcessor.cs | 2 ++ 4 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 src/BCC.MSBuildLog.v3.ncrunchsolution diff --git a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs index f323a03..db0045b 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs @@ -43,8 +43,8 @@ public void Should_TestConsoleApp1_Warning() logData.Annotations.Should().AllBeEquivalentTo( new Annotation( "TestConsoleApp1/Program.cs", - CheckWarningLevel.Warning, "CS0219", - "The variable 'hello' is assigned but its value is never used", + CheckWarningLevel.Warning, "CS0219", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) ); } @@ -73,7 +73,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning_For_Other_Code() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Warning, "CS0219", - "The variable 'hello' is assigned but its value is never used", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) ); } @@ -102,7 +102,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Warning, "CS0219", - "The variable 'hello' is assigned but its value is never used", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) ); } @@ -131,7 +131,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Notice() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Notice, "CS0219", - "The variable 'hello' is assigned but its value is never used", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) ); } @@ -160,7 +160,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Error() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Failure, "CS0219", - "The variable 'hello' is assigned but its value is never used", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) ); } @@ -197,8 +197,8 @@ public void Should_TestConsoleApp1_Error() logData.Annotations.Should().AllBeEquivalentTo( new Annotation( "TestConsoleApp1/Program.cs", - CheckWarningLevel.Failure, "CS1002", - "; expected", + CheckWarningLevel.Failure, "CS1002", + "CS1002: ; expected", 13, 13) ); } @@ -216,7 +216,7 @@ public void Should_TestConsoleApp1_CodeAnalysis() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Warning, "CA2213", - "Microsoft.Usage : 'Program.MyClass' contains field 'Program.MyClass._inner' that is of IDisposable type: 'Program.MyOTherClass'. Change the Dispose method on 'Program.MyClass' to call Dispose or Close on this field.", + "CA2213: Microsoft.Usage : 'Program.MyClass' contains field 'Program.MyClass._inner' that is of IDisposable type: 'Program.MyOTherClass'. Change the Dispose method on 'Program.MyClass' to call Dispose or Close on this field.", 20, 20) ); } @@ -236,14 +236,14 @@ public void Should_MSBLOC() new Annotation( "MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs", CheckWarningLevel.Warning,"CS0219", - "The variable 'filename' is assigned but its value is never used", + "CS0219: The variable 'filename' is assigned but its value is never used", 56, 56)); logData.Annotations[1].Should().BeEquivalentTo( new Annotation( "MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs", CheckWarningLevel.Warning,"CS0219", - "The variable 'filename' is assigned but its value is never used", + "CS0219: The variable 'filename' is assigned but its value is never used", 83, 83)); } @@ -262,14 +262,14 @@ public void Should_Parse_OctokitGraphQL() new Annotation( "Octokit.GraphQL.Core/Connection.cs", CheckWarningLevel.Warning,"CS1591", - "Missing XML comment for publicly visible type or member 'Connection.Uri'", + "CS1591: Missing XML comment for publicly visible type or member 'Connection.Uri'", 43, 43)); logData.Annotations[1].Should().BeEquivalentTo( new Annotation( "Octokit.GraphQL.Core/Connection.cs", CheckWarningLevel.Warning,"CS1591", - "Missing XML comment for publicly visible type or member 'Connection.CredentialStore'", + "CS1591: Missing XML comment for publicly visible type or member 'Connection.CredentialStore'", 44, 44)); } [Fact] diff --git a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs index ed6eeb6..723a59f 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs @@ -217,7 +217,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Warning() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Warning, "CS0219", - "The variable 'hello' is assigned but its value is never used", + "CS0219: The variable 'hello' is assigned but its value is never used", 13, 13) }; @@ -241,7 +241,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Error() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Failure, "CS1002", - "; expected", + "CS1002: ; expected", 13, 13) }; @@ -265,7 +265,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_CodeAnalysis() new Annotation( "TestConsoleApp1/Program.cs", CheckWarningLevel.Warning, "CA2213", - "Microsoft.Usage : 'Program.MyClass' contains field 'Program.MyClass._inner' that is of IDisposable type: 'Program.MyOTherClass'. Change the Dispose method on 'Program.MyClass' to call Dispose or Close on this field.", + "CA2213: Microsoft.Usage : 'Program.MyClass' contains field 'Program.MyClass._inner' that is of IDisposable type: 'Program.MyOTherClass'. Change the Dispose method on 'Program.MyClass' to call Dispose or Close on this field.", 20, 20) }; diff --git a/src/BCC.MSBuildLog.v3.ncrunchsolution b/src/BCC.MSBuildLog.v3.ncrunchsolution new file mode 100644 index 0000000..10420ac --- /dev/null +++ b/src/BCC.MSBuildLog.v3.ncrunchsolution @@ -0,0 +1,6 @@ + + + True + True + + \ No newline at end of file diff --git a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs index 1aee19d..1e6febf 100644 --- a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs +++ b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs @@ -93,6 +93,8 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura } } + message = $"{buildCode}: {message}"; + ReportAs reportAs = ReportAs.AsIs; if (ruleDictionary?.TryGetValue(buildCode, out reportAs) ?? false) {