Skip to content

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

Merged
sbomer merged 2 commits into
dotnet:mainfrom
sbomer:fixTrimWarningSuppressions
Jul 18, 2024
Merged

Include new warning codes in --notrimwarn and --noaotwarn#105049
sbomer merged 2 commits into
dotnet:mainfrom
sbomer:fixTrimWarningSuppressions

Conversation

@sbomer

@sbomer sbomer commented Jul 17, 2024

Copy link
Copy Markdown
Member

Fixes #105044

@sbomer
sbomer requested a review from marek-safar as a code owner July 17, 2024 20:53
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 17, 2024
Comment thread src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/WarningsTests.cs
@@ -0,0 +1,41 @@
using System.Diagnostics.CodeAnalysis;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Header?

Copy link
Copy Markdown
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.

2106 => MessageSubCategory.TrimAnalysis,
2107 => MessageSubCategory.TrimAnalysis,
>= 2109 and <= 2121 => MessageSubCategory.TrimAnalysis,
>= 2109 and <= (int) DiagnosticId._EndTrimAnalysisWarningsSentinel => MessageSubCategory.TrimAnalysis,

Copy link
Copy Markdown
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 <

_unused_DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberOnBase = 2120,
RedundantSuppression = 2121,
TypeNameIsNotAssemblyQualified = 2122,
_EndTrimAnalysisWarningsSentinel = 2123,

Copy link
Copy Markdown
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
@sbomer
sbomer deleted the fixTrimWarningSuppressions branch June 26, 2026 18:08
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

3 participants