Fix code style warnings in NLua

see 69b923ad5
This commit is contained in:
YoshiRulz 2025-02-24 10:42:37 +10:00
parent 484e5e996b
commit 938ac8c7ff
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 10 additions and 2 deletions

View File

@ -22,7 +22,7 @@
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);IDE0005;SA1514;SA1614;SA1616</NoWarn>
<NoWarn>$(NoWarn);BHI1300;IDE0005;SA1514;SA1614;SA1616</NoWarn>
<Nullable>disable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

View File

@ -1542,7 +1542,7 @@ namespace NLua
{
extractValue = null;
if (!currentNetParam.GetCustomAttributes(typeof(ParamArrayAttribute), false).Any())
if (currentNetParam.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length is 0)
{
return false;
}

View File

@ -87,7 +87,11 @@ namespace NLua.Native
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
#pragma warning disable CA1862 // suggests `string.Contains(string, StringComparison)` even though that's not available with this target
#pragma warning disable RCS1155 // ditto
RuntimeInformation.OSDescription.ToUpperInvariant().Contains("BSD"))
#pragma warning restore RCS1155
#pragma warning restore CA1862
{
return new LibcNativeLibraryLoader();
}
@ -107,7 +111,11 @@ namespace NLua.Native
// we can safely use lua 5.3 for our purposes, hope the
// user's distro provides at least lua 5.3!
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
#pragma warning disable CA1862 // suggests `string.Contains(string, StringComparison)` even though that's not available with this target
#pragma warning disable RCS1155 // ditto
RuntimeInformation.OSDescription.ToUpperInvariant().Contains("BSD"))
#pragma warning restore RCS1155
#pragma warning restore CA1862
{
return new[]
{