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

Include new warning codes in --notrimwarn and --noaotwarn #105049

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jul 17, 2024

Fixes #105044

@sbomer sbomer requested a review from marek-safar as a code owner July 17, 2024 20:53
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 17, 2024
@@ -0,0 +1,41 @@
using System.Diagnostics.CodeAnalysis;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started from a copy of an existing test that didn't have a copyright header. A lot of our tests don't - I guess that should be fixed.

@@ -227,9 +229,9 @@ public static class DiagnosticIdExtensions
2103 => MessageSubCategory.TrimAnalysis,
2106 => MessageSubCategory.TrimAnalysis,
2107 => MessageSubCategory.TrimAnalysis,
>= 2109 and <= 2121 => MessageSubCategory.TrimAnalysis,
>= 2109 and <= (int) DiagnosticId._EndTrimAnalysisWarningsSentinel => MessageSubCategory.TrimAnalysis,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this should be just <

@@ -187,6 +187,7 @@ public enum DiagnosticId
_unused_DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberOnBase = 2120,
RedundantSuppression = 2121,
TypeNameIsNotAssemblyQualified = 2122,
_EndTrimAnalysisWarningsSentinel = 2123,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to not specify the value - AFAIK C# should assign the next (+1) value automatically which would make this work nicely when we add a new one.

sbomer added a commit that referenced this pull request Jul 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trimmer reports IL2122 even if trim warnings are suppressed
3 participants