-
Notifications
You must be signed in to change notification settings - Fork 564
[build] Enable globalization analyzer errors and fix issues. #6368
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7377b06 to
45e5fd3
Compare
45e5fd3 to
853b39c
Compare
jonpryor
reviewed
Oct 6, 2021
src/Xamarin.Android.Build.Tasks/Tasks/AndroidComputeResPaths.cs
Outdated
Show resolved
Hide resolved
jonpryor
reviewed
Oct 6, 2021
src/Xamarin.Android.Build.Tasks/Tasks/AndroidComputeResPaths.cs
Outdated
Show resolved
Hide resolved
jonpryor
reviewed
Oct 6, 2021
jonpryor
reviewed
Oct 6, 2021
src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs
Outdated
Show resolved
Hide resolved
jonpryor
reviewed
Oct 6, 2021
src/Xamarin.Android.Build.Tasks/Tasks/CollectNonEmptyDirectories.cs
Outdated
Show resolved
Hide resolved
grendello
approved these changes
Oct 6, 2021
Contributor
Author
|
Update non-test file/path comparisons to use |
dellis1972
approved these changes
Oct 8, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #6271
Making culture-aware string comparisons when not intended can result in very hard to diagnose bugs. (See #6271)
Like we added in JI (dotnet/java-interop#879), we should use the appropriate Roslyn code analyzers set to
Errorseverity to ensure that we fix current issues and do not introduce any new issues in the future.One complication with enabling these rules is that the .NET 6+ version of these rules are stricter and require overloads that do not exist in .NET Framework or .NET Standard to fix the violations. Enabling these rules in
.editorconfigaffects all$(TargetFrameworkMoniker)s; we will instead useConfiguration.propsto only enable them for non-.NET 6+ builds.Also tweaks and reuses the existing Roslyn Analyzers logic to exclude external code, as many libraries that are used for testing (like
Mono.Debugg[ing|er].Soft)have issues surfaced by these analyzers.Note that some non-test comparisons on filenames/paths were switch from case-sensitive to case-insensitive compares.