From 0d6fa2e56bca65038e8c22522e6b2f6d7f49a5f1 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 16:12:28 -0400 Subject: [PATCH 1/7] Fixing nuget package --- src/BCC.MSBuildLog/BCC.MSBuildLog.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj b/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj index cf8c770..b9af452 100644 --- a/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj +++ b/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj @@ -9,7 +9,6 @@ - From 5a6086b870d81691a3cc8a24ad0fd30510582836 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 16:12:39 -0400 Subject: [PATCH 2/7] Fixing some tests --- .../Services/BuildLogProcessorTests.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs index 037e349..43afc31 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs @@ -111,11 +111,11 @@ public void Should_Create_CheckRun_With_Warning() Faker.Lorem.Word()) }; - var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations)); + var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations, 1)); checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("0 Errors 1 Warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -150,7 +150,7 @@ public void Should_Create_CheckRun_With_Configuration() var mockFileSystem = new MockFileSystem(); mockFileSystem.AddFile(configurationFile, new MockFileData(JsonConvert.SerializeObject(expectedCheckRunConfiguration))); - var mockBinaryLogProcessor = CreateMockBinaryLogProcessor(annotations); + var mockBinaryLogProcessor = CreateMockBinaryLogProcessor(annotations, 1); var checkRun = GetCheckRun(mockBinaryLogProcessor, configurationFile: configurationFile, mockFileSystem: mockFileSystem); mockBinaryLogProcessor.Received(1).ProcessLog(Arg.Any(), Arg.Any(), Arg.Any()); @@ -159,7 +159,7 @@ public void Should_Create_CheckRun_With_Configuration() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be(expectedCheckRunConfiguration.Name); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("0 Errors 1 Warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -176,11 +176,11 @@ public void Should_Create_CheckRun_With_Failure() CheckWarningLevel.Failure, Faker.Lorem.Word()) }; - var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations)); + var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations, 0, 1)); checkRun.Conclusion.Should().Be(CheckConclusion.Failure); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("1 Error 0 Warnings"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -202,11 +202,11 @@ public void Should_Create_CheckRun_With_WarningAndFailure() CheckWarningLevel.Failure, Faker.Lorem.Word()) }; - var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations)); + var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations, 1, 1)); checkRun.Conclusion.Should().Be(CheckConclusion.Failure); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("1 Error 1 Warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -218,9 +218,10 @@ public void Should_Create_CheckRun_TestConsoleApp1_Warning() { new Annotation( "TestConsoleApp1/Program.cs", - 13, 13, - CheckWarningLevel.Warning, "CS0219: The variable 'hello' is assigned but its value is never used") + 13, + CheckWarningLevel.Warning, + "CS0219: The variable 'hello' is assigned but its value is never used") }; var cloneRoot = @"C:\projects\testconsoleapp1\"; From e0bcafef59e906d8df0d9db4f563561e3781f7a4 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 16:36:40 -0400 Subject: [PATCH 3/7] Setting the title this time --- .../Services/BinaryLogProcessorTests.cs | 42 +++++++++++++-- .../Services/BuildLogProcessorTests.cs | 41 +++++++++----- .../Services/BinaryLogProcessor.cs | 53 +++++++++++-------- .../Services/BuildLogProcessor.cs | 6 +-- 4 files changed, 99 insertions(+), 43 deletions(-) diff --git a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs index 257a643..431c21a 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs @@ -47,6 +47,9 @@ public void Should_TestConsoleApp1_Warning() 13, CheckWarningLevel.Warning, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } ); } @@ -77,6 +80,9 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning_For_Other_Code() 13, CheckWarningLevel.Warning, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } ); } @@ -107,6 +113,9 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning() 13, CheckWarningLevel.Warning, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } ); } @@ -137,6 +146,9 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Notice() 13, CheckWarningLevel.Notice, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } ); } @@ -167,6 +179,9 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Error() 13, CheckWarningLevel.Failure, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } ); } @@ -206,6 +221,9 @@ public void Should_TestConsoleApp1_Error() 13, CheckWarningLevel.Failure, "CS1002: ; expected") + { + Title = "CS1002: TestConsoleApp1/Program.cs(13)" + } ); } @@ -225,6 +243,9 @@ public void Should_TestConsoleApp1_CodeAnalysis() 20, 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.") + { + Title = "CA2213: TestConsoleApp1/Program.cs(20)" + } ); } @@ -245,7 +266,10 @@ public void Should_MSBLOC() 56, 56, 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") + { + Title = "CS0219: MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs(56)" + }); logData.Annotations[1].Should().BeEquivalentTo( new Annotation( @@ -253,7 +277,10 @@ public void Should_MSBLOC() 83, 83, 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") + { + Title = "CS0219: MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs(83)" + }); } [Fact] @@ -273,7 +300,10 @@ public void Should_Parse_OctokitGraphQL() 43, 43, 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'") + { + Title = "CS1591: Octokit.GraphQL.Core/Connection.cs(43)" + }); logData.Annotations[1].Should().BeEquivalentTo( new Annotation( @@ -281,8 +311,12 @@ public void Should_Parse_OctokitGraphQL() 44, 44, 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'") + { + Title = "CS1591: Octokit.GraphQL.Core/Connection.cs(44)" + }); } + [Fact] public void Should_Parse_GitHubVisualStudio() { diff --git a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs index 43afc31..73200c1 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs @@ -45,7 +45,7 @@ public void Should_Create_Empty_CheckRun() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("0 errors - 0 warnings"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().AllBeEquivalentTo(annotations); } @@ -93,7 +93,7 @@ public void Should_Create_Empty_CheckRun_With_Configuration() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 0 Warnings"); + checkRun.Title.Should().Be("0 errors - 0 warnings"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().AllBeEquivalentTo(annotations); } @@ -115,7 +115,7 @@ public void Should_Create_CheckRun_With_Warning() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 1 Warning"); + checkRun.Title.Should().Be("0 errors - 1 warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -159,7 +159,7 @@ public void Should_Create_CheckRun_With_Configuration() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be(expectedCheckRunConfiguration.Name); - checkRun.Title.Should().Be("0 Errors 1 Warning"); + checkRun.Title.Should().Be("0 errors - 1 warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -180,7 +180,7 @@ public void Should_Create_CheckRun_With_Failure() checkRun.Conclusion.Should().Be(CheckConclusion.Failure); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("1 Error 0 Warnings"); + checkRun.Title.Should().Be("1 error - 0 warnings"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -194,19 +194,21 @@ public void Should_Create_CheckRun_With_WarningAndFailure() Faker.System.FilePath(), Faker.Random.Int(), Faker.Random.Int(), - CheckWarningLevel.Warning, Faker.Lorem.Word()), + CheckWarningLevel.Warning, + Faker.Lorem.Word()), new Annotation( Faker.System.FilePath(), Faker.Random.Int(), Faker.Random.Int(), - CheckWarningLevel.Failure, Faker.Lorem.Word()) + CheckWarningLevel.Failure, + Faker.Lorem.Word()) }; var checkRun = GetCheckRun(CreateMockBinaryLogProcessor(annotations, 1, 1)); checkRun.Conclusion.Should().Be(CheckConclusion.Failure); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("1 Error 1 Warning"); + checkRun.Title.Should().Be("1 error - 1 warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -222,6 +224,9 @@ public void Should_Create_CheckRun_TestConsoleApp1_Warning() 13, CheckWarningLevel.Warning, "CS0219: The variable 'hello' is assigned but its value is never used") + { + Title = "CS0219: TestConsoleApp1/Program.cs(13)" + } }; var cloneRoot = @"C:\projects\testconsoleapp1\"; @@ -231,7 +236,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Warning() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 1 Warning"); + checkRun.Title.Should().Be("0 errors - 1 warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -243,9 +248,13 @@ public void Should_Create_CheckRun_TestConsoleApp1_Error() { new Annotation( "TestConsoleApp1/Program.cs", - 13, 13, - CheckWarningLevel.Failure, "CS1002: ; expected") + 13, + CheckWarningLevel.Failure, + "CS1002: ; expected") + { + Title = "CS1002: TestConsoleApp1/Program.cs(13)" + } }; var cloneRoot = @"C:\projects\testconsoleapp1\"; @@ -255,7 +264,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Error() checkRun.Conclusion.Should().Be(CheckConclusion.Failure); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("1 Error 0 Warnings"); + checkRun.Title.Should().Be("1 error - 0 warnings"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } @@ -269,7 +278,11 @@ public void Should_Create_CheckRun_TestConsoleApp1_CodeAnalysis() "TestConsoleApp1/Program.cs", 20, 20, - 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.") + 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.") + { + Title = "CA2213: TestConsoleApp1/Program.cs(20)" + } }; var cloneRoot = @"C:\projects\testconsoleapp1\"; @@ -279,7 +292,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_CodeAnalysis() checkRun.Conclusion.Should().Be(CheckConclusion.Success); checkRun.Name.Should().Be("MSBuild Log"); - checkRun.Title.Should().Be("0 Errors 1 Warning"); + checkRun.Title.Should().Be("0 errors - 1 warning"); checkRun.Summary.Should().Be(string.Empty); checkRun.Annotations.Should().BeEquivalentTo(annotations); } diff --git a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs index 951f99f..51d74ee 100644 --- a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs +++ b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs @@ -55,7 +55,7 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura string message; int lineNumber; int endLineNumber; - + string code; if (buildWarning != null) { warningCount++; @@ -63,7 +63,7 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura buildCode = buildWarning.Code; projectFile = buildWarning.ProjectFile; file = buildWarning.File; - title = buildWarning.Code; + code = buildWarning.Code; message = buildWarning.Message; lineNumber = buildWarning.LineNumber; endLineNumber = buildWarning.EndLineNumber; @@ -75,7 +75,7 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura buildCode = buildError.Code; projectFile = buildError.ProjectFile; file = buildError.File; - title = buildError.Code; + code = buildError.Code; message = buildError.Message; lineNumber = buildError.LineNumber; endLineNumber = buildError.EndLineNumber; @@ -93,6 +93,9 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura } } + var filePath = GetFilePath(cloneRoot, projectFile ?? file, file); + title = $"{code}: {filePath}({lineNumber})"; + message = $"{buildCode}: {message}"; ReportAs reportAs = ReportAs.AsIs; @@ -122,12 +125,11 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura annotations.Add(CreateAnnotation(checkWarningLevel, cloneRoot, - projectFile, - file, title, message, lineNumber, - endLineNumber)); + endLineNumber, + filePath)); } return new LogData @@ -138,33 +140,44 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura }; } - private Annotation CreateAnnotation(CheckWarningLevel checkWarningLevel, [NotNull] string cloneRoot, - [NotNull] string projectFile, - [NotNull] string file, [NotNull] string title, [NotNull] string message, int lineNumber, int endLineNumber) + private Annotation CreateAnnotation(CheckWarningLevel checkWarningLevel, [NotNull] string cloneRoot, [NotNull] string title, [NotNull] string message, int lineNumber, int endLineNumber, string getFilePath) { if (cloneRoot == null) { throw new ArgumentNullException(nameof(cloneRoot)); } - if (projectFile == null) + if (title == null) { - throw new ArgumentNullException(nameof(projectFile)); + throw new ArgumentNullException(nameof(title)); } - if (file == null) + if (message == null) { - throw new ArgumentNullException(nameof(file)); + throw new ArgumentNullException(nameof(message)); } - if (title == null) + return new Annotation( + getFilePath, + lineNumber, + endLineNumber == 0 ? lineNumber : endLineNumber, + checkWarningLevel, + message) { - throw new ArgumentNullException(nameof(title)); + Title = title + }; + } + + private string GetFilePath(string cloneRoot, string projectFile, string file) + { + if (projectFile == null) + { + throw new ArgumentNullException(nameof(projectFile)); } - if (message == null) + if (file == null) { - throw new ArgumentNullException(nameof(message)); + throw new ArgumentNullException(nameof(file)); } var filePath = Path.Combine(Path.GetDirectoryName(projectFile), file); @@ -173,11 +186,7 @@ private Annotation CreateAnnotation(CheckWarningLevel checkWarningLevel, [NotNul throw new InvalidOperationException($"FilePath `{filePath}` is not a child of `{cloneRoot}`"); } - var relativePath = GetRelativePath(filePath, cloneRoot).Replace("\\", "/"); - - return new Annotation(relativePath, lineNumber, - endLineNumber == 0 ? lineNumber : endLineNumber, checkWarningLevel, - message); + return GetRelativePath(filePath, cloneRoot).Replace("\\", "/"); } private string GetRelativePath(string filespec, string folder) diff --git a/src/BCC.MSBuildLog/Services/BuildLogProcessor.cs b/src/BCC.MSBuildLog/Services/BuildLogProcessor.cs index 2010b5d..0cb101e 100644 --- a/src/BCC.MSBuildLog/Services/BuildLogProcessor.cs +++ b/src/BCC.MSBuildLog/Services/BuildLogProcessor.cs @@ -68,11 +68,11 @@ public void Proces(string inputFile, string outputFile, string cloneRoot, string var stringBuilder = new StringBuilder(); stringBuilder.Append(logData.ErrorCount.ToString()); stringBuilder.Append(" "); - stringBuilder.Append(logData.ErrorCount == 1 ? "Error": "Errors"); - stringBuilder.Append(" "); + stringBuilder.Append(logData.ErrorCount == 1 ? "error": "errors"); + stringBuilder.Append(" - "); stringBuilder.Append(logData.WarningCount.ToString()); stringBuilder.Append(" "); - stringBuilder.Append(logData.WarningCount == 1 ? "Warning" : "Warnings"); + stringBuilder.Append(logData.WarningCount == 1 ? "warning" : "warnings"); var contents = JsonConvert.SerializeObject(new CreateCheckRun { From 5e561e198d3380ddc4a6110caeb3237d32f7b755 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 16:45:15 -0400 Subject: [PATCH 4/7] Sometimes the parallels kill --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 4b77a8a..68fd5b7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,5 +9,5 @@ before_build: - ps: gitversion /output buildserver build_script: - ps: >- - fake run Build.fsx -p 3 + fake run Build.fsx test: off \ No newline at end of file From dbe6f3e2f319ec927825a5496748afe9a8c4368c Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 16:52:06 -0400 Subject: [PATCH 5/7] Setting the startup object and changing the exe filename --- src/BCC.MSBuildLog/BCC.MSBuildLog.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj b/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj index b9af452..60fbef4 100644 --- a/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj +++ b/src/BCC.MSBuildLog/BCC.MSBuildLog.csproj @@ -4,6 +4,8 @@ Exe netcoreapp2.1;net471 false + BCC.MSBuildLog.Program + BCCMSBuildLog From 95d9d730170028c4c6726df2415689e2d174e720 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 17:27:54 -0400 Subject: [PATCH 6/7] Change arguments --- src/BCC.MSBuildLog.Tests/Services/CommandLineParserTests.cs | 6 +++--- src/BCC.MSBuildLog/Services/CommandLineParser.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BCC.MSBuildLog.Tests/Services/CommandLineParserTests.cs b/src/BCC.MSBuildLog.Tests/Services/CommandLineParserTests.cs index af31592..6bc1020 100644 --- a/src/BCC.MSBuildLog.Tests/Services/CommandLineParserTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/CommandLineParserTests.cs @@ -53,7 +53,7 @@ public void ShouldRequireRequiredArguments() { "-i", $@"""{inputPath}""", "-o", $@"""{outputPath}""", - "-c", $@"""{cloneRoot}""" + "-r", $@"""{cloneRoot}""" }); listener.DidNotReceive().Callback(Arg.Any()); @@ -98,8 +98,8 @@ public void ShouldBeAbleToSetConfigurationArgument() { "-i", $@"""{inputPath}""", "-o", $@"""{outputPath}""", - "-c", $@"""{cloneRoot}""", - "--configuration", $@"""{configurationFile}""" + "-r", $@"""{cloneRoot}""", + "-c", $@"""{configurationFile}""" }); listener.DidNotReceive().Callback(Arg.Any()); diff --git a/src/BCC.MSBuildLog/Services/CommandLineParser.cs b/src/BCC.MSBuildLog/Services/CommandLineParser.cs index 3248e9d..559e110 100644 --- a/src/BCC.MSBuildLog/Services/CommandLineParser.cs +++ b/src/BCC.MSBuildLog/Services/CommandLineParser.cs @@ -23,11 +23,11 @@ public CommandLineParser(Action helpCallback) .Required(); _parser.Setup(arg => arg.ConfigurationFile) - .As("configuration") + .As('c', "configuration") .WithDescription("Configuration file"); _parser.Setup(arg => arg.CloneRoot) - .As('c', "cloneRoot") + .As('r', "cloneRoot") .WithDescription("Clone root") .Required(); From 2c68f823f25cf30d6625ed0abf65efdde1cd6eb0 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 2 Nov 2018 18:31:02 -0400 Subject: [PATCH 7/7] Removing the code from the annotation body --- .../Services/BinaryLogProcessorTests.cs | 22 +++++++++---------- .../Services/BuildLogProcessorTests.cs | 6 ++--- .../Services/BinaryLogProcessor.cs | 2 -- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs index 431c21a..f920396 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BinaryLogProcessorTests.cs @@ -46,7 +46,7 @@ public void Should_TestConsoleApp1_Warning() 13, 13, CheckWarningLevel.Warning, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -79,7 +79,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning_For_Other_Code() 13, 13, CheckWarningLevel.Warning, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -112,7 +112,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Warning() 13, 13, CheckWarningLevel.Warning, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -145,7 +145,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Notice() 13, 13, CheckWarningLevel.Notice, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -178,7 +178,7 @@ public void Should_TestConsoleApp1_Warning_ConfigureAs_Error() 13, 13, CheckWarningLevel.Failure, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -220,7 +220,7 @@ public void Should_TestConsoleApp1_Error() 13, 13, CheckWarningLevel.Failure, - "CS1002: ; expected") + "; expected") { Title = "CS1002: TestConsoleApp1/Program.cs(13)" } @@ -242,7 +242,7 @@ public void Should_TestConsoleApp1_CodeAnalysis() 20, 20, 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.") + "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.") { Title = "CA2213: TestConsoleApp1/Program.cs(20)" } @@ -266,7 +266,7 @@ public void Should_MSBLOC() 56, 56, CheckWarningLevel.Warning, - "CS0219: The variable 'filename' is assigned but its value is never used") + "The variable 'filename' is assigned but its value is never used") { Title = "CS0219: MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs(56)" }); @@ -277,7 +277,7 @@ public void Should_MSBLOC() 83, 83, CheckWarningLevel.Warning, - "CS0219: The variable 'filename' is assigned but its value is never used") + "The variable 'filename' is assigned but its value is never used") { Title = "CS0219: MSBLOC.Core.Tests/Services/BinaryLogProcessorTests.cs(83)" }); @@ -300,7 +300,7 @@ public void Should_Parse_OctokitGraphQL() 43, 43, CheckWarningLevel.Warning, - "CS1591: Missing XML comment for publicly visible type or member 'Connection.Uri'") + "Missing XML comment for publicly visible type or member 'Connection.Uri'") { Title = "CS1591: Octokit.GraphQL.Core/Connection.cs(43)" }); @@ -311,7 +311,7 @@ public void Should_Parse_OctokitGraphQL() 44, 44, CheckWarningLevel.Warning, - "CS1591: Missing XML comment for publicly visible type or member 'Connection.CredentialStore'") + "Missing XML comment for publicly visible type or member 'Connection.CredentialStore'") { Title = "CS1591: Octokit.GraphQL.Core/Connection.cs(44)" }); diff --git a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs index 73200c1..3bc4cf3 100644 --- a/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs +++ b/src/BCC.MSBuildLog.Tests/Services/BuildLogProcessorTests.cs @@ -223,7 +223,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Warning() 13, 13, CheckWarningLevel.Warning, - "CS0219: The variable 'hello' is assigned but its value is never used") + "The variable 'hello' is assigned but its value is never used") { Title = "CS0219: TestConsoleApp1/Program.cs(13)" } @@ -251,7 +251,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_Error() 13, 13, CheckWarningLevel.Failure, - "CS1002: ; expected") + "; expected") { Title = "CS1002: TestConsoleApp1/Program.cs(13)" } @@ -279,7 +279,7 @@ public void Should_Create_CheckRun_TestConsoleApp1_CodeAnalysis() 20, 20, 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.") + "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.") { Title = "CA2213: TestConsoleApp1/Program.cs(20)" } diff --git a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs index 51d74ee..9cffd5c 100644 --- a/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs +++ b/src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs @@ -96,8 +96,6 @@ public LogData ProcessLog(string binLogPath, string cloneRoot, CheckRunConfigura var filePath = GetFilePath(cloneRoot, projectFile ?? file, file); title = $"{code}: {filePath}({lineNumber})"; - message = $"{buildCode}: {message}"; - ReportAs reportAs = ReportAs.AsIs; if (ruleDictionary?.TryGetValue(buildCode, out reportAs) ?? false) {