-
Notifications
You must be signed in to change notification settings - Fork 86
/
ADO1015.ProvideRequiredResultProperties.cs
41 lines (33 loc) · 1.62 KB
/
ADO1015.ProvideRequiredResultProperties.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 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;
namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules
{
public class AdoProvideRequiredResultProperties
: BaseProvideRequiredResultProperties
{
/// <summary>
/// ADO1015
/// </summary>
public override string Id => RuleId.ADOProvideRequiredResultProperties;
public override MultiformatMessageString FullDescription => new MultiformatMessageString() { Text = RuleResources.ADO1015_ProvideRequiredResultProperties_FullDescription_Text };
public override HashSet<RuleKind> RuleKinds => new(new[] { RuleKind.Ado });
protected override string ServiceName => RuleResources.ServiceName_ADO;
public AdoProvideRequiredResultProperties()
{
this.DefaultConfiguration.Level = FailureLevel.Error;
this.MessageResourceNames.Add(nameof(RuleResources.ADO1015_ProvideRequiredResultProperties_Error_MissingRuleId_Text));
}
protected override void Analyze(Result result, string resultPointer)
{
base.Analyze(result, resultPointer);
if (string.IsNullOrWhiteSpace(result.RuleId))
{
// {0}: This 'result' object does not provide a 'ruleId' value. This property is required by the {1} service.
LogResult(
resultPointer,
nameof(RuleResources.ADO1015_ProvideRequiredResultProperties_Error_MissingRuleId_Text));
}
}
}
}