Update Meziantou.Analyzer and enable new rule MA0160

"Use ContainsKey instead of TryGetValue"

I checked the source and MA0159 "Use 'Order' instead of 'OrderBy'" looks
for the LINQ method in the BCL specifically, not by signature, so we
can't replace our bespoke `OrderBySelfAnalyzer` :(
This commit is contained in:
YoshiRulz 2024-09-02 22:33:38 +10:00
parent 57d6355083
commit 4fc3d9bd40
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 5 additions and 3 deletions

View File

@ -346,6 +346,8 @@ dotnet_diagnostic.MA0155.severity = error
dotnet_diagnostic.MA0156.severity = error
# Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>
dotnet_diagnostic.MA0157.severity = error
# Use ContainsKey instead of TryGetValue
dotnet_diagnostic.MA0160.severity = warning
## Menees.Analyzers rules

View File

@ -7,7 +7,7 @@
<PackageVersion Include="JunitXml.TestLogger" Version="3.1.12" />
<PackageVersion Include="Magick.NET-Q8-AnyCPU" Version="13.9.0" />
<PackageVersion Include="Menees.Analyzers" Version="3.2.2" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.159" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.163" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />

View File

@ -9,7 +9,7 @@
(fetchNuGet { pname = "ImGui.NET"; version = "1.90.6.1"; sha256 = "1v1zzlpz3g2h7azqqqhfcwssx9vminnb5pl9880jw28mfk5si1q8"; })
(fetchNuGet { pname = "JunitXml.TestLogger"; version = "3.1.12"; sha256 = "1571rs2zpd7az5wp0bklx1h3pac388awlwhz70k0p0vv44h0v5jc"; })
(fetchNuGet { pname = "Menees.Analyzers"; version = "3.2.2"; sha256 = "0zd7hh5xilm1svnz4dcvgryixkmsncdszzimy3fvz2xbs06cpksb"; })
(fetchNuGet { pname = "Meziantou.Analyzer"; version = "2.0.159"; sha256 = "0ybck0h871hdb7lfv52f73a1y1v2nrlvbvbmy2ws5nbd0xacjvww"; })
(fetchNuGet { pname = "Meziantou.Analyzer"; version = "2.0.163"; sha256 = "1nzn3j7dbbs101mwjksfmb06fnxzwpl4s2n1yi9cwlr9mhnqf33k"; })
(fetchNuGet { pname = "Microsoft.ApplicationInsights"; version = "2.22.0"; sha256 = "0h5qkhmazlvwvjmxxj9pp2404rmvk55yf6npwcmlskv9mgfkli4r"; })
(fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "8.0.0"; sha256 = "0z4jq5prnxyb4p3163yxx35znpd2msjd8hw8ysmv4ah90f5sd9gm"; })
(fetchNuGet { pname = "Microsoft.Bcl.HashCode"; version = "1.1.1"; sha256 = "0xwfph92p92d8hgrdiaka4cazqsjpg4ywfxfx6qbk3939f29kzl0"; })

View File

@ -89,7 +89,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
Cart.BoardType = Cart.BoardType.TrimEnd('\0');
Cart.BoardType = "UNIF_" + Cart.BoardType;
if (Chunks.TryGetValue("BATR", out _))
if (Chunks.ContainsKey("BATR"))
{
// apparently, this chunk just existing means battery is yes
Cart.WramBattery = true;