-
Notifications
You must be signed in to change notification settings - Fork 128
Redundant suppressions detection #2922
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
Conversation
...r.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFeatureSubstitutions.cs
Show resolved
Hide resolved
test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs
Show resolved
Hide resolved
...nker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs
Outdated
Show resolved
Hide resolved
...Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypesUsingTarget.cs
Show resolved
Hide resolved
...no.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInCompilerGeneratedCode.cs
Outdated
Show resolved
Hide resolved
|
We need to make this off-by-default - in the MSBuild parts by suppressing the warning by default for now. |
...nker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs
Outdated
Show resolved
Hide resolved
|
@tlakollo could you please take a look? |
tlakollo
left a comment
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.
I think it would be also interesting to test if compiler generated code like yields and async can produce the redundant warning suppression, it likely works but just in case. In general looks good to me
...nker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs
Show resolved
Hide resolved
test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.xml
Outdated
Show resolved
Hide resolved
src/linker/Linker/UnconditionalSuppressMessageAttributeState.cs
Outdated
Show resolved
Hide resolved
Ideally it would be suppressed the same as any other warnings with |
|
I guess the command line option is the simplest... I really hoped we would be able to do this purely through warning system, but the warning level feels weird (we don't use it for anything... not sure we should start). |
|
Another option that avoids a command-line argument would be to introduce a separate MSBuild flag that controls whether <PropertyGroup Condition="'$(_TrimmerShowRedundantSuppressions)' != 'true'">
<NoWarn>$(NoWarn);IL2121</NoWarn>
</PropertyGroup>But if we are planning for this to be turned on by default in the future I would lean towards using warning waves. |
vitek-karas
left a comment
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.
Looks good
@sbomer, could you please quickly check the MSBuild integration?
sbomer
left a comment
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.
I didn't review the entire change, but the MSBuild logic looks good to me. Thanks!
Implementation of the feature described in dotnet/linker#2891. Commit migrated from dotnet/linker@04290eb
Implementation of the feature described in #2891.
\cc @vitek-karas