Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --severity-level #1449

Merged
merged 4 commits into from Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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