Skip to content

Commit

Permalink
Stop analyzing if rule NI1800 is suppressed/None (#58)
Browse files Browse the repository at this point in the history
We only need to check ProductionRule or TestRule since they both have the same diagnostic ID
  • Loading branch information
pakdev authored Mar 15, 2021
1 parent 39c7e16 commit 3827066
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ private static bool IsTestNamespace(string namespaceName)

private void OnCompilationStart(CompilationStartAnalysisContext compilationStartContext)
{
var effectiveSeverity = ProductionRule.GetEffectiveSeverity(compilationStartContext.Compilation.Options);
if (effectiveSeverity == Microsoft.CodeAnalysis.ReportDiagnostic.Suppress)
{
return;
}

InitializeApprovedNamespaces();

if (!ApprovalFilesExist())
Expand Down

0 comments on commit 3827066

Please sign in to comment.