-
Notifications
You must be signed in to change notification settings - Fork 128
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
Suppress warning if UnconditionalSuppressMessageAttribute is used #1892
Conversation
|
||
internal static bool IsDiagnosticSuppressed(OperationAnalysisContext operationContext, string diagnosticId) | ||
{ | ||
var attributes = operationContext.ContainingSymbol.GetAttributes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work when the suppression is up in the tree?
e.g.
[UnconditionalSuppressMessage ("", "IL1234:MyWarning")]
class Foo {
void Bar () {
// Triggers warning IL1234
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this only handles local suppression. Global suppression support will have to be added in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about unconditional suppressions that use the target property?
As far as I can tell, the Target property is only relevant on attributes higher than the member level. |
I'm gonna close this for now, since it looks like the Roslyn change is gonna go through. |
Closing in favor of dotnet/roslyn#51792 |
If/when Roslyn ships a universal suppress behavior here we can remove this code.