81 references to CheckResultSeverity
Microsoft.Build (43)
BuildCheck\API\BuildCheckResult.cs (4)
30internal BuildEventArgs ToEventArgs(CheckResultSeverity severity) 33CheckResultSeverity.Suggestion => new BuildCheckResultMessage(this), 34CheckResultSeverity.Warning => new BuildCheckResultWarning(this), 35CheckResultSeverity.Error => new BuildCheckResultError(this),
BuildCheck\API\CheckConfiguration.cs (10)
24Severity = CheckResultSeverity.None 42public 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\CopyAlwaysCheck.cs (1)
18new CheckConfiguration() { RuleId = RuleId, Severity = CheckResultSeverity.Warning });
BuildCheck\Checks\DoubleWritesCheck.cs (1)
26new CheckConfiguration() { Severity = CheckResultSeverity.Warning });
BuildCheck\Checks\EmbeddedResourceCheck.cs (1)
18new CheckConfiguration() { RuleId = RuleId, Severity = CheckResultSeverity.Warning });
BuildCheck\Checks\NoEnvironmentVariablePropertyCheck.cs (1)
18new CheckConfiguration() { Severity = CheckResultSeverity.Suggestion });
BuildCheck\Checks\PreferProjectReferenceCheck.cs (1)
18new CheckConfiguration() { RuleId = RuleId, Severity = CheckResultSeverity.Warning });
BuildCheck\Checks\PropertiesUsageCheck.cs (3)
20new CheckConfiguration() { RuleId = "BC0201", Severity = CheckResultSeverity.Warning, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly }); 25new CheckConfiguration() { RuleId = "BC0202", Severity = CheckResultSeverity.Warning, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly }); 30new CheckConfiguration() { RuleId = "BC0203", Severity = CheckResultSeverity.None, EvaluationCheckScope = EvaluationCheckScope.ProjectFileOnly });
BuildCheck\Checks\SharedOutputPathCheck.cs (1)
18new CheckConfiguration() { RuleId = RuleId, Severity = CheckResultSeverity.Warning });
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (1)
17new CheckConfiguration() { RuleId = RuleId, Severity = CheckResultSeverity.Warning });
BuildCheck\Infrastructure\CheckConfigurationEffective.cs (4)
13public CheckConfigurationEffective(string ruleId, EvaluationCheckScope evaluationCheckScope, CheckResultSeverity severity) 15if (severity == CheckResultSeverity.Default) 33public CheckResultSeverity Severity { get; } 35public bool IsEnabled => Severity >= CheckResultSeverity.Suggestion;
BuildCheck\Infrastructure\CheckWrapper.cs (5)
132case CheckResultSeverity.Suggestion: 135case CheckResultSeverity.Warning: 138case CheckResultSeverity.Error: 141case CheckResultSeverity.Default: 142case CheckResultSeverity.None:
BuildCheck\Infrastructure\ConfigurationProvider.cs (3)
283private CheckResultSeverity GetSeverityValue(CheckConfiguration editorConfigValue, CheckConfiguration defaultValue) 285CheckResultSeverity? resultSeverity = null; 289if (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 });