rsdn / CodeJam

Set of handy reusable .NET components that can simplify your daily work and save your time when you copy and paste your favorite helper methods and classes from one project to another
MIT License
259 stars 35 forks source link

[Net 5.0] Behavior changes in string comparison #125

Closed ig-sinicyn closed 3 years ago

ig-sinicyn commented 3 years ago

Scan for CA1307: Specify StringComparison for clarity CA1309: Use ordinal StringComparison and fix tests

more detail on https://docs.microsoft.com/en-us/dotnet/standard/base-types/string-comparison-net-5-plus

NN--- commented 3 years ago

The simplest way is to add analyzers


    <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>

and suppress everything we don't need in editorconfig

dotnet_diagnostic.csXXXX.severity=none
NN--- commented 3 years ago

With .NET 5 btw you don’t even need the NuGet :)

NN--- commented 3 years ago

I am not sure what exactly the library should do. In most cases you do want the current culture.