You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[build] Enable globalization analyzer errors and fix issues (#6368)
Context: #6271
Context: dotnet/java-interop@7068f4b
Making culture-aware string comparisons when not intended can result
in very hard to diagnose bugs (See/#6271).
As we did in dotnet/java-interop@7068f4b2, update the appropriate
Roslyn code analyzers so that errors are generated around "unsafe"
string usage, and to ensure that we don't introduce any new issues
around string & globalization support 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 `.editorconfig` affects all `$(TargetFrameworkMoniker)`s;
we will instead use `Configuration.props` to only enable them for
non-.NET 6+ builds.
Additionally, tweak 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 switched
from case-sensitive to case-insensitive compares.
<!-- The net6.0 versions of these analyzers are stricter and require overloads not available in .NET Framework, so start with just .NET Framework -->
236
+
<PropertyGroupCondition=" '$(TargetFramework)' != '' And (!$(TargetFramework.StartsWith('nets')) And !$(TargetFramework.StartsWith('net4')) And !$(TargetFramework.StartsWith('monoandroid'))) ">
Copy file name to clipboardExpand all lines: build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs
0 commit comments