77 references to CheckResultSeverity
Microsoft.Build (39)
BuildCheck\API\BuildCheckResult.cs (4)
28
internal BuildEventArgs ToEventArgs(
CheckResultSeverity
severity)
31
CheckResultSeverity
.Suggestion => new BuildCheckResultMessage(this),
32
CheckResultSeverity
.Warning => new BuildCheckResultWarning(this, CheckRule.Id),
33
CheckResultSeverity
.Error => new BuildCheckResultError(this, CheckRule.Id),
BuildCheck\API\CheckConfiguration.cs (10)
25
Severity =
CheckResultSeverity
.None
43
public
CheckResultSeverity
? Severity { get; init; }
54
if (Severity.HasValue && Severity.Value !=
CheckResultSeverity
.Default)
56
return !Severity.Value.Equals(
CheckResultSeverity
.None);
101
private static
CheckResultSeverity
? TryExtractSeverity(Dictionary<string, string>? config)
111
return
CheckResultSeverity
.None;
113
return
CheckResultSeverity
.Default;
115
return
CheckResultSeverity
.Suggestion;
117
return
CheckResultSeverity
.Warning;
119
return
CheckResultSeverity
.Error;
BuildCheck\Checks\DoubleWritesCheck.cs (1)
29
new CheckConfiguration() { Severity =
CheckResultSeverity
.Warning });
BuildCheck\Checks\NoEnvironmentVariablePropertyCheck.cs (1)
18
new CheckConfiguration() { Severity =
CheckResultSeverity
.Suggestion });
BuildCheck\Checks\PropertiesUsageCheck.cs (3)
22
new CheckConfiguration() { Severity =
CheckResultSeverity
.Warning, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly });
27
new CheckConfiguration() { Severity =
CheckResultSeverity
.Warning, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly });
32
new CheckConfiguration() { Severity =
CheckResultSeverity
.Suggestion, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly });
BuildCheck\Checks\SharedOutputPathCheck.cs (1)
22
new CheckConfiguration() { RuleId = RuleId, Severity =
CheckResultSeverity
.Warning });
BuildCheck\Infrastructure\CheckConfigurationEffective.cs (4)
14
public CheckConfigurationEffective(string ruleId, EvaluationCheckScope evaluationCheckScope,
CheckResultSeverity
severity)
16
if (severity ==
CheckResultSeverity
.Default)
34
public
CheckResultSeverity
Severity { get; }
36
public bool IsEnabled => Severity >=
CheckResultSeverity
.Suggestion;
BuildCheck\Infrastructure\CheckWrapper.cs (5)
135
case
CheckResultSeverity
.Suggestion:
138
case
CheckResultSeverity
.Warning:
141
case
CheckResultSeverity
.Error:
144
case
CheckResultSeverity
.Default:
145
case
CheckResultSeverity
.None:
BuildCheck\Infrastructure\ConfigurationProvider.cs (3)
284
private
CheckResultSeverity
GetSeverityValue(CheckConfiguration editorConfigValue, CheckConfiguration defaultValue)
286
CheckResultSeverity
? resultSeverity = null;
290
if (editorConfigValue.Severity != null && editorConfigValue.Severity !=
CheckResultSeverity
.Default)
BuildCheck\Utilities\CheckResultSeverityExtensions.cs (7)
9
public static DiagnosticSeverity? ToDiagnosticSeverity(this
CheckResultSeverity
? severity)
19
public static DiagnosticSeverity ToDiagnosticSeverity(this
CheckResultSeverity
severity)
23
CheckResultSeverity
.Default => DiagnosticSeverity.Default,
24
CheckResultSeverity
.None => DiagnosticSeverity.None,
25
CheckResultSeverity
.Suggestion => DiagnosticSeverity.Suggestion,
26
CheckResultSeverity
.Warning => DiagnosticSeverity.Warning,
27
CheckResultSeverity
.Error => DiagnosticSeverity.Error,
Microsoft.Build.BuildCheck.UnitTests (38)
CheckConfiguration_Test.cs (11)
35
[InlineData("error",
CheckResultSeverity
.Error)]
36
[InlineData("ERROR",
CheckResultSeverity
.Error)]
37
[InlineData("suggestion",
CheckResultSeverity
.Suggestion)]
38
[InlineData("SUGGESTION",
CheckResultSeverity
.Suggestion)]
39
[InlineData("warning",
CheckResultSeverity
.Warning)]
40
[InlineData("WARNING",
CheckResultSeverity
.Warning)]
41
[InlineData("NONE",
CheckResultSeverity
.None)]
42
[InlineData("none",
CheckResultSeverity
.None)]
43
[InlineData("default",
CheckResultSeverity
.Default)]
44
[InlineData("DEFAULT",
CheckResultSeverity
.Default)]
45
public void CreateCheckConfiguration_Severity(string parameter,
CheckResultSeverity
? expected)
CheckConfigurationEffectiveTests.cs (11)
15
[InlineData("ruleId", EvaluationCheckScope.ProjectFileOnly,
CheckResultSeverity
.Warning, true)]
16
[InlineData("ruleId2", EvaluationCheckScope.ProjectFileOnly,
CheckResultSeverity
.Warning, true)]
17
[InlineData("ruleId", EvaluationCheckScope.ProjectFileOnly,
CheckResultSeverity
.Error, false)]
21
CheckResultSeverity
secondSeverity,
27
severity:
CheckResultSeverity
.Warning);
38
[InlineData(
CheckResultSeverity
.Warning, true)]
39
[InlineData(
CheckResultSeverity
.Suggestion, true)]
40
[InlineData(
CheckResultSeverity
.Error, true)]
41
[InlineData(
CheckResultSeverity
.None, false)]
42
public void CheckConfigurationInternal_Constructor_SeverityConfig(
CheckResultSeverity
severity, bool isEnabledExpected)
60
severity:
CheckResultSeverity
.Default);
ConfigurationProvider_Tests.cs (15)
120
buildConfig.Severity.ShouldBe(
CheckResultSeverity
.Error);
219
[InlineData(
CheckResultSeverity
.Warning,
CheckResultSeverity
.Warning, true)]
220
[InlineData(
CheckResultSeverity
.Error,
CheckResultSeverity
.Error, true)]
221
[InlineData(
CheckResultSeverity
.Default,
CheckResultSeverity
.Warning, true)]
222
[InlineData(
CheckResultSeverity
.Suggestion,
CheckResultSeverity
.Suggestion, true)]
223
[InlineData(
CheckResultSeverity
.None,
CheckResultSeverity
.None, false)]
224
[InlineData(null,
CheckResultSeverity
.Warning, true)]
225
public void GetConfigurationProvider_MergesSeverity_Correctly(
CheckResultSeverity
? checkResultSeverity,
CheckResultSeverity
expectedSeverity, bool expectedEnablment)
235
Severity =
CheckResultSeverity
.Warning
TaskInvocationAnalysisDataTests.cs (1)
28
new CheckConfiguration() { Severity =
CheckResultSeverity
.Warning });