-
Notifications
You must be signed in to change notification settings - Fork 1.2k
bump WarningLevel to 7 for .NET 7 #24826
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
Youssef1313
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.
While the change on SDK side is needed, it doesn't fully resolve the suggestion for templates.
A user might not specify AnalysisLevel or might specify low value for AnalysisLevel to get a smaller set of CAxxxx analyzers to run (due to FPs, rules that user think are noisy, too much new warnings after update, etc).
For compiler warnings, they're almost always correct warnings that users are encouraged to fix.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
72ca9d7 to
99d7a89
Compare
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
71331c6 to
2191734
Compare
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets
Outdated
Show resolved
Hide resolved
…Analyzers.targets Co-authored-by: Youssef Victor <[email protected]>
5d4f6b9 to
ca9a789
Compare
|
I would love to add a test that computes the uses TFM of the test project to assert that the |
src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToFloatWarningLevels.cs
Show resolved
Hide resolved
Why is this rule/condition on the framework type and not on the C# language version? If I remember correctly, my .NET Framework project which uses an SDK-style csproj file with Yes, I can explicitly specify the Btw, this also affects documentation, see dotnet/docs#33559 |
|
@baronfel I think this PR introduced a regression. Before this PR, the First I thought this was a documentation issue. Now I believe it is a regression. |
The C# compiler supports a warning wave of 7 now, and we should float that on like was done for .NET 6. This PR does that, in a slightly more maintainable way IMO.
The rules are:
latestif the current TFM is the 'latest' TFM (as defined by a property that we need to bump)Fixes #21599 as well
cc @Youssef1313 via dotnet/templating#4580