Skip to content

Commit

Permalink
Fix --severity-level (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Apr 23, 2024
1 parent 3dadfbf commit 9247ccc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- [CLI] Fix loading of `slnf` files ([PR](https://github.com/dotnet/roslynator/pull/1447))
- [CLI] Fix `--severity-level` ([PR](https://github.com/dotnet/roslynator/pull/1449))

## [4.12.1] - 2024-04-15

Expand Down
6 changes: 3 additions & 3 deletions src/Workspaces.Core/Diagnostics/CodeAnalyzer.cs
Expand Up @@ -203,8 +203,7 @@ private IEnumerable<Diagnostic> FilterDiagnostics(IEnumerable<Diagnostic> diagno
{
foreach (Diagnostic diagnostic in diagnostics)
{
if (diagnostic.IsEffective(Options, project.CompilationOptions, cancellationToken)
&& (Options.ReportNotConfigurable || !diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable)))
if (diagnostic.IsEffective(Options, project.CompilationOptions, cancellationToken))
{
if (diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.Compiler))
{
Expand All @@ -222,7 +221,8 @@ private IEnumerable<Diagnostic> FilterDiagnostics(IEnumerable<Diagnostic> diagno
}
}
}
else
else if (Options.ReportNotConfigurable
|| !diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
{
yield return diagnostic;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Workspaces.Core/Extensions/Extensions.cs
Expand Up @@ -448,9 +448,6 @@ public static ConsoleColors GetColors(this WorkspaceDiagnosticKind kind)
if (!codeAnalysisOptions.IsSupportedDiagnosticId(diagnostic.Id))
return false;

if (diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.Compiler))
return true;

SyntaxTree? tree = diagnostic.Location.SourceTree;

ReportDiagnostic reportDiagnostic = diagnostic.Descriptor.GetEffectiveSeverity(tree, compilationOptions, cancellationToken);
Expand Down

0 comments on commit 9247ccc

Please sign in to comment.