-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Enable new CA1311 (ToLower/Upper culture) and CA1852 (seal internal/private types) rules #68268
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
|
Tagging subscribers to this area: @dotnet/area-meta Issue DetailsCA1311 flagged a few issues, all addressed by using ToLowerInvariant/ToUpperInvariant. CA1852 flagged a bunch that previous cleanups around sealing types missed or that are new since. Sealing types then highlighted places where protected or virtual members were being exposed unnecessarily, so those were fixed, too. Adding sealed to things also highlighted some discrepancies in the order of "unsafe sealed" keywords, where the vast majority in the repo were "sealed unsafe", so I fixed the few that weren't.
|
src/libraries/Common/src/System/Net/NTAuthentication.Managed.cs
Outdated
Show resolved
Hide resolved
59aaf40 to
77fc490
Compare
.../Microsoft.Extensions.DependencyInjection.Specification.Tests/src/ActivatorUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Http/src/DefaultHttpClientFactory.cs
Outdated
Show resolved
Hide resolved
12cd5d4 to
ab09bab
Compare
|
Thanks for getting dotnet/roslyn-analyzers#5972 up as well! |
GrabYourPitchforks
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.
Aside from the failing test (which means one of the sealed changes needs to be reverted?) - it all LGTM, including the ToUpperInvariant/ToLowerInvariant portion.
ab09bab to
81b4cbb
Compare
…rivate types) CA1311 flagged a few issues, all addressed by using ToLowerInvariant/ToUpperInvariant. CA1852 flagged a bunch that previous cleanups around sealing types missed or that are new since. Sealing types then highlighted places where protected or virtual members were being exposed unnecessarily, so those were fixed, too. Adding sealed to things also highlighted some discrepancies in the order of "unsafe sealed" keywords, where the vast majority in the repo were "sealed unsafe", so I fixed the few that weren't.
81b4cbb to
ed991aa
Compare
CA1311 flagged a few issues, all addressed by using ToLowerInvariant/ToUpperInvariant.
CA1852 flagged a bunch that previous cleanups around sealing types missed or that are new since. Sealing types then highlighted places where protected or virtual members were being exposed unnecessarily, so those were fixed, too. Adding sealed to things also highlighted some discrepancies in the order of "unsafe sealed" keywords, where the vast majority in the repo were "sealed unsafe", so I fixed the few that weren't.