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

Add more warning suppression scenarios #1232

Merged
merged 6 commits into from
Jun 4, 2020

Conversation

mateoatr
Copy link
Contributor

@mateoatr mateoatr commented Jun 2, 2020

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 and Scope properties for global suppression on types and members.

@mateoatr mateoatr added this to the .NET5.0 milestone Jun 2, 2020
@mateoatr mateoatr self-assigned this Jun 2, 2020
Mateo Torres Ruiz added 2 commits June 2, 2020 12:35
@@ -99,10 +106,127 @@ private static bool TryDecodeSuppressMessageAttributeData (CustomAttribute attri

private bool IsLocallySuppressed (int id, ICustomAttributeProvider provider, out SuppressMessageInfo info)
Copy link
Member

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.

Remove GlobalSuppressions class
Refactor methods
@marek-safar marek-safar merged commit ba6d3da into dotnet:master Jun 4, 2020
tkapin pushed a commit to tkapin/runtime that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants