You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't want libraries to use the type Console, except in Debug or Verbose builds whilst debugging.
So we added a conditional reference to the Microsoft.CodeAnalysis.BannedApiAnalyzers with an appropriate BannedSymbols.txt
I would like to be able to configure the analyzer to exclude reporting usages in methods annotated with the Conditional attribute using a specific constant.
Describe suggestions on how to achieve the rule
When usage of a banned api is detected, the analyzer should check for a ConditionalAttribute on the containing method/class and only report if the ConditionString doesn't match allowed conditions. Or better if the analyzer knows the predefined symbols doesn't match those.
Additional context
The text was updated successfully, but these errors were encountered:
Analyzer
RS0030: BannedApiAnalyzers
Describe the improvement
We don't want libraries to use the type
Console
, except in Debug or Verbose builds whilst debugging.So we added a conditional reference to the
Microsoft.CodeAnalysis.BannedApiAnalyzers
with an appropriateBannedSymbols.txt
However we have conditional executed code like:
I would like to be able to configure the analyzer to exclude reporting usages in methods annotated with the
Conditional
attribute using a specific constant.Describe suggestions on how to achieve the rule
When usage of a banned api is detected, the analyzer should check for a
ConditionalAttribute
on the containing method/class and only report if theConditionString
doesn't match allowed conditions. Or better if the analyzer knows the predefined symbols doesn't match those.Additional context
The text was updated successfully, but these errors were encountered: