From a5d18312921e745cbb60e06ce586ee68c2524029 Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Tue, 30 Jun 2020 20:21:56 -0300 Subject: [PATCH] Updating rules based on the guidelines updating --- .../SARIF1001.RuleIdentifiersMustBeValid.cs | 4 +-- .../Rules/SARIF1002.UrisMustBeValid.cs | 6 ++-- .../SARIF1004.ExpressUriBaseIdsCorrectly.cs | 12 +++---- .../Rules/SARIF1005.UriMustBeAbsolute.cs | 11 ++++--- ...06.InvocationPropertiesMustBeConsistent.cs | 4 +-- ...IF1007.RegionPropertiesMustBeConsistent.cs | 8 ++--- ...sicalLocationPropertiesMustBeConsistent.cs | 6 ++-- ...dexPropertiesMustBeConsistentWithArrays.cs | 6 ++-- .../Rules/SARIF1010.RuleIdMustBeConsistent.cs | 33 ++++++++++++------- .../Rules/SARIF1011.ReferenceFinalSchema.cs | 33 +++++++++++-------- .../Rules/SARIF2004.OptimizeFileSize.cs | 6 ++-- .../Rules/SARIF2005.ProvideToolProperties.cs | 8 ++--- .../Rules/SARIF2006.UrisShouldBeReachable.cs | 7 ++-- .../Rules/SARIF2008.ProvideSchema.cs | 25 ++++++++------ 14 files changed, 98 insertions(+), 71 deletions(-) diff --git a/src/Sarif.Multitool/Rules/SARIF1001.RuleIdentifiersMustBeValid.cs b/src/Sarif.Multitool/Rules/SARIF1001.RuleIdentifiersMustBeValid.cs index 46d526af0..2f369529b 100644 --- a/src/Sarif.Multitool/Rules/SARIF1001.RuleIdentifiersMustBeValid.cs +++ b/src/Sarif.Multitool/Rules/SARIF1001.RuleIdentifiersMustBeValid.cs @@ -28,8 +28,8 @@ public class RuleIdentifiersMustBeValid : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1001_RuleIdentifiersMustBeValid_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1001_RuleIdentifiersMustBeValid_Error_Default_Text) - }; + nameof(RuleResources.SARIF1001_RuleIdentifiersMustBeValid_Error_Default_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Warning; diff --git a/src/Sarif.Multitool/Rules/SARIF1002.UrisMustBeValid.cs b/src/Sarif.Multitool/Rules/SARIF1002.UrisMustBeValid.cs index 4deb72f6a..ed6eda1d2 100644 --- a/src/Sarif.Multitool/Rules/SARIF1002.UrisMustBeValid.cs +++ b/src/Sarif.Multitool/Rules/SARIF1002.UrisMustBeValid.cs @@ -27,9 +27,9 @@ public class UrisMustBeValid : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1002_UrisMustBeValid_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1002_UrisMustBeValid_Error_UrisMustConformToRfc3986_Text), - nameof(RuleResources.SARIF1002_UrisMustBeValid_Error_FileUrisMustNotIncludeDotDotSegments_Text) - }; + nameof(RuleResources.SARIF1002_UrisMustBeValid_Error_UrisMustConformToRfc3986_Text), + nameof(RuleResources.SARIF1002_UrisMustBeValid_Error_FileUrisMustNotIncludeDotDotSegments_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs b/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs index 50948ed9a..9a6af2e87 100644 --- a/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs +++ b/src/Sarif.Multitool/Rules/SARIF1004.ExpressUriBaseIdsCorrectly.cs @@ -22,12 +22,12 @@ public class ExpressUriBaseIdsCorrectly : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text), - nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text), - nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text), - nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustNotContainDotDotSegment_Text), - nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustNotContainQueryOrFragment_Text) - }; + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdRequiresRelativeUri_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_TopLevelUriBaseIdMustBeAbsolute_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustEndWithSlash_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustNotContainDotDotSegment_Text), + nameof(RuleResources.SARIF1004_ExpressUriBaseIdsCorrectly_Error_UriBaseIdValueMustNotContainQueryOrFragment_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1005.UriMustBeAbsolute.cs b/src/Sarif.Multitool/Rules/SARIF1005.UriMustBeAbsolute.cs index b672cd21a..c61a86474 100644 --- a/src/Sarif.Multitool/Rules/SARIF1005.UriMustBeAbsolute.cs +++ b/src/Sarif.Multitool/Rules/SARIF1005.UriMustBeAbsolute.cs @@ -22,8 +22,8 @@ public class UriMustBeAbsolute : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1005_UriMustBeAbsolute_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text) - }; + nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; @@ -80,8 +80,11 @@ private void AnalyzeUri(string uriString, string pointer) Uri uri = new Uri(uriString, UriKind.RelativeOrAbsolute); if (!uri.IsAbsoluteUri) { - // Placeholder - LogResult(pointer, nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text), uriString); + // {0}: Placeholder '{1}' + LogResult( + pointer, + nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text), + uriString); } } } diff --git a/src/Sarif.Multitool/Rules/SARIF1006.InvocationPropertiesMustBeConsistent.cs b/src/Sarif.Multitool/Rules/SARIF1006.InvocationPropertiesMustBeConsistent.cs index f65927f3b..310da1180 100644 --- a/src/Sarif.Multitool/Rules/SARIF1006.InvocationPropertiesMustBeConsistent.cs +++ b/src/Sarif.Multitool/Rules/SARIF1006.InvocationPropertiesMustBeConsistent.cs @@ -27,8 +27,8 @@ public class InvocationPropertiesMustBeConsistent : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1006_InvocationPropertiesMustBeConsistent_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1006_InvocationPropertiesMustBeConsistent_Error_EndTimeMustNotPrecedeStartTime_Text) - }; + nameof(RuleResources.SARIF1006_InvocationPropertiesMustBeConsistent_Error_EndTimeMustNotPrecedeStartTime_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1007.RegionPropertiesMustBeConsistent.cs b/src/Sarif.Multitool/Rules/SARIF1007.RegionPropertiesMustBeConsistent.cs index adb903574..ccc81355e 100644 --- a/src/Sarif.Multitool/Rules/SARIF1007.RegionPropertiesMustBeConsistent.cs +++ b/src/Sarif.Multitool/Rules/SARIF1007.RegionPropertiesMustBeConsistent.cs @@ -30,10 +30,10 @@ public class RegionPropertiesMustBeConsistent : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_EndLineMustNotPrecedeStartLine_Text), - nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColumnMustNotPrecedeStartColumn_Text), - nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_RegionStartPropertyMustBePresent_Text) - }; + nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_EndLineMustNotPrecedeStartLine_Text), + nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_EndColumnMustNotPrecedeStartColumn_Text), + nameof(RuleResources.SARIF1007_RegionPropertiesMustBeConsistent_Error_RegionStartPropertyMustBePresent_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1008.PhysicalLocationPropertiesMustBeConsistent.cs b/src/Sarif.Multitool/Rules/SARIF1008.PhysicalLocationPropertiesMustBeConsistent.cs index 3a7f57551..b82e33740 100644 --- a/src/Sarif.Multitool/Rules/SARIF1008.PhysicalLocationPropertiesMustBeConsistent.cs +++ b/src/Sarif.Multitool/Rules/SARIF1008.PhysicalLocationPropertiesMustBeConsistent.cs @@ -43,9 +43,9 @@ public class PhysicalLocationPropertiesMustBeConsistent : SarifValidationSkimmer public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1008_PhysicalLocationPropertiesMustBeConsistent_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionRequiresRegion_Text), - nameof(RuleResources.SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionMustBeProperSupersetOfRegion_Text) - }; + nameof(RuleResources.SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionRequiresRegion_Text), + nameof(RuleResources.SARIF1008_PhysicalLocationPropertiesMustBeConsistent_Error_ContextRegionMustBeProperSupersetOfRegion_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1009.IndexPropertiesMustBeConsistentWithArrays.cs b/src/Sarif.Multitool/Rules/SARIF1009.IndexPropertiesMustBeConsistentWithArrays.cs index 31fa6d065..2e78765c7 100644 --- a/src/Sarif.Multitool/Rules/SARIF1009.IndexPropertiesMustBeConsistentWithArrays.cs +++ b/src/Sarif.Multitool/Rules/SARIF1009.IndexPropertiesMustBeConsistentWithArrays.cs @@ -20,9 +20,9 @@ public class IndexPropertiesMustBeConsistentWithArrays : SarifValidationSkimmerB public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1009_IndexPropertiesMustBeConsistentWithArrays_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustExist_Text), - nameof(RuleResources.SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustBeLongEnough_Text) - }; + nameof(RuleResources.SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustExist_Text), + nameof(RuleResources.SARIF1009_IndexPropertiesMustBeConsistentWithArrays_Error_TargetArrayMustBeLongEnough_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Error; diff --git a/src/Sarif.Multitool/Rules/SARIF1010.RuleIdMustBeConsistent.cs b/src/Sarif.Multitool/Rules/SARIF1010.RuleIdMustBeConsistent.cs index 02b1d2600..4dc684e23 100644 --- a/src/Sarif.Multitool/Rules/SARIF1010.RuleIdMustBeConsistent.cs +++ b/src/Sarif.Multitool/Rules/SARIF1010.RuleIdMustBeConsistent.cs @@ -8,21 +8,22 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { public class RuleIdMustBeConsistent : SarifValidationSkimmerBase { - public override MultiformatMessageString FullDescription => new MultiformatMessageString - { - Text = RuleResources.SARIF1010_RuleIdMustBeConsistent_FullDescription_Text - }; - - public override FailureLevel DefaultLevel => FailureLevel.Error; - + /// + /// SARIF1010 + /// public override string Id => RuleId.RuleIdMustBeConsistent; + + /// + /// Placeholder + /// + public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1010_RuleIdMustBeConsistent_FullDescription_Text }; - protected override IEnumerable MessageResourceNames => new string[] - { + protected override IEnumerable MessageResourceNames => new string[] { nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultRuleIdMustBeConsistent_Text), nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultMustSpecifyRuleId_Text) }; - + public override FailureLevel DefaultLevel => FailureLevel.Error; + protected override void Analyze(Result result, string resultPointer) { AnalyzeRuleId(result, resultPointer); @@ -33,14 +34,22 @@ private void AnalyzeRuleId(Result result, string pointer) // At least one of result.ruleId or result.rule.id must be present if (string.IsNullOrWhiteSpace(result.RuleId) && string.IsNullOrWhiteSpace(result.Rule?.Id)) { - LogResult(pointer, nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultMustSpecifyRuleId_Text)); + // {0}: Placeholder + LogResult( + pointer, + nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultMustSpecifyRuleId_Text)); } // if both are present, they must be equal. else if (!string.IsNullOrWhiteSpace(result.RuleId) && !string.IsNullOrWhiteSpace(result.Rule?.Id) && !result.RuleId.Equals(result.Rule?.Id, StringComparison.OrdinalIgnoreCase)) { - LogResult(pointer, nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultRuleIdMustBeConsistent_Text), result.RuleId, result.Rule?.Id); + // {0}: Placeholder '{1}' '{2}' '{3}' + LogResult( + pointer, + nameof(RuleResources.SARIF1010_RuleIdMustBeConsistent_Error_ResultRuleIdMustBeConsistent_Text), + result.RuleId, + result.Rule?.Id); } } } diff --git a/src/Sarif.Multitool/Rules/SARIF1011.ReferenceFinalSchema.cs b/src/Sarif.Multitool/Rules/SARIF1011.ReferenceFinalSchema.cs index 2d636c29f..546746dbd 100644 --- a/src/Sarif.Multitool/Rules/SARIF1011.ReferenceFinalSchema.cs +++ b/src/Sarif.Multitool/Rules/SARIF1011.ReferenceFinalSchema.cs @@ -3,32 +3,36 @@ using System; using System.Collections.Generic; + using Microsoft.Json.Pointer; namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { public class ReferenceFinalSchema : SarifValidationSkimmerBase { - public override MultiformatMessageString FullDescription => new MultiformatMessageString - { - Text = RuleResources.SARIF1011_ReferenceFinalSchema_FullDescription_Text - }; - - public override FailureLevel DefaultLevel => FailureLevel.Error; - + /// + /// SARIF1011 + /// public override string Id => RuleId.ReferenceFinalSchema; - protected override IEnumerable MessageResourceNames => new string[] - { + /// + /// Placeholder + /// + public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF1011_ReferenceFinalSchema_FullDescription_Text }; + + protected override IEnumerable MessageResourceNames => new string[] { nameof(RuleResources.SARIF1011_ReferenceFinalSchema_Error_Default_Text) }; + public override FailureLevel DefaultLevel => FailureLevel.Error; + + protected override void Analyze(SarifLog log, string logPointer) { - AnalyzeSchema(log.SchemaUri, logPointer); + AnalyzeSchema(log.SchemaUri, logPointer.AtProperty(SarifPropertyName.Schema)); } - private void AnalyzeSchema(Uri schemaUri, string pointer) + private void AnalyzeSchema(Uri schemaUri, string schema) { if (schemaUri == null) { @@ -41,8 +45,11 @@ private void AnalyzeSchema(Uri schemaUri, string pointer) && !schemaUri.OriginalString.EndsWith(VersionConstants.SchemaVersionAsPublishedToSchemaStoreOrg) && !schemaUri.OriginalString.EndsWith($"{VersionConstants.SchemaVersionAsPublishedToSchemaStoreOrg}.json")) { - LogResult(pointer.AtProperty(SarifPropertyName.Schema), nameof(RuleResources.SARIF1011_ReferenceFinalSchema_Error_Default_Text), schemaUri.OriginalString); - return; + // {0}: Placeholder '{1}' + LogResult( + schema, + nameof(RuleResources.SARIF1011_ReferenceFinalSchema_Error_Default_Text), + schemaUri.OriginalString); } } } diff --git a/src/Sarif.Multitool/Rules/SARIF2004.OptimizeFileSize.cs b/src/Sarif.Multitool/Rules/SARIF2004.OptimizeFileSize.cs index 0f9e0b62e..779eafa0d 100644 --- a/src/Sarif.Multitool/Rules/SARIF2004.OptimizeFileSize.cs +++ b/src/Sarif.Multitool/Rules/SARIF2004.OptimizeFileSize.cs @@ -24,9 +24,9 @@ public class OptimizeFileSize : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF2004_OptimizeFileSize_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF2004_OptimizeFileSize_Warning_EliminateLocationOnlyArtifacts_Text), - nameof(RuleResources.SARIF2004_OptimizeFileSize_Warning_EliminateIdOnlyRules_Text) - }; + nameof(RuleResources.SARIF2004_OptimizeFileSize_Warning_EliminateLocationOnlyArtifacts_Text), + nameof(RuleResources.SARIF2004_OptimizeFileSize_Warning_EliminateIdOnlyRules_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Warning; diff --git a/src/Sarif.Multitool/Rules/SARIF2005.ProvideToolProperties.cs b/src/Sarif.Multitool/Rules/SARIF2005.ProvideToolProperties.cs index 06f769397..a87c2627e 100644 --- a/src/Sarif.Multitool/Rules/SARIF2005.ProvideToolProperties.cs +++ b/src/Sarif.Multitool/Rules/SARIF2005.ProvideToolProperties.cs @@ -35,10 +35,10 @@ public class ProvideToolProperties : SarifValidationSkimmerBase public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF2005_ProvideToolProperties_FullDescription_Text }; protected override IEnumerable MessageResourceNames => new string[] { - nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_ProvideToolVersion_Text), - nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_ProvideConciseToolName_Text), - nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_UseNumericToolVersions_Text) - }; + nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_ProvideToolVersion_Text), + nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_ProvideConciseToolName_Text), + nameof(RuleResources.SARIF2005_ProvideToolProperties_Warning_UseNumericToolVersions_Text) + }; public override FailureLevel DefaultLevel => FailureLevel.Warning; diff --git a/src/Sarif.Multitool/Rules/SARIF2006.UrisShouldBeReachable.cs b/src/Sarif.Multitool/Rules/SARIF2006.UrisShouldBeReachable.cs index 100a802a3..ecc5f5197 100644 --- a/src/Sarif.Multitool/Rules/SARIF2006.UrisShouldBeReachable.cs +++ b/src/Sarif.Multitool/Rules/SARIF2006.UrisShouldBeReachable.cs @@ -85,8 +85,11 @@ private void AnalyzeUri(string uriString, string pointer) Uri uri = new Uri(uriString, UriKind.Absolute); if (!IsUriReachable(uri.AbsoluteUri)) { - // Placeholder - LogResult(pointer, nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text), uriString); + // {0}: Placeholder '{1}' + LogResult( + pointer, + nameof(RuleResources.SARIF1005_UriMustBeAbsolute_Error_Default_Text), + uriString); } } } diff --git a/src/Sarif.Multitool/Rules/SARIF2008.ProvideSchema.cs b/src/Sarif.Multitool/Rules/SARIF2008.ProvideSchema.cs index 897ec4da4..1c6ab1a2a 100644 --- a/src/Sarif.Multitool/Rules/SARIF2008.ProvideSchema.cs +++ b/src/Sarif.Multitool/Rules/SARIF2008.ProvideSchema.cs @@ -7,25 +7,30 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules { public class ProvideSchema : SarifValidationSkimmerBase { - public override MultiformatMessageString FullDescription => new MultiformatMessageString - { - Text = RuleResources.SARIF2008_ProvideSchema_FullDescription_Text - }; - - public override FailureLevel DefaultLevel => FailureLevel.Warning; - + /// + /// SARIF2008 + /// public override string Id => RuleId.ProvideSchema; + + /// + /// Placeholder + /// + public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF2008_ProvideSchema_FullDescription_Text }; - protected override IEnumerable MessageResourceNames => new string[] - { + protected override IEnumerable MessageResourceNames => new string[] { nameof(RuleResources.SARIF2008_ProvideSchema_Warning_Default_Text) }; + public override FailureLevel DefaultLevel => FailureLevel.Warning; + protected override void Analyze(SarifLog log, string logPointer) { if (!Context.InputLogToken.HasProperty("$schema")) { - LogResult(logPointer, nameof(RuleResources.SARIF2008_ProvideSchema_Warning_Default_Text)); + // {0}: Placeholder + LogResult( + logPointer, + nameof(RuleResources.SARIF2008_ProvideSchema_Warning_Default_Text)); } } }