From 8f578a770d5ba33048add6f10a4f72f0df97eaf7 Mon Sep 17 00:00:00 2001 From: Larry Golding Date: Thu, 6 Dec 2018 09:25:16 -0800 Subject: [PATCH 1/4] Rename rule EndTimeMustBeAfterStartTime => ...MustNotBeBefore... --- .../Rules/EndTimeMustBeAfterStartTimeTests.cs | 16 ---------------- .../EndTimeMustNotBeBeforeStartTimeTests.cs | 16 ++++++++++++++++ .../Invalid.sarif | 0 .../Valid.sarif | 0 ...ime.cs => EndTimeMustNotBeBeforeStartTime.cs} | 6 +++--- src/Sarif.Multitool/Rules/RuleId.cs | 2 +- .../Rules/RuleResources.Designer.cs | 6 +++--- src/Sarif.Multitool/Rules/RuleResources.resx | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs create mode 100644 src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustNotBeBeforeStartTimeTests.cs rename src/Sarif.Multitool.FunctionalTests/TestData/{EndTimeMustBeAfterStartTime => EndTimeMustNotBeBeforeStartTime}/Invalid.sarif (100%) rename src/Sarif.Multitool.FunctionalTests/TestData/{EndTimeMustBeAfterStartTime => EndTimeMustNotBeBeforeStartTime}/Valid.sarif (100%) rename src/Sarif.Multitool/Rules/{EndTimeMustBeAfterStartTime.cs => EndTimeMustNotBeBeforeStartTime.cs} (87%) diff --git a/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs b/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs deleted file mode 100644 index 7d9e04e5b..000000000 --- a/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Xunit; - -namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules -{ - public class EndTimeMustBeAfterStartTimeTests : ValidationSkimmerTestsBase - { - [Fact(DisplayName = nameof(EndTimeMustBeAfterStartTime_ReportsInvalidSarif))] - public void EndTimeMustBeAfterStartTime_ReportsInvalidSarif() => Verify("Invalid.sarif"); - - [Fact(DisplayName = nameof(EndTimeMustBeAfterStartTime_AcceptsValidSarif))] - public void EndTimeMustBeAfterStartTime_AcceptsValidSarif() => Verify("Valid.sarif"); - } -} diff --git a/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustNotBeBeforeStartTimeTests.cs b/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustNotBeBeforeStartTimeTests.cs new file mode 100644 index 000000000..7fb0d47b2 --- /dev/null +++ b/src/Sarif.Multitool.FunctionalTests/Rules/EndTimeMustNotBeBeforeStartTimeTests.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Xunit; + +namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules +{ + public class EndTimeMustNotBeBeforeStartTimeTests : ValidationSkimmerTestsBase + { + [Fact(DisplayName = nameof(EndTimeMustNotBeBeforeStartTime_ReportsInvalidSarif))] + public void EndTimeMustNotBeBeforeStartTime_ReportsInvalidSarif() => Verify("Invalid.sarif"); + + [Fact(DisplayName = nameof(EndTimeMustNotBeBeforeStartTime_AcceptsValidSarif))] + public void EndTimeMustNotBeBeforeStartTime_AcceptsValidSarif() => Verify("Valid.sarif"); + } +} diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/Invalid.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustNotBeBeforeStartTime/Invalid.sarif similarity index 100% rename from src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/Invalid.sarif rename to src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustNotBeBeforeStartTime/Invalid.sarif diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/Valid.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustNotBeBeforeStartTime/Valid.sarif similarity index 100% rename from src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/Valid.sarif rename to src/Sarif.Multitool.FunctionalTests/TestData/EndTimeMustNotBeBeforeStartTime/Valid.sarif diff --git a/src/Sarif.Multitool/Rules/EndTimeMustBeAfterStartTime.cs b/src/Sarif.Multitool/Rules/EndTimeMustNotBeBeforeStartTime.cs similarity index 87% rename from src/Sarif.Multitool/Rules/EndTimeMustBeAfterStartTime.cs rename to src/Sarif.Multitool/Rules/EndTimeMustNotBeBeforeStartTime.cs index dea11725a..dac6fd5b4 100644 --- a/src/Sarif.Multitool/Rules/EndTimeMustBeAfterStartTime.cs +++ b/src/Sarif.Multitool/Rules/EndTimeMustNotBeBeforeStartTime.cs @@ -8,11 +8,11 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { - public class EndTimeMustBeAfterStartTime : SarifValidationSkimmerBase + public class EndTimeMustNotBeBeforeStartTime : SarifValidationSkimmerBase { private Message _fullDescription = new Message { - Text = RuleResources.SARIF1007_EndTimeMustBeAfterStartTime + Text = RuleResources.SARIF1007_EndTimeMustNotBeBeforeStartTime }; public override Message FullDescription => _fullDescription; @@ -22,7 +22,7 @@ public class EndTimeMustBeAfterStartTime : SarifValidationSkimmerBase /// /// SARIF1007 /// - public override string Id => RuleId.EndTimeMustBeAfterStartTime; + public override string Id => RuleId.EndTimeMustNotBeBeforeStartTime; protected override IEnumerable MessageResourceNames => new string[] { diff --git a/src/Sarif.Multitool/Rules/RuleId.cs b/src/Sarif.Multitool/Rules/RuleId.cs index 2a2b47184..fdb125e5a 100644 --- a/src/Sarif.Multitool/Rules/RuleId.cs +++ b/src/Sarif.Multitool/Rules/RuleId.cs @@ -9,7 +9,7 @@ public static class RuleId public const string UseAbsolutePathsForNestedFileUriFragments = "SARIF1002"; public const string UrisMustBeValid = "SARIF1003"; public const string HashAlgorithmsMustBeUnique = "SARIF1006"; - public const string EndTimeMustBeAfterStartTime = "SARIF1007"; + public const string EndTimeMustNotBeBeforeStartTime = "SARIF1007"; public const string MessagesShouldEndWithPeriod = "SARIF1008"; public const string StepValuesMustFormOneBasedSequence = "SARIF1009"; public const string EndLineMustNotBeLessThanStartLine = "SARIF1012"; diff --git a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs index e18cdcd7e..ee8df0d4f 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs +++ b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs @@ -142,11 +142,11 @@ internal static string SARIF1007_Default { } /// - /// Looks up a localized string similar to The end time of a run must be after the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal.. + /// Looks up a localized string similar to The end time of a run must not precede the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal.. /// - internal static string SARIF1007_EndTimeMustBeAfterStartTime { + internal static string SARIF1007_EndTimeMustNotBeBeforeStartTime { get { - return ResourceManager.GetString("SARIF1007_EndTimeMustBeAfterStartTime", resourceCulture); + return ResourceManager.GetString("SARIF1007_EndTimeMustNotBeBeforeStartTime", resourceCulture); } } diff --git a/src/Sarif.Multitool/Rules/RuleResources.resx b/src/Sarif.Multitool/Rules/RuleResources.resx index dddd0d245..984f12fc0 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.resx +++ b/src/Sarif.Multitool/Rules/RuleResources.resx @@ -144,8 +144,8 @@ {0}: The end time "{1}" is before the start time "{2}". - - The end time of a run must be after the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal. + + The end time of a run must not precede the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal. {0}: The message "{1}" does not end with a period. From 63e4ffddf11f53c73200a3e87349b81205894745 Mon Sep 17 00:00:00 2001 From: Larry Golding Date: Thu, 6 Dec 2018 10:13:37 -0800 Subject: [PATCH 2/4] Upgrade UriBaseIdRequiresRelativeUri tests. --- .../UriBaseIdRequiresRelativeUriTests.cs | 116 +------- .../AbsoluteUriInAnalysisTarget.sarif | 21 -- ...AbsoluteUriInAnalysisTarget_Expected.sarif | 93 ------ .../AbsoluteUriInCodeFlow.sarif | 37 --- .../AbsoluteUriInCodeFlow_Expected.sarif | 93 ------ ...soluteUriInConfigurationNotification.sarif | 28 -- ...InConfigurationNotification_Expected.sarif | 93 ------ ...eUriInConversionAnalysisToolLogFiles.sarif | 22 -- ...versionAnalysisToolLogFiles_Expected.sarif | 93 ------ .../AbsoluteUriInFileChange.sarif | 37 --- .../AbsoluteUriInFileChange_Expected.sarif | 93 ------ .../AbsoluteUriInFilesDictionary.sarif | 19 -- ...bsoluteUriInFilesDictionary_Expected.sarif | 93 ------ .../AbsoluteUriInInvocationAttachment.sarif | 24 -- ...teUriInInvocationAttachment_Expected.sarif | 93 ------ ...uteUriInInvocationExecutableLocation.sarif | 20 -- ...nvocationExecutableLocation_Expected.sarif | 93 ------ .../AbsoluteUriInInvocationResponseFile.sarif | 22 -- ...UriInInvocationResponseFile_Expected.sarif | 93 ------ ...soluteUriInInvocationStandardStreams.sarif | 32 -- ...InInvocationStandardStreams_Expected.sarif | 165 ----------- .../AbsoluteUriInRelatedLocation.sarif | 27 -- ...bsoluteUriInRelatedLocation_Expected.sarif | 93 ------ .../AbsoluteUriInResultAttachment.sarif | 25 -- ...soluteUriInResultAttachment_Expected.sarif | 93 ------ ...oluteUriInResultConversionProvenance.sarif | 25 -- ...nResultConversionProvenance_Expected.sarif | 93 ------ .../AbsoluteUriInResultGraphNode.sarif | 42 --- ...bsoluteUriInResultGraphNode_Expected.sarif | 93 ------ .../AbsoluteUriInResultLocation.sarif | 27 -- ...AbsoluteUriInResultLocation_Expected.sarif | 93 ------ .../AbsoluteUriInRunGraphNode.sarif | 37 --- .../AbsoluteUriInRunGraphNode_Expected.sarif | 93 ------ .../AbsoluteUriInStackFrame.sarif | 33 --- .../AbsoluteUriInStackFrame_Expected.sarif | 93 ------ .../AbsoluteUriInToolNotification.sarif | 28 -- ...soluteUriInToolNotification_Expected.sarif | 93 ------ .../Invalid.sarif | 273 ++++++++++++++++++ .../UrisAreRelative_Expected.sarif | 48 --- .../{UrisAreRelative.sarif => Valid.sarif} | 35 ++- 40 files changed, 297 insertions(+), 2427 deletions(-) delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification_Expected.sarif create mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Invalid.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative_Expected.sarif rename src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/{UrisAreRelative.sarif => Valid.sarif} (88%) diff --git a/src/Sarif.Multitool.FunctionalTests/Rules/UriBaseIdRequiresRelativeUriTests.cs b/src/Sarif.Multitool.FunctionalTests/Rules/UriBaseIdRequiresRelativeUriTests.cs index 3f1e765fa..aa950ba38 100644 --- a/src/Sarif.Multitool.FunctionalTests/Rules/UriBaseIdRequiresRelativeUriTests.cs +++ b/src/Sarif.Multitool.FunctionalTests/Rules/UriBaseIdRequiresRelativeUriTests.cs @@ -7,118 +7,10 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { public class UriBaseIdRequiresRelativeUriTests : ValidationSkimmerTestsBase { - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_UrisAreRelative))] - public void UriBaseIdRequiresRelativeUri_UrisAreRelative() - { - Verify("UrisAreRelative.sarif"); - } + [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_ReportsInvalidSarif))] + public void UriBaseIdRequiresRelativeUri_ReportsInvalidSarif() => Verify("Invalid.sarif"); - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInAnalysisTarget))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInAnalysisTarget() - { - Verify("AbsoluteUriInAnalysisTarget.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInCodeFlow))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInCodeFlow() - { - Verify("AbsoluteUriInCodeFlow.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInConfigurationNotification))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInConfigurationNotification() - { - Verify("AbsoluteUriInConfigurationNotification.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInConversionAnalysisToolLogFiles))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInConversionAnalysisToolLogFiles() - { - Verify("AbsoluteUriInConversionAnalysisToolLogFiles.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInFileChange))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInFileChange() - { - Verify("AbsoluteUriInFileChange.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInFilesDictionary))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInFilesDictionary() - { - Verify("AbsoluteUriInFilesDictionary.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationAttachment))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationAttachment() - { - Verify("AbsoluteUriInInvocationAttachment.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationExecutableLocation))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationExecutableLocation() - { - Verify("AbsoluteUriInInvocationExecutableLocation.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationResponseFile))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationResponseFile() - { - Verify("AbsoluteUriInInvocationResponseFile.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationStandardStreams))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInInvocationStandardStreams() - { - Verify("AbsoluteUriInInvocationStandardStreams.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInRelatedLocation))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInRelatedLocation() - { - Verify("AbsoluteUriInRelatedLocation.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInResultAttachment))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInResultAttachment() - { - Verify("AbsoluteUriInResultAttachment.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInResultConversionProvenance))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInResultConversionProvenance() - { - Verify("AbsoluteUriInResultConversionProvenance.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInResultGraphNode))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInResultGraphNode() - { - Verify("AbsoluteUriInResultGraphNode.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInResultLocation))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInResultLocation() - { - Verify("AbsoluteUriInResultLocation.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInRunGraphNode))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInRunGraphNode() - { - Verify("AbsoluteUriInRunGraphNode.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInStackFrame))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInStackFrame() - { - Verify("AbsoluteUriInStackFrame.sarif"); - } - - [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AbsoluteUriInToolNotification))] - public void UriBaseIdRequiresRelativeUri_AbsoluteUriInToolNotification() - { - Verify("AbsoluteUriInToolNotification.sarif"); - } + [Fact(DisplayName = nameof(UriBaseIdRequiresRelativeUri_AcceptsValidSarif))] + public void UriBaseIdRequiresRelativeUri_AcceptsValidSarif() => Verify("Valid.sarif"); } } diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif deleted file mode 100644 index 366e30741..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "analysisTarget": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget_Expected.sarif deleted file mode 100644 index b380bf12c..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/analysisTarget/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif" - }, - "region": { - "startLine": 14, - "startColumn": 42 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:32.644Z", - "endTime": "2018-09-12T21:45:33.684Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInAnalysisTarget.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInAnalysisTarget.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:33.114Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif deleted file mode 100644 index 40d4180bb..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "codeFlows": [ - { - "threadFlows": [ - { - "locations": [ - { - "location": { - "physicalLocation": { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - } - } - } - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow_Expected.sarif deleted file mode 100644 index 0673346bf..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0/location/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif" - }, - "region": { - "startLine": 23, - "startColumn": 58 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:34.099Z", - "endTime": "2018-09-12T21:45:34.990Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInCodeFlow.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInCodeFlow.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:34.444Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif deleted file mode 100644 index ca976747b..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "invocations": [ - { - "configurationNotifications": [ - { - "message": { - "text": "Message." - }, - "physicalLocation": { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - } - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification_Expected.sarif deleted file mode 100644 index dbdd35cd9..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/configurationNotifications/0/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif" - }, - "region": { - "startLine": 19, - "startColumn": 48 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:35.412Z", - "endTime": "2018-09-12T21:45:36.319Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConfigurationNotification.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInConfigurationNotification.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:35.797Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif deleted file mode 100644 index da048ee0b..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "conversion": { - "tool": { - "name": "ConversionTool" - }, - "analysisToolLogFiles": [ - { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - ] - } - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles_Expected.sarif deleted file mode 100644 index f6a18b42b..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/conversion/analysisToolLogFiles/0/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif" - }, - "region": { - "startLine": 15, - "startColumn": 42 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:36.684Z", - "endTime": "2018-09-12T21:45:37.568Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInConversionAnalysisToolLogFiles.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInConversionAnalysisToolLogFiles.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:37.052Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif deleted file mode 100644 index 932ed3f0f..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "fixes": [ - { - "fileChanges": [ - { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - }, - "replacements": [ - { - "deletedRegion": { - "charOffset": 0, - "charLength": 1 - } - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange_Expected.sarif deleted file mode 100644 index 25fb3815a..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/fixes/0/fileChanges/0/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif" - }, - "region": { - "startLine": 19, - "startColumn": 50 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:37.951Z", - "endTime": "2018-09-12T21:45:38.871Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFileChange.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInFileChange.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:38.325Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif deleted file mode 100644 index 1347133a8..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "files": { - "/c:/src/file.c": { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - } - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary_Expected.sarif deleted file mode 100644 index 92ff3616a..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/files/~1c:~1src~1file.c/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif" - }, - "region": { - "startLine": 12, - "startColumn": 42 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:39.285Z", - "endTime": "2018-09-12T21:45:40.185Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInFilesDictionary.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInFilesDictionary.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:39.684Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif deleted file mode 100644 index 5cc07dc99..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [], - "invocations": [ - { - "attachments": [ - { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment_Expected.sarif deleted file mode 100644 index 7961998ce..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/attachments/0/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif" - }, - "region": { - "startLine": 15, - "startColumn": 46 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:40.544Z", - "endTime": "2018-09-12T21:45:41.542Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationAttachment.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInInvocationAttachment.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:40.997Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif deleted file mode 100644 index d1db7baf4..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [], - "invocations": [ - { - "executableLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation_Expected.sarif deleted file mode 100644 index 4140bc725..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/executableLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif" - }, - "region": { - "startLine": 13, - "startColumn": 42 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:41.936Z", - "endTime": "2018-09-12T21:45:42.877Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationExecutableLocation.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInInvocationExecutableLocation.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:42.322Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif deleted file mode 100644 index 18fda18d5..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [], - "invocations": [ - { - "responseFiles": [ - { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile_Expected.sarif deleted file mode 100644 index f406b598e..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/responseFiles/0/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif" - }, - "region": { - "startLine": 14, - "startColumn": 44 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:43.241Z", - "endTime": "2018-09-12T21:45:44.174Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationResponseFile.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInInvocationResponseFile.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:43.640Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif deleted file mode 100644 index 9f9e555d1..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [], - "invocations": [ - { - "stdin": { - "uri": "file:///c:/log/in.txt", - "uriBaseId": "%SRCROOT%" - }, - "stdout": { - "uri": "file:///c:/log/out.txt", - "uriBaseId": "%SRCROOT%" - }, - "stderr": { - "uri": "file:///c:/log/err.txt", - "uriBaseId": "%SRCROOT%" - }, - "stdoutStderr": { - "uri": "file:///c:/log/out-err.txt", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams_Expected.sarif deleted file mode 100644 index acdbe0a24..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams_Expected.sarif +++ /dev/null @@ -1,165 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/stdin/uri", - "file:///c:/log/in.txt" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif" - }, - "region": { - "startLine": 13, - "startColumn": 42 - } - } - } - ] - }, - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/stdout/uri", - "file:///c:/log/out.txt" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif" - }, - "region": { - "startLine": 17, - "startColumn": 43 - } - } - } - ] - }, - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/stderr/uri", - "file:///c:/log/err.txt" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif" - }, - "region": { - "startLine": 21, - "startColumn": 43 - } - } - } - ] - }, - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/stdoutStderr/uri", - "file:///c:/log/out-err.txt" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif" - }, - "region": { - "startLine": 25, - "startColumn": 47 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:44.538Z", - "endTime": "2018-09-12T21:45:45.430Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInInvocationStandardStreams.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInInvocationStandardStreams.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:44.916Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif deleted file mode 100644 index 4c1a45fba..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "relatedLocations": [ - { - "physicalLocation": { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - } - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation_Expected.sarif deleted file mode 100644 index 00dfb835c..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/relatedLocations/0/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif" - }, - "region": { - "startLine": 18, - "startColumn": 48 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:45.812Z", - "endTime": "2018-09-12T21:45:46.685Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRelatedLocation.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInRelatedLocation.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:46.169Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif deleted file mode 100644 index 1bfd3e6af..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "attachments": [ - { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment_Expected.sarif deleted file mode 100644 index 231ece1e1..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/attachments/0/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif" - }, - "region": { - "startLine": 16, - "startColumn": 46 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:47.046Z", - "endTime": "2018-09-12T21:45:47.903Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultAttachment.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInResultAttachment.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:47.394Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif deleted file mode 100644 index 9b2aa0d89..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "conversionProvenance": [ - { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance_Expected.sarif deleted file mode 100644 index b7d00bb7d..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/conversionProvenance/0/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif" - }, - "region": { - "startLine": 16, - "startColumn": 46 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:48.296Z", - "endTime": "2018-09-12T21:45:49.155Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultConversionProvenance.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInResultConversionProvenance.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:48.677Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif deleted file mode 100644 index 0d9023866..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "graphs": { - "g1": { - "id": "g1", - "nodes": [ - { - "id": "n1", - "location": { - "physicalLocation": { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - } - } - ], - "edges": [ - { - "id": "e1", - "sourceNodeId": "n1", - "targetNodeId": "n1" - } - ] - } - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode_Expected.sarif deleted file mode 100644 index ec22e3006..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/graphs/g1/nodes/0/location/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif" - }, - "region": { - "startLine": 22, - "startColumn": 54 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:49.555Z", - "endTime": "2018-09-12T21:45:50.372Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultGraphNode.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInResultGraphNode.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:49.901Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif deleted file mode 100644 index 7a0b37ecf..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation_Expected.sarif deleted file mode 100644 index 758a5b6d8..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/locations/0/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif" - }, - "region": { - "startLine": 17, - "startColumn": 48 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:50.724Z", - "endTime": "2018-09-12T21:45:51.563Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInResultLocation.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInResultLocation.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:51.079Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif deleted file mode 100644 index cb5fb5adf..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "graphs": { - "g1": { - "id": "g1", - "nodes": [ - { - "id": "n1", - "location": { - "physicalLocation": { - "fileLocation": { - "uri": "file:///c:/src/file.c", - "uriBaseId": "%SRCROOT%" - } - } - } - } - ], - "edges": [ - { - "id": "e1", - "sourceNodeId": "n1", - "targetNodeId": "n1" - } - ] - } - }, - "results": [] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode_Expected.sarif deleted file mode 100644 index 3a8477aa3..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/graphs/g1/nodes/0/location/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif" - }, - "region": { - "startLine": 18, - "startColumn": 50 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:51.966Z", - "endTime": "2018-09-12T21:45:52.828Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInRunGraphNode.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInRunGraphNode.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:52.318Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif deleted file mode 100644 index 7beb50cdf..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "stacks": [ - { - "frames": [ - { - "location": { - "physicalLocation": { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - } - } - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame_Expected.sarif deleted file mode 100644 index d210e39f1..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/results/0/stacks/0/frames/0/location/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif" - }, - "region": { - "startLine": 21, - "startColumn": 54 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:53.216Z", - "endTime": "2018-09-12T21:45:54.066Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInStackFrame.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInStackFrame.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:53.569Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif deleted file mode 100644 index 9d7afbbd7..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "invocations": [ - { - "toolNotifications": [ - { - "message": { - "text": "Message." - }, - "physicalLocation": { - "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file:///c:/src/file.c" - } - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification_Expected.sarif deleted file mode 100644 index 3df5162f1..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1014", - "level": "error", - "message": { - "messageId": "Default", - "arguments": [ - "/runs/0/invocations/0/toolNotifications/0/physicalLocation/fileLocation/uri", - "file:///c:/src/file.c" - ] - }, - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif" - }, - "region": { - "startLine": 19, - "startColumn": 48 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1014": { - "id": "SARIF1014", - "name": { - "text": "UriBaseIdRequiresRelativeUri" - }, - "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." - }, - "messageStrings": { - "Default": "{0}: This fileLocation object contains a \"uriBaseId\" property, which means that the value of the \"uri\" property must be a relative URI reference, but \"{1}\" is an absolute URI reference." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:54.472Z", - "endTime": "2018-09-12T21:45:55.335Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/AbsoluteUriInToolNotification.sarif" - } - }, - "message": { - "text": "Analyzing 'AbsoluteUriInToolNotification.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:54.813Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Invalid.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Invalid.sarif new file mode 100644 index 000000000..0bd4cf99a --- /dev/null +++ b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Invalid.sarif @@ -0,0 +1,273 @@ +{ + "$schema": "http://json.schemastore.org/sarif-2.0.0", + "version": "2.0.0", + "runs": [ + { + "tool": { + "name": "CodeScanner" + }, + "conversion": { + "tool": { + "name": "ConversionTool" + }, + "analysisToolLogFiles": [ + { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + ] + }, + "files": { + "file.c": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + }, + "graphs": { + "g1": { + "id": "g1", + "nodes": [ + { + "id": "n1", + "location": { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + } + ], + "edges": [ + { + "id": "e1", + "sourceNodeId": "n1", + "targetNodeId": "n1" + } + ] + } + }, + "invocations": [ + { + "attachments": [ + { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + ], + "configurationNotifications": [ + { + "message": { + "text": "Message." + }, + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + ], + "executableLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + }, + "responseFiles": [ + { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + ], + "stdin": { + "uri": "file:///c:/log/in.txt", + "uriBaseId": "%SRCROOT%" + }, + "stdout": { + "uri": "file:///c:/log/out.txt", + "uriBaseId": "%SRCROOT%" + }, + "stderr": { + "uri": "file:///c:/log/err.txt", + "uriBaseId": "%SRCROOT%" + }, + "stdoutStderr": { + "uri": "file:///c:/log/out-err.txt", + "uriBaseId": "%SRCROOT%" + }, + "toolNotifications": [ + { + "message": { + "text": "Message." + }, + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + ] + } + ], + "results": [ + { + "ruleId": "TST0001", + "level": "error", + "analysisTarget": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + }, + "attachments": [ + { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + ], + "conversionProvenance": [ + { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + ], + "graphs": { + "g1": { + "id": "g1", + "nodes": [ + { + "id": "n1", + "location": { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + } + ], + "edges": [ + { + "id": "e1", + "sourceNodeId": "n1", + "targetNodeId": "n1" + } + ] + } + }, + "locations": [ + { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + ], + "relatedLocations": [ + { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + ], + "codeFlows": [ + { + "threadFlows": [ + { + "locations": [ + { + "location": { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + } + ] + } + ] + } + ], + "stacks": [ + { + "frames": [ + { + "location": { + "physicalLocation": { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + } + } + } + } + ] + } + ], + "fixes": [ + { + "fileChanges": [ + { + "fileLocation": { + "uri": "file:///C:/src/file.c", + "uriBaseId": "%SRCROOT%" + }, + "replacements": [ + { + "deletedRegion": { + "charOffset": 0, + "charLength": 1 + } + } + ] + } + ] + } + ] + } + ], + "properties": { + "expectedResults": { + "resultLocationPointers": [ + "runs[0].conversion.analysisToolLogFiles[0].uri", + "runs[0].files['file.c'].fileLocation.uri", + "runs[0].graphs.g1.nodes[0].location.physicalLocation.fileLocation.uri", + "runs[0].invocations[0].attachments[0].fileLocation.uri", + "runs[0].invocations[0].configurationNotifications[0].physicalLocation.fileLocation.uri", + "runs[0].invocations[0].executableLocation.uri", + "runs[0].invocations[0].responseFiles[0].uri", + "runs[0].invocations[0].stdin.uri", + "runs[0].invocations[0].stdout.uri", + "runs[0].invocations[0].stderr.uri", + "runs[0].invocations[0].stdoutStderr.uri", + "runs[0].invocations[0].toolNotifications[0].physicalLocation.fileLocation.uri", + "runs[0].results[0].analysisTarget.uri", + "runs[0].results[0].attachments[0].fileLocation.uri", + "runs[0].results[0].conversionProvenance[0].fileLocation.uri", + "runs[0].results[0].graphs.g1.nodes[0].location.physicalLocation.fileLocation.uri", + "runs[0].results[0].locations[0].physicalLocation.fileLocation.uri", + "runs[0].results[0].relatedLocations[0].physicalLocation.fileLocation.uri", + "runs[0].results[0].codeFlows[0].threadFlows[0].locations[0].location.physicalLocation.fileLocation.uri", + "runs[0].results[0].stacks[0].frames[0].location.physicalLocation.fileLocation.uri", + "runs[0].results[0].fixes[0].fileChanges[0].fileLocation.uri" + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative_Expected.sarif deleted file mode 100644 index b83589754..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative_Expected.sarif +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [], - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-09-12T21:45:55.710Z", - "endTime": "2018-09-12T21:45:56.652Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative.sarif" - } - }, - "message": { - "text": "Analyzing 'UrisAreRelative.sarif'..." - }, - "level": "note", - "time": "2018-09-12T21:45:56.097Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Valid.sarif similarity index 88% rename from src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative.sarif rename to src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Valid.sarif index 7bd7e658d..ab5cbd2fa 100644 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/UrisAreRelative.sarif +++ b/src/Sarif.Multitool.FunctionalTests/TestData/UriBaseIdRequiresRelativeUri/Valid.sarif @@ -67,8 +67,8 @@ }, "physicalLocation": { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" } } } @@ -106,8 +106,8 @@ }, "physicalLocation": { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" } } } @@ -119,8 +119,8 @@ "ruleId": "TST0001", "level": "error", "analysisTarget": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" }, "attachments": [ { @@ -177,8 +177,8 @@ { "physicalLocation": { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" } } } @@ -192,8 +192,8 @@ "location": { "physicalLocation": { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" } } } @@ -210,8 +210,8 @@ "location": { "physicalLocation": { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" } } } @@ -224,8 +224,8 @@ "fileChanges": [ { "fileLocation": { - "uriBaseId": "%SRCROOT%", - "uri": "file.c" + "uri": "file.c", + "uriBaseId": "%SRCROOT%" }, "replacements": [ { @@ -240,7 +240,12 @@ } ] } - ] + ], + "properties": { + "expectedResults": { + "resultLocationPointers": [] + } + } } ] } \ No newline at end of file From 8edb21db9bac824cdaec6211c9301c2253c43f41 Mon Sep 17 00:00:00 2001 From: Larry Golding Date: Thu, 6 Dec 2018 11:04:30 -0800 Subject: [PATCH 3/4] Remove obsolete rule UseAbsolutePathsForNestedFileUriFragments. --- ...lutePathsForNestedFileUriFragmentsTests.cs | 28 ------ ...iFragmentIsRelativeInFileLocationUri.sarif | 26 ------ ...IsRelativeInFileLocationUri_Expected.sarif | 93 ------------------- ...FragmentIsRelativeInFilePropertyName.sarif | 24 ----- ...sRelativeInFilePropertyName_Expected.sarif | 93 ------------------- .../NestedFileUriFragmentsAreAbsolute.sarif | 38 -------- ...FileUriFragmentsAreAbsolute_Expected.sarif | 93 ------------------- src/Sarif.Multitool/Rules/RuleId.cs | 1 - .../Rules/RuleResources.Designer.cs | 18 ---- src/Sarif.Multitool/Rules/RuleResources.resx | 6 -- ...eAbsolutePathsForNestedFileUriFragments.cs | 83 ----------------- 11 files changed, 503 deletions(-) delete mode 100644 src/Sarif.Multitool.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif delete mode 100644 src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif delete mode 100644 src/Sarif.Multitool/Rules/UseAbsolutePathsForNestedFileUriFragments.cs diff --git a/src/Sarif.Multitool.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs b/src/Sarif.Multitool.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs deleted file mode 100644 index 908ecdbe2..000000000 --- a/src/Sarif.Multitool.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Xunit; - -namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules -{ - public class UseAbsolutePathsForNestedFileUriFragmentsTests : ValidationSkimmerTestsBase - { - [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentsAreAbsolute))] - public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentsAreAbsolute() - { - Verify("NestedFileUriFragmentsAreAbsolute.sarif"); - } - - [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFileLocationUri))] - public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFileLocationUri() - { - Verify("NestedFileUriFragmentIsRelativeInFileLocationUri.sarif"); - } - - [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFilePropertyName))] - public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFilePropertyName() - { - Verify("NestedFileUriFragmentIsRelativeInFilePropertyName.sarif"); - } - } -} diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif deleted file mode 100644 index 9cedd5afb..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///c:/bin/myApp.appx#js/minified.js" - } - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri_Expected.sarif deleted file mode 100644 index cfa7b78ac..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1002", - "level": "error", - "message": { - "arguments": [ - "/runs/0/results/0/locations/0/physicalLocation/fileLocation/uri", - "file:///c:/bin/myApp.appx#js/minified.js" - ] - }, - "ruleMessageId": "Default", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif" - }, - "region": { - "startLine": 17, - "startColumn": 67 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1002": { - "id": "SARIF1002", - "name": { - "text": "UseAbsolutePathsForNestedFileUriFragments" - }, - "shortDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path." - }, - "fullDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\"." - }, - "messageStrings": { - "Default": "{0}: The fragment portion of the URI \"{1}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-08-16T22:41:39.727Z", - "endTime": "2018-08-16T22:41:40.710Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileLocationUri.sarif" - } - }, - "message": { - "text": "Analyzing 'NestedFileUriFragmentIsRelativeInFileLocationUri.sarif'..." - }, - "level": "note", - "time": "2018-08-16T22:41:40.158Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif deleted file mode 100644 index ebd9f3e2e..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [], - "files": { - "file:///c:/bin/myApp.appx": { - "mimeType": "application/vns.ms-appx" - }, - "file:///c:/bin/myApp.appx#js/minified.js": { - "fileLocation": { - "uri": "/js/minified.js" - }, - "parentKey": "file:///c:/bin/myApp.appx", - "mimeType": "text/javascript" - } - } - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif deleted file mode 100644 index 1e21c064c..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1002", - "level": "error", - "message": { - "arguments": [ - "/runs/0/files/file:~1~1~1c:~1bin~1myApp.appx#js~1minified.js", - "file:///c:/bin/myApp.appx#js/minified.js" - ] - }, - "ruleMessageId": "Default", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif" - }, - "region": { - "startLine": 14, - "startColumn": 53 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1002": { - "id": "SARIF1002", - "name": { - "text": "UseAbsolutePathsForNestedFileUriFragments" - }, - "shortDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path." - }, - "fullDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\"." - }, - "messageStrings": { - "Default": "{0}: The fragment portion of the URI \"{1}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-08-16T22:41:41.159Z", - "endTime": "2018-08-16T22:41:41.995Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif" - } - }, - "message": { - "text": "Analyzing 'NestedFileUriFragmentIsRelativeInFilePropertyName.sarif'..." - }, - "level": "note", - "time": "2018-08-16T22:41:41.542Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif deleted file mode 100644 index a2792d273..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "CodeScanner" - }, - "results": [ - { - "ruleId": "TST0001", - "level": "error", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///c:/bin/myApp.appx#js/minified.js" - } - } - } - ] - } - ], - "files": { - "file:///c:/bin/myApp.appx": { - "mimeType": "application/vns.ms-appx" - }, - "file:///c:/bin/myApp.appx#/js/minified.js": { - "fileLocation": { - "uri": "/js/minified.js" - }, - "parentKey": "file:///c:/bin/myApp.appx", - "mimeType": "text/javascript" - } - } - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif b/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif deleted file mode 100644 index e16522088..000000000 --- a/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/sarif-2.0.0", - "version": "2.0.0", - "runs": [ - { - "tool": { - "name": "Sarif.Multitool", - "fullName": "Sarif.Multitool 2.0.0.0", - "version": "2.0.0.0", - "semanticVersion": "2.0.0", - "sarifLoggerVersion": "2.0.0.0", - "language": "en-US", - "properties": { - "Comments": "Command line tool to perform transformations of input files to SARIF.", - "CompanyName": "Microsoft", - "ProductName": "Microsoft SARIF SDK" - } - }, - "results": [ - { - "ruleId": "SARIF1002", - "level": "error", - "message": { - "arguments": [ - "/runs/0/results/0/locations/0/physicalLocation/fileLocation/uri", - "file:///c:/bin/myApp.appx#js/minified.js" - ] - }, - "ruleMessageId": "Default", - "locations": [ - { - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif" - }, - "region": { - "startLine": 17, - "startColumn": 67 - } - } - } - ] - } - ], - "resources": { - "rules": { - "SARIF1002": { - "id": "SARIF1002", - "name": { - "text": "UseAbsolutePathsForNestedFileUriFragments" - }, - "shortDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path." - }, - "fullDescription": { - "text": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\"." - }, - "messageStrings": { - "Default": "{0}: The fragment portion of the URI \"{1}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash." - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.0/csprd01/sarif-v2.0-csprd01.html" - } - } - }, - "files": { - "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif": { - "mimeType": "application/sarif-json" - } - }, - "invocations": [ - { - "startTime": "2018-08-16T22:41:42.385Z", - "endTime": "2018-08-16T22:41:43.170Z", - "toolNotifications": [ - { - "id": "MSG001.AnalyzingTarget", - "physicalLocation": { - "fileLocation": { - "uri": "file:///C:/Code/sarif-sdk/src/Sarif.Multitool.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif" - } - }, - "message": { - "text": "Analyzing 'NestedFileUriFragmentsAreAbsolute.sarif'..." - }, - "level": "note", - "time": "2018-08-16T22:41:42.726Z" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Sarif.Multitool/Rules/RuleId.cs b/src/Sarif.Multitool/Rules/RuleId.cs index fdb125e5a..42e9193b4 100644 --- a/src/Sarif.Multitool/Rules/RuleId.cs +++ b/src/Sarif.Multitool/Rules/RuleId.cs @@ -6,7 +6,6 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules public static class RuleId { public const string DoNotUseFriendlyNameAsRuleId = "SARIF1001"; - public const string UseAbsolutePathsForNestedFileUriFragments = "SARIF1002"; public const string UrisMustBeValid = "SARIF1003"; public const string HashAlgorithmsMustBeUnique = "SARIF1006"; public const string EndTimeMustNotBeBeforeStartTime = "SARIF1007"; diff --git a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs index ee8df0d4f..9524ea040 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs +++ b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs @@ -78,24 +78,6 @@ internal static string SARIF1001_DoNotUseFriendlyNameAsRuleIdDescription { } } - /// - /// Looks up a localized string similar to {0}: The fragment portion of the URI "{1}", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash.. - /// - internal static string SARIF1002_Default { - get { - return ResourceManager.GetString("SARIF1002_Default", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example "file:///C:/bin/MyApp.zip#/images/grape.jpg".. - /// - internal static string SARIF1002_UseAbsolutePathsForNestedFileUriFragmentsDescription { - get { - return ResourceManager.GetString("SARIF1002_UseAbsolutePathsForNestedFileUriFragmentsDescription", resourceCulture); - } - } - /// /// Looks up a localized string similar to {0}: The string "{1}" is not a valid URI reference.. /// diff --git a/src/Sarif.Multitool/Rules/RuleResources.resx b/src/Sarif.Multitool/Rules/RuleResources.resx index 984f12fc0..833999daf 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.resx +++ b/src/Sarif.Multitool/Rules/RuleResources.resx @@ -123,12 +123,6 @@ Do not use the same string for a rule's id and name properties. The id property must be a stable, opaque identifer such as "SARIF1001". The name property should be a string that is understandable to an end user, such as "DoNotUserFriendlyNameAsRuleId". - - {0}: The fragment portion of the URI "{1}", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash. - - - When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example "file:///C:/bin/MyApp.zip#/images/grape.jpg". - {0}: The string "{1}" is not a valid URI reference. diff --git a/src/Sarif.Multitool/Rules/UseAbsolutePathsForNestedFileUriFragments.cs b/src/Sarif.Multitool/Rules/UseAbsolutePathsForNestedFileUriFragments.cs deleted file mode 100644 index e3024d1fd..000000000 --- a/src/Sarif.Multitool/Rules/UseAbsolutePathsForNestedFileUriFragments.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using Microsoft.Json.Pointer; - -namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules -{ - public class UseAbsolutePathsForNestedFileUriFragments : SarifValidationSkimmerBase - { - private Message _fullDescription = new Message - { - Text = RuleResources.SARIF1002_UseAbsolutePathsForNestedFileUriFragmentsDescription - }; - - public override Message FullDescription => _fullDescription; - - public override ResultLevel DefaultLevel => ResultLevel.Error; - - /// - /// SARIF1002 - /// - public override string Id => RuleId.UseAbsolutePathsForNestedFileUriFragments; - - protected override IEnumerable MessageResourceNames => new string[] - { - nameof(RuleResources.SARIF1002_Default) - }; - - protected override void Analyze(FileLocation fileLocation, string fileLocationPointer) - { - AnalyzeUri(fileLocation.Uri, fileLocationPointer.AtProperty(SarifPropertyName.Uri)); - } - - // In addition to appearing in fileLocation objects, URIs with fragments might - // appear as property names in the run.files dictionary. - protected override void Analyze(FileData fileData, string fileKey, string filePointer) - { - if (!Uri.IsWellFormedUriString(fileKey, UriKind.RelativeOrAbsolute)) - { - // It wasn't a value URI. Rule SARIF1003, UrisMustBeValid, will catch this problem. - return; - } - - Uri fileKeyUri = new Uri(fileKey, UriKind.RelativeOrAbsolute); - AnalyzeUri(fileKeyUri, filePointer); - } - - private void AnalyzeUri(Uri uri, string pointer) - { - if (UriHasNonAbsoluteFragment(uri)) - { - LogResult(pointer, nameof(RuleResources.SARIF1002_Default), uri.OriginalString); - } - } - - private bool UriHasNonAbsoluteFragment(Uri uri) - { - if (uri == null) - { - return false; - } - - // You can't access the Fragment property of a relative URI, so if this URI is - // relative, turn it into a fake absolute URI, and get the fragment from that. - Uri absoluteUri = uri.IsAbsoluteUri - ? uri - : MakeFakeAbsoluteUri(uri); - - string fragment = absoluteUri.Fragment; - - return !string.IsNullOrEmpty(fragment) && !fragment.StartsWith("#/", StringComparison.Ordinal); - } - - private static readonly Uri _fakeBaseUri = new Uri("file:///root", UriKind.Absolute); - - private static Uri MakeFakeAbsoluteUri(Uri relativeUri) - { - return new Uri(_fakeBaseUri, relativeUri); - } - } -} From 2f96799862c12ca06c17797646d093a0e217097b Mon Sep 17 00:00:00 2001 From: Larry Golding Date: Thu, 6 Dec 2018 11:14:36 -0800 Subject: [PATCH 4/4] Remove support for old test design. --- .../Rules/ValidationSkimmerTestsBase.cs | 49 ++----------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/src/Sarif.Multitool.FunctionalTests/Rules/ValidationSkimmerTestsBase.cs b/src/Sarif.Multitool.FunctionalTests/Rules/ValidationSkimmerTestsBase.cs index 3354906a8..934b3d060 100644 --- a/src/Sarif.Multitool.FunctionalTests/Rules/ValidationSkimmerTestsBase.cs +++ b/src/Sarif.Multitool.FunctionalTests/Rules/ValidationSkimmerTestsBase.cs @@ -29,24 +29,6 @@ protected void Verify(string testFileName) Verify(testFileName, disablePrereleaseCompatibilityTransform: false); } - // For the moment, we support two different test designs. - // - // The new, preferred design (all new tests should be written this way): - // - // The test file itself contains a custom property that summarizes the expected - // results of running the rule on the test file. - // - // The old, deprecated design: - // - // To each test file there exists a corresponding file whose name ends in - // "_Expected.sarif" that contains the expected results of running the rule - // on the test file. We perform a "selective compare" of the expected and - // actual validation log file contents. - // - // As we migrate from the old to the new design, if the custom property exists, - // we use the new design, if the "expected" file exists, we use the old design, - // and if both the custom property and the "expected" file exist, we execute - // both the new and the old style tests. protected void Verify(string testFileName, bool disablePrereleaseCompatibilityTransform) { string targetPath = Path.Combine(_testDirectory, testFileName); @@ -61,6 +43,9 @@ protected void Verify(string testFileName, bool disablePrereleaseCompatibilityTr SarifLog inputLog = JsonConvert.DeserializeObject(inputLogContents); + bool expectedResultsArePresent = inputLog.Runs[0].TryGetProperty(ExpectedResultsPropertyName, out ExpectedValidationResults expectedResults); + expectedResultsArePresent.Should().Be(true); + var skimmer = new TSkimmer(); using (var logger = new SarifLogger( @@ -92,33 +77,9 @@ protected void Verify(string testFileName, bool disablePrereleaseCompatibilityTr } string actualLogContents = File.ReadAllText(actualFilePath); - bool resultsWereVerified = false; - - string expectedFilePath = MakeExpectedFilePath(_testDirectory, testFileName); - if (File.Exists(expectedFilePath)) - { - // The "expected" file exists. Use the old, deprecated verification method. - string expectedLogContents = File.ReadAllText(expectedFilePath); - expectedLogContents = PrereleaseCompatibilityTransformer.UpdateToCurrentVersion(expectedLogContents, formatting: Formatting.Indented); - - // We can't just compare the text of the log files because properties - // like start time, and absolute paths, will differ from run to run. - // Until SarifLogger has a "deterministic" option (see http://github.com/Microsoft/sarif-sdk/issues/500), - // we perform a selective compare of just the elements we care about. - SelectiveCompare(actualLogContents, expectedLogContents); - resultsWereVerified = true; - } - - if (inputLog.Runs[0].TryGetProperty(ExpectedResultsPropertyName, out ExpectedValidationResults expectedResults)) - { - // The custom property exists. Use the new, preferred verification method. - SarifLog outputLog = JsonConvert.DeserializeObject(actualLogContents); - Verify(outputLog.Runs[0], expectedResults); - resultsWereVerified = true; - } + SarifLog outputLog = JsonConvert.DeserializeObject(actualLogContents); - // Temporary: make sure at least one of the verification methods executed. - resultsWereVerified.Should().BeTrue(); + Verify(outputLog.Runs[0], expectedResults); } // Every validation message begins with a placeholder "{0}: " that specifies the