From 6553f21ccef8bd92f8f405ceede6ae7b2f25408a Mon Sep 17 00:00:00 2001 From: Harleen Kaur Kohli Date: Fri, 19 Jun 2020 16:50:08 -0700 Subject: [PATCH] validation rule 1004 (#1923) * renaming ruleid and tested * rulename changed and tested * description resx changed * merged test cases into one rule * cleanup and reordering Co-authored-by: Harleen Kaur Kohli --- src/Sarif.Multitool/Rules/RuleId.cs | 8 +- .../Rules/RuleResources.Designer.cs | 96 +++++---- src/Sarif.Multitool/Rules/RuleResources.resx | 13 +- ...> SARIF1004.ExpressUriBaseIdsCorrectly.cs} | 26 ++- .../SARIF1014.UriBaseIdRequiresRelativeUri.cs | 36 ---- .../Multitool/ValidateCommandTests.cs | 55 +++-- ....ExpressUriBaseIdsCorrectly_Invalid.sarif} | 190 +++++++++++++----- ...04.ExpressUriBaseIdsCorrectly_Valid.sarif} | 2 +- ...validUriInOriginalUriBaseIds_Invalid.sarif | 128 ------------ ...InvalidUriInOriginalUriBaseIds_Valid.sarif | 28 --- ....ExpressUriBaseIdsCorrectly_Invalid.sarif} | 15 ++ ...04.ExpressUriBaseIdsCorrectly_Valid.sarif} | 20 ++ ...validUriInOriginalUriBaseIds_Invalid.sarif | 30 --- ...InvalidUriInOriginalUriBaseIds_Valid.sarif | 35 ---- 14 files changed, 271 insertions(+), 411 deletions(-) rename src/Sarif.Multitool/Rules/{SARIF1018.InvalidUriInOriginalUriBaseIds.cs => SARIF1004.ExpressUriBaseIdsCorrectly.cs} (64%) delete mode 100644 src/Sarif.Multitool/Rules/SARIF1014.UriBaseIdRequiresRelativeUri.cs rename src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/{SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif => SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif} (71%) rename src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/{SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif => SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif} (91%) delete mode 100644 src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif delete mode 100644 src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif rename src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/{SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif => SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif} (90%) rename src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/{SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif => SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif} (89%) delete mode 100644 src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif delete mode 100644 src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif diff --git a/src/Sarif.Multitool/Rules/RuleId.cs b/src/Sarif.Multitool/Rules/RuleId.cs index 9d4816de4..099109b58 100644 --- a/src/Sarif.Multitool/Rules/RuleId.cs +++ b/src/Sarif.Multitool/Rules/RuleId.cs @@ -7,16 +7,16 @@ public static class RuleId { public const string RuleIdentifiersMustBeValid = "SARIF1001"; public const string UrisMustBeValid = "SARIF1002"; + public const string ExpressUriBaseIdsCorrectly = "SARIF1004"; + public const string UriMustBeAbsolute = "SARIF1005"; public const string InvocationPropertiesMustBeConsistent = "SARIF1006"; - public const string AuthorHighQualityMessages = "SARIF2001"; public const string RegionPropertiesMustBeConsistent = "SARIF1007"; - public const string UriBaseIdRequiresRelativeUri = "SARIF1014"; - public const string UriMustBeAbsolute = "SARIF1005"; public const string PhysicalLocationPropertiesMustBeConsistent = "SARIF1008"; public const string IndexPropertiesMustBeConsistentWithArrays = "SARIF1009"; - public const string InvalidUriInOriginalUriBaseIds = "SARIF1018"; public const string RuleIdMustBeConsistent = "SARIF1010"; public const string ReferenceFinalSchema = "SARIF1011"; + + public const string AuthorHighQualityMessages = "SARIF2001"; public const string ProvideSchema = "SARIF2008"; } } diff --git a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs index e878b8b77..db0c92508 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.Designer.cs +++ b/src/Sarif.Multitool/Rules/RuleResources.Designer.cs @@ -96,6 +96,42 @@ internal static string SARIF1002_UrisMustBeValid_FullDescription_Text { } } + /// + /// Looks up a localized string similar to {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds is not an absolute URI.. + /// + internal static string SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text { + get { + return ResourceManager.GetString("SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {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.. + /// + internal static string SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text { + get { + return ResourceManager.GetString("SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds does not end with a slash.. + /// + internal static string SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text { + get { + return ResourceManager.GetString("SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Placeholder_SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text. + /// + internal static string SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text { + get { + return ResourceManager.GetString("SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0}: The value of this property is required to be an absolute URI, but "{1}" is a relative URI reference.. /// @@ -138,7 +174,8 @@ internal static string SARIF1006_InvocationPropertiesMustBeConsistent_FullDescri /// internal static string SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColumnMustNotPrecedeStartColumn_Text { get { - return ResourceManager.GetString("SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColumnMustNotPrecedeStartColumn_Text", resourceCulture); + return ResourceManager.GetString("SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColumnMustNotPrecedeStartColu" + + "mn_Text", resourceCulture); } } @@ -147,7 +184,8 @@ internal static string SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColum /// internal static string SARIF1007_RegionPropertiesMustBeConsistent_Error_EndLineMustNotPrecedeStartLine_Text { get { - return ResourceManager.GetString("SARIF1007_RegionPropertiesMustBeConsistent_Error_EndLineMustNotPrecedeStartLine_Text", resourceCulture); + return ResourceManager.GetString("SARIF1007_RegionPropertiesMustBeConsistent_Error_EndLineMustNotPrecedeStartLine_T" + + "ext", resourceCulture); } } @@ -165,7 +203,8 @@ internal static string SARIF1007_RegionPropertiesMustBeConsistent_FullDescriptio /// internal static string SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionRequiresRegion_Text { get { - return ResourceManager.GetString("SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionRequiresRegion_Text", resourceCulture); + return ResourceManager.GetString("SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionRequiresR" + + "egion_Text", resourceCulture); } } @@ -183,7 +222,8 @@ internal static string SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Full /// internal static string SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustBeLongEnough_Text { get { - return ResourceManager.GetString("SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustBeLongEnough_Text", resourceCulture); + return ResourceManager.GetString("SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustBeLongEn" + + "ough_Text", resourceCulture); } } @@ -192,7 +232,8 @@ internal static string SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error /// internal static string SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustExist_Text { get { - return ResourceManager.GetString("SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustExist_Text", resourceCulture); + return ResourceManager.GetString("SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustExist_Te" + + "xt", resourceCulture); } } @@ -250,51 +291,6 @@ internal static string SARIF1011_ReferenceFinalSchema_FullDescription_Text { } } - /// - /// Looks up a localized string similar to {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.. - /// - internal static string SARIF1014_Default { - get { - return ResourceManager.GetString("SARIF1014_Default", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to If a fileLocation object contains a "uriBaseId" property, the value of the "uri" property must be a relative URI reference.. - /// - internal static string SARIF1014_UriBaseIdRequiresRelativeUri { - get { - return ResourceManager.GetString("SARIF1014_UriBaseIdRequiresRelativeUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to In the artifactLocation objects contained in run.originalUriBaseIds, if uriBaseId is absent, then uri must either be an absolute URI or it must be absent. Also, uri must end with a slash, so that it can safely be combined with the relative URIs in artifactLocation objects elsewhere in the log file.. - /// - internal static string SARIF1018_InvalidUriInOriginalUriBaseIds { - get { - return ResourceManager.GetString("SARIF1018_InvalidUriInOriginalUriBaseIds", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds does not end with a slash.. - /// - internal static string SARIF1018_LacksTrailingSlash { - get { - return ResourceManager.GetString("SARIF1018_LacksTrailingSlash", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds is not an absolute URI.. - /// - internal static string SARIF1018_NotAbsolute { - get { - return ResourceManager.GetString("SARIF1018_NotAbsolute", resourceCulture); - } - } - /// /// Looks up a localized string similar to Messages should consist of one or more complete sentences, ending with a period.. /// diff --git a/src/Sarif.Multitool/Rules/RuleResources.resx b/src/Sarif.Multitool/Rules/RuleResources.resx index 5bee270fe..8eb62cc77 100644 --- a/src/Sarif.Multitool/Rules/RuleResources.resx +++ b/src/Sarif.Multitool/Rules/RuleResources.resx @@ -141,11 +141,11 @@ Messages should consist of one or more complete sentences, ending with a period. - + {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. - - If a fileLocation object contains a "uriBaseId" property, the value of the "uri" property must be a relative URI reference. + + Placeholder_SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text {0}: The value of this property is required to be an absolute URI, but "{1}" is a relative URI reference. @@ -165,13 +165,10 @@ If an object contains a property that is used as an array index, then that array must be present and must contain at least "index + 1" elements. - - In the artifactLocation objects contained in run.originalUriBaseIds, if uriBaseId is absent, then uri must either be an absolute URI or it must be absent. Also, uri must end with a slash, so that it can safely be combined with the relative URIs in artifactLocation objects elsewhere in the log file. - - + {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds does not end with a slash. - + {0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds is not an absolute URI. diff --git a/src/Sarif.Multitool/Rules/SARIF1018.InvalidUriInOriginalUriBaseIds.cs b/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs similarity index 64% rename from src/Sarif.Multitool/Rules/SARIF1018.InvalidUriInOriginalUriBaseIds.cs rename to src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs index 23ce7b124..6c9d30b89 100644 --- a/src/Sarif.Multitool/Rules/SARIF1018.InvalidUriInOriginalUriBaseIds.cs +++ b/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs @@ -7,23 +7,35 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { - public class InvalidUriInOriginalUriBaseIds : SarifValidationSkimmerBase + public class ExpressUriBaseIdsCorrectly : SarifValidationSkimmerBase { public override MultiformatMessageString FullDescription => new MultiformatMessageString { - Text = RuleResources.SARIF1018_InvalidUriInOriginalUriBaseIds + Text = RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text }; public override FailureLevel DefaultLevel => FailureLevel.Error; - public override string Id => RuleId.InvalidUriInOriginalUriBaseIds; + public override string Id => RuleId.ExpressUriBaseIdsCorrectly; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1018_NotAbsolute), - nameof(RuleResources.SARIF1018_LacksTrailingSlash) + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text) }; + protected override void Analyze(ArtifactLocation fileLocation, string fileLocationPointer) + { + if (fileLocation.UriBaseId != null && fileLocation.Uri.IsAbsoluteUri) + { + LogResult( + fileLocationPointer.AtProperty(SarifPropertyName.Uri), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text), + fileLocation.Uri.OriginalString); + } + } + protected override void Analyze(Run run, string runPointer) { if (run.OriginalUriBaseIds != null) @@ -53,12 +65,12 @@ private void AnalyzeOriginalUriBaseIdsEntry(string uriBaseId, ArtifactLocation a if (artifactLocation.UriBaseId == null && !uri.IsAbsoluteUri) { - LogResult(pointer, nameof(RuleResources.SARIF1018_NotAbsolute), uriString, uriBaseId); + LogResult(pointer, nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text), uriString, uriBaseId); } if (!uriString.EndsWith("/")) { - LogResult(pointer, nameof(RuleResources.SARIF1018_LacksTrailingSlash), uriString, uriBaseId); + LogResult(pointer, nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text), uriString, uriBaseId); } } } diff --git a/src/Sarif.Multitool/Rules/SARIF1014.UriBaseIdRequiresRelativeUri.cs b/src/Sarif.Multitool/Rules/SARIF1014.UriBaseIdRequiresRelativeUri.cs deleted file mode 100644 index 5a17c83d1..000000000 --- a/src/Sarif.Multitool/Rules/SARIF1014.UriBaseIdRequiresRelativeUri.cs +++ /dev/null @@ -1,36 +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.Collections.Generic; -using Microsoft.Json.Pointer; - -namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules -{ - public class UriBaseIdRequiresRelativeUri : SarifValidationSkimmerBase - { - public override MultiformatMessageString FullDescription => new MultiformatMessageString - { - Text = RuleResources.SARIF1014_UriBaseIdRequiresRelativeUri - }; - - public override FailureLevel DefaultLevel => FailureLevel.Error; - - public override string Id => RuleId.UriBaseIdRequiresRelativeUri; - - protected override IEnumerable MessageResourceNames => new string[] - { - nameof(RuleResources.SARIF1014_Default) - }; - - protected override void Analyze(ArtifactLocation fileLocation, string fileLocationPointer) - { - if (fileLocation.UriBaseId != null && fileLocation.Uri.IsAbsoluteUri) - { - LogResult( - fileLocationPointer.AtProperty(SarifPropertyName.Uri), - nameof(RuleResources.SARIF1014_Default), - fileLocation.Uri.OriginalString); - } - } - } -} diff --git a/src/Test.FunctionalTests.Sarif/Multitool/ValidateCommandTests.cs b/src/Test.FunctionalTests.Sarif/Multitool/ValidateCommandTests.cs index e4f14f192..fa18cb319 100644 --- a/src/Test.FunctionalTests.Sarif/Multitool/ValidateCommandTests.cs +++ b/src/Test.FunctionalTests.Sarif/Multitool/ValidateCommandTests.cs @@ -48,6 +48,22 @@ public void SARIF1002_UrisMustBeValid_Valid() public void SARIF1002_UrisMustBeValid_Invalid() => RunTest(MakeInvalidTestFileName(RuleId.UrisMustBeValid, nameof(RuleId.UrisMustBeValid))); + [Fact] + public void SARIF1004_ExpressUriBaseIdsCorrectly_Valid() + => RunTest(MakeValidTestFileName(RuleId.ExpressUriBaseIdsCorrectly, nameof(RuleId.ExpressUriBaseIdsCorrectly))); + + [Fact] + public void SARIF1004_ExpressUriBaseIdsCorrectly_Invalid() + => RunTest(MakeInvalidTestFileName(RuleId.ExpressUriBaseIdsCorrectly, nameof(RuleId.ExpressUriBaseIdsCorrectly))); + + [Fact] + public void SARIF1005_UriMustBeAbsolute_Valid() + => RunTest(MakeValidTestFileName(RuleId.UriMustBeAbsolute, nameof(RuleId.UriMustBeAbsolute))); + + [Fact] + public void SARIF1005_UriMustBeAbsolute_Invalid() + => RunTest(MakeInvalidTestFileName(RuleId.UriMustBeAbsolute, nameof(RuleId.UriMustBeAbsolute))); + [Fact] public void SARIF1006_InvocationPropertiesMustBeConsistent_Valid() => RunTest(MakeValidTestFileName(RuleId.InvocationPropertiesMustBeConsistent, nameof(RuleId.InvocationPropertiesMustBeConsistent))); @@ -55,13 +71,6 @@ public void SARIF1006_InvocationPropertiesMustBeConsistent_Valid() [Fact] public void SARIF1006_InvocationPropertiesMustBeConsistent_Invalid() => RunTest(MakeInvalidTestFileName(RuleId.InvocationPropertiesMustBeConsistent, nameof(RuleId.InvocationPropertiesMustBeConsistent))); - [Fact] - public void SARIF2001_AuthorHighQualityMessages_Valid() - => RunTest(MakeValidTestFileName(RuleId.AuthorHighQualityMessages, nameof(RuleId.AuthorHighQualityMessages))); - - [Fact] - public void SARIF2001_AuthorHighQualityMessages_Invalid() - => RunTest(MakeInvalidTestFileName(RuleId.AuthorHighQualityMessages, nameof(RuleId.AuthorHighQualityMessages))); /****************** * This set of tests constructs a full file path that exceeds MAX_PATH when running in some AzureDevOps build and test @@ -79,22 +88,6 @@ public void SARIF1007_RegionPropertiesMustBeConsistent_Invalid() /********** END PROBLEMATIC TESTS*******/ - [Fact] - public void SARIF1014_UriBaseIdRequiresRelativeUri_Valid() - => RunTest(MakeValidTestFileName(RuleId.UriBaseIdRequiresRelativeUri, nameof(RuleId.UriBaseIdRequiresRelativeUri))); - - [Fact] - public void SARIF1014_UriBaseIdRequiresRelativeUri_Invalid() - => RunTest(MakeInvalidTestFileName(RuleId.UriBaseIdRequiresRelativeUri, nameof(RuleId.UriBaseIdRequiresRelativeUri))); - - [Fact] - public void SARIF1005_UriMustBeAbsolute_Valid() - => RunTest(MakeValidTestFileName(RuleId.UriMustBeAbsolute, nameof(RuleId.UriMustBeAbsolute))); - - [Fact] - public void SARIF1005_UriMustBeAbsolute_Invalid() - => RunTest(MakeInvalidTestFileName(RuleId.UriMustBeAbsolute, nameof(RuleId.UriMustBeAbsolute))); - [Fact] public void SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Valid() => RunTest(MakeValidTestFileName(RuleId.PhysicalLocationPropertiesMustBeConsistent, nameof(RuleId.PhysicalLocationPropertiesMustBeConsistent))); @@ -111,14 +104,6 @@ public void SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Valid() public void SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Invalid() => RunTest(MakeInvalidTestFileName(RuleId.IndexPropertiesMustBeConsistentWithArrays, nameof(RuleId.IndexPropertiesMustBeConsistentWithArrays))); - [Fact] - public void SARIF1018_InvalidUriInOriginalUriBaseIds_Valid() - => RunTest(MakeValidTestFileName(RuleId.InvalidUriInOriginalUriBaseIds, nameof(RuleId.InvalidUriInOriginalUriBaseIds))); - - [Fact] - public void SARIF1018_InvalidUriInOriginalUriBaseIds_Invalid() - => RunTest(MakeInvalidTestFileName(RuleId.InvalidUriInOriginalUriBaseIds, nameof(RuleId.InvalidUriInOriginalUriBaseIds))); - [Fact] public void SARIF1010_RuleIdMustBeConsistent_Valid() => RunTest(MakeValidTestFileName(RuleId.RuleIdMustBeConsistent, nameof(RuleId.RuleIdMustBeConsistent))); @@ -135,6 +120,14 @@ public void SARIF1011_ReferenceFinalSchema_Valid() public void SARIF1011_ReferenceFinalSchema_Invalid() => RunTest(MakeInvalidTestFileName(RuleId.ReferenceFinalSchema, nameof(RuleId.ReferenceFinalSchema))); + [Fact] + public void SARIF2001_AuthorHighQualityMessages_Valid() + => RunTest(MakeValidTestFileName(RuleId.AuthorHighQualityMessages, nameof(RuleId.AuthorHighQualityMessages))); + + [Fact] + public void SARIF2001_AuthorHighQualityMessages_Invalid() + => RunTest(MakeInvalidTestFileName(RuleId.AuthorHighQualityMessages, nameof(RuleId.AuthorHighQualityMessages))); + [Fact] public void SARIF2008_ProvideSchema_Valid() => RunTest(MakeValidTestFileName(RuleId.ProvideSchema, nameof(RuleId.ProvideSchema))); diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif similarity index 71% rename from src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif rename to src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif index c755231b8..c4f7d98bc 100644 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif +++ b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif @@ -8,17 +8,23 @@ "name": "SARIF Functional Testing", "rules": [ { - "id": "SARIF1014", - "name": "UriBaseIdRequiresRelativeUri", + "id": "SARIF1004", + "name": "ExpressUriBaseIdsCorrectly", "shortDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." + "text": "Placeholder_SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text." }, "fullDescription": { - "text": "If a fileLocation object contains a \"uriBaseId\" property, the value of the \"uri\" property must be a relative URI reference." + "text": "Placeholder_SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text" }, "messageStrings": { - "Default": { + "Error_UriBaseIdRequiresRelativeUri": { "text": "{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." + }, + "Error_TopLevelUriBaseIdMustBeAbsolute": { + "text": "{0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds is not an absolute URI." + }, + "Error_UriBaseIdValueMustEndWithSlash": { + "text": "{0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds does not end with a slash." } }, "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html" @@ -34,18 +40,96 @@ "artifacts": [ { "location": { - "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif", + "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif", "uriBaseId": "TEST_DIR" } } ], "results": [ { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_TopLevelUriBaseIdMustBeAbsolute", + "arguments": [ + "runs[0].originalUriBaseIds.PROJECT_ROOT", + "project", + "PROJECT_ROOT" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "index": 0 + }, + "region": { + "startLine": 100, + "startColumn": 25 + } + } + } + ] + }, + { + "ruleId": "SARIF1004", + "ruleIndex": 0, + "level": "error", + "message": { + "id": "Error_UriBaseIdValueMustEndWithSlash", + "arguments": [ + "runs[0].originalUriBaseIds.PROJECT_ROOT", + "project", + "PROJECT_ROOT" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "index": 0 + }, + "region": { + "startLine": 100, + "startColumn": 25 + } + } + } + ] + }, + { + "ruleId": "SARIF1004", + "ruleIndex": 0, + "level": "error", + "message": { + "id": "Error_UriBaseIdValueMustEndWithSlash", + "arguments": [ + "runs[0].originalUriBaseIds.SOURCE_ROOT", + "src", + "SOURCE_ROOT" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "index": 0 + }, + "region": { + "startLine": 106, + "startColumn": 24 + } + } + } + ] + }, + { + "ruleId": "SARIF1004", + "ruleIndex": 0, + "level": "error", + "message": { + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].conversion.analysisToolLogFiles[0].uri", "file:///C:/src/file.c" @@ -66,11 +150,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].analysisTarget.uri", "file:///C:/src/file.c" @@ -83,7 +167,7 @@ "index": 0 }, "region": { - "startLine": 115, + "startLine": 130, "startColumn": 42 } } @@ -91,11 +175,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].attachments[0].artifactLocation.uri", "file:///C:/src/file.c" @@ -108,7 +192,7 @@ "index": 0 }, "region": { - "startLine": 177, + "startLine": 192, "startColumn": 46 } } @@ -116,11 +200,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -133,7 +217,7 @@ "index": 0 }, "region": { - "startLine": 122, + "startLine": 137, "startColumn": 48 } } @@ -141,11 +225,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].codeFlows[0].threadFlows[0].locations[0].location.physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -158,7 +242,7 @@ "index": 0 }, "region": { - "startLine": 153, + "startLine": 168, "startColumn": 58 } } @@ -166,11 +250,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].provenance.conversionSources[0].artifactLocation.uri", "file:///C:/src/file.c" @@ -183,7 +267,7 @@ "index": 0 }, "region": { - "startLine": 186, + "startLine": 201, "startColumn": 48 } } @@ -191,11 +275,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].stacks[0].frames[0].location.physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -208,7 +292,7 @@ "index": 0 }, "region": { - "startLine": 135, + "startLine": 150, "startColumn": 54 } } @@ -216,11 +300,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].relatedLocations[0].physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -233,7 +317,7 @@ "index": 0 }, "region": { - "startLine": 168, + "startLine": 183, "startColumn": 48 } } @@ -241,11 +325,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].results[0].fixes[0].artifactChanges[0].artifactLocation.uri", "file:///C:/src/file.c" @@ -258,7 +342,7 @@ "index": 0 }, "region": { - "startLine": 197, + "startLine": 212, "startColumn": 50 } } @@ -266,11 +350,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].artifacts[0].location.uri", "file:///C:/src/file.c" @@ -283,7 +367,7 @@ "index": 0 }, "region": { - "startLine": 102, + "startLine": 117, "startColumn": 42 } } @@ -291,11 +375,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].executableLocation.uri", "file:///C:/src/file.c" @@ -316,11 +400,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].responseFiles[0].uri", "file:///C:/src/file.c" @@ -341,11 +425,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].stdin.uri", "file:///c:/log/in.txt" @@ -366,11 +450,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].stdout.uri", "file:///c:/log/out.txt" @@ -391,11 +475,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].stderr.uri", "file:///c:/log/err.txt" @@ -416,11 +500,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].stdoutStderr.uri", "file:///c:/log/out-err.txt" @@ -441,11 +525,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].toolExecutionNotifications[0].locations[0].physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -466,11 +550,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].invocations[0].toolConfigurationNotifications[0].locations[0].physicalLocation.artifactLocation.uri", "file:///C:/src/file.c" @@ -491,11 +575,11 @@ ] }, { - "ruleId": "SARIF1014", + "ruleId": "SARIF1004", "ruleIndex": 0, "level": "error", "message": { - "id": "Default", + "id": "Error_UriBaseIdRequiresRelativeUri", "arguments": [ "runs[0].versionControlProvenance[0].mappedTo.uri", "file:///C:/src/file.c" diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif similarity index 91% rename from src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif rename to src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif index d810bac03..986046616 100644 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif +++ b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif @@ -16,7 +16,7 @@ "artifacts": [ { "location": { - "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif", + "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif", "uriBaseId": "TEST_DIR" } } diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif deleted file mode 100644 index 82e99fb1e..000000000 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif +++ /dev/null @@ -1,128 +0,0 @@ -{ - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "SARIF Functional Testing", - "rules": [ - { - "id": "SARIF1018", - "name": "InvalidUriInOriginalUriBaseIds", - "shortDescription": { - "text": "In the artifactLocation objects contained in run.originalUriBaseIds, if uriBaseId is absent, then uri must either be an absolute URI or it must be absent." - }, - "fullDescription": { - "text": "In the artifactLocation objects contained in run.originalUriBaseIds, if uriBaseId is absent, then uri must either be an absolute URI or it must be absent. Also, uri must end with a slash, so that it can safely be combined with the relative URIs in artifactLocation objects elsewhere in the log file." - }, - "messageStrings": { - "NotAbsolute": { - "text": "{0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds is not an absolute URI." - }, - "LacksTrailingSlash": { - "text": "{0}: The URI '{1}' belonging to the '{2}' element of run.originalUriBaseIds does not end with a slash." - } - }, - "helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html" - } - ] - } - }, - "invocations": [ - { - "executionSuccessful": true - } - ], - "artifacts": [ - { - "location": { - "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif", - "uriBaseId": "TEST_DIR" - } - } - ], - "results": [ - { - "ruleId": "SARIF1018", - "ruleIndex": 0, - "level": "error", - "message": { - "id": "NotAbsolute", - "arguments": [ - "runs[0].originalUriBaseIds.PROJECT_ROOT", - "project", - "PROJECT_ROOT" - ] - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "index": 0 - }, - "region": { - "startLine": 12, - "startColumn": 25 - } - } - } - ] - }, - { - "ruleId": "SARIF1018", - "ruleIndex": 0, - "level": "error", - "message": { - "id": "LacksTrailingSlash", - "arguments": [ - "runs[0].originalUriBaseIds.PROJECT_ROOT", - "project", - "PROJECT_ROOT" - ] - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "index": 0 - }, - "region": { - "startLine": 12, - "startColumn": 25 - } - } - } - ] - }, - { - "ruleId": "SARIF1018", - "ruleIndex": 0, - "level": "error", - "message": { - "id": "LacksTrailingSlash", - "arguments": [ - "runs[0].originalUriBaseIds.SOURCE_ROOT", - "src", - "SOURCE_ROOT" - ] - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "index": 0 - }, - "region": { - "startLine": 18, - "startColumn": 24 - } - } - } - ] - } - ], - "columnKind": "utf16CodeUnits" - } - ] -} \ No newline at end of file diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif deleted file mode 100644 index 56ae676bf..000000000 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/ExpectedOutputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "SARIF Functional Testing" - } - }, - "invocations": [ - { - "executionSuccessful": true - } - ], - "artifacts": [ - { - "location": { - "uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif", - "uriBaseId": "TEST_DIR" - } - } - ], - "results": [], - "columnKind": "utf16CodeUnits" - } - ] -} \ No newline at end of file diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif similarity index 90% rename from src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif rename to src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif index bdd3c9425..b8cf3cd74 100644 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Invalid.sarif +++ b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Invalid.sarif @@ -8,6 +8,21 @@ "name": "CodeScanner" } }, + "originalUriBaseIds": { + "PROJECT_ROOT": { + "uri": "project", + "description": { + "text": "This artifactLocation has no uriBaseId, so its uri, if present, must be absolute. But it isn't. It also doesn't end with a slash." + } + }, + "SOURCE_ROOT": { + "uri": "src", + "uriBaseId": "PROJECT_ROOT", + "description": { + "text": "This is a regression test for Bug #1862, where we were not checking for a trailing slash on relative URIs." + } + } + }, "invocations": [ { "responseFiles": [ diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif similarity index 89% rename from src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif rename to src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif index d989aceeb..0f283d2bd 100644 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1014.UriBaseIdRequiresRelativeUri_Valid.sarif +++ b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1004.ExpressUriBaseIdsCorrectly_Valid.sarif @@ -8,6 +8,26 @@ "name": "CodeScanner" } }, + "originalUriBaseIds": { + "PROJECT_ROOT": { + "description": { + "text": "This artifactLocation has neither a uri nor a uriBaseId. This is fine." + } + }, + "RULES_ROOT": { + "uri": "file:///C:/rules/", + "description": { + "text": "This artifactLocation has no uriBaseId, so its uri, if present, must be absolute." + } + }, + "SOURCE_ROOT": { + "uri": "src/", + "uriBaseId": "PROJECT_ROOT", + "description": { + "text": "This artifactLocation has a uriBaseId so its uri must be relative." + } + } + }, "invocations": [ { "responseFiles": [ diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif deleted file mode 100644 index 689a2661b..000000000 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Invalid.sarif +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "Sarif Functional Testing" - } - }, - "originalUriBaseIds": { - "PROJECT_ROOT": { - "uri": "project", - "description": { - "text": "This artifactLocation has no uriBaseId, so its uri, if present, must be absolute. But it isn't. It also doesn't end with a slash." - } - }, - "SOURCE_ROOT": { - "uri": "src", - "uriBaseId": "PROJECT_ROOT", - "description": { - "text": "This is a regression test for Bug #1862, where we were not checking for a trailing slash on relative URIs." - } - } - }, - "results": [], - "columnKind": "utf16CodeUnits" - } - ] -} \ No newline at end of file diff --git a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif b/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif deleted file mode 100644 index d2f4aa6e2..000000000 --- a/src/Test.FunctionalTests.Sarif/TestData/Multitool/ValidateCommand/Inputs/SARIF1018.InvalidUriInOriginalUriBaseIds_Valid.sarif +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "Sarif Functional Testing" - } - }, - "originalUriBaseIds": { - "PROJECT_ROOT": { - "description": { - "text": "This artifactLocation has neither a uri nor a uriBaseId. This is fine." - } - }, - "RULES_ROOT": { - "uri": "file:///C:/rules/", - "description": { - "text": "This artifactLocation has no uriBaseId, so its uri, if present, must be absolute." - } - }, - "SOURCE_ROOT": { - "uri": "src/", - "uriBaseId": "PROJECT_ROOT", - "description": { - "text": "This artifactLocation has a uriBaseId so its uri must be relative. But that is not enforced by SARIF1018; it will be enforced by a separate rule." - } - } - }, - "results": [], - "columnKind": "utf16CodeUnits" - } - ] -} \ No newline at end of file