-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Enables code analysis rules about culture sensitive string operations #26656
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
4bfea38 to
176aeb2
Compare
176aeb2 to
80f22df
Compare
80f22df to
c5d9ea5
Compare
|
@pranavkm Do you have a suggestion about how this PR should be reviewed? It's probably too big for any one person to read and reason about the correctness of each change here. Should each affected product area team be responsible for reviewing their own files? |
|
@SteveSandersonMS a lot of the file changes are in our tests which require less scrutiny. Product changes (filtering by files that have |
src/Identity/EntityFrameworkCore/test/EF.InMemory.Test/InMemoryStoreWithGenericsTest.cs
Show resolved
Hide resolved
| @@ -440,7 +440,7 @@ private async Task<NegotiationResponse> NegotiateAsync(Uri url, HttpClient httpC | |||
| // Get a connection ID from the server | |||
| Log.EstablishingConnection(logger, url); | |||
| var urlBuilder = new UriBuilder(url); | |||
| if (!urlBuilder.Path.EndsWith("/")) | |||
| if (!urlBuilder.Path.EndsWith("/", StringComparison.Ordinal)) | |||
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.
Can this be changed to a character instead of string?
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.
This one cross-compiles to ns2.0 which does not have the char overload.
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.
u owe me BIG time 😄 .
Few questions about CurrentCulture vs InvariantCulture but besides that LGTM.
StringComparisoninStartsWith,EndsWith,CompareoperationsCultureInfo.InvariantCulturewhen parsing and formatting non-culture sensitive strings, and in tests.CultureInfo.CurrentCulturewhen printing user-visible error messages \ logs