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