-
Notifications
You must be signed in to change notification settings - Fork 127
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
Add more warning suppression scenarios #1232
Add more warning suppression scenarios #1232
Conversation
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Vitek Karas <[email protected]>
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
…suppressions Use switch-case for the attributes module
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
@@ -99,10 +106,127 @@ private static bool TryDecodeSuppressMessageAttributeData (CustomAttribute attri | |||
|
|||
private bool IsLocallySuppressed (int id, ICustomAttributeProvider provider, out SuppressMessageInfo info) |
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.
Not for this PR but eventually we should cleanup the types here. The warning requires the "location" to be IMemberDefinition
, but then all of the suppression logic works on ICustomAttributeProvider
. Would be nice to unify this.
For example it's possible to suppress a warning at the assembly level, but currently it's not possible to emit a warning at the assembly level.
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
Remove GlobalSuppressions class Refactor methods
Co-authored-by: Vitek Karas <[email protected]> Commit migrated from dotnet/linker@ba6d3da
Continuing with the work of #1185 this PR adds the ability to suppress warnings throughout a module or assembly. It also adds support for using the
Target
andScope
properties for global suppression on types and members.