<Rule Id="CA1844" Action="Warning" /> <!-- Provide memory-based overrides of async methods when subclassing 'Stream' -->
<Rule Id="CA1845" Action="Warning" /> <!-- Use span-based 'string.Concat' -->
<Rule Id="CA1846" Action="Warning" /> <!-- Prefer 'AsSpan' over 'Substring' -->
+ <Rule Id="CA1847" Action="Warning" /> <!-- Use char literal for a single character lookup -->
<Rule Id="CA2000" Action="None" /> <!-- Dispose objects before losing scope -->
<Rule Id="CA2002" Action="None" /> <!-- Do not lock on objects with weak identity -->
<Rule Id="CA2007" Action="Warning" /> <!-- Consider calling ConfigureAwait on the awaited task -->
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>8d7b898b96cbdb868cac343e938173105287ed9e</Sha>
</Dependency>
+ <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0-rc1.21320.2">
+ <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
+ <Sha>fcddb771f42866f9521f23f093b1f30e129018bb</Sha>
+ </Dependency>
</ToolsetDependencies>
</Dependencies>
<MicrosoftCodeAnalysisVersion>3.8.0</MicrosoftCodeAnalysisVersion>
</PropertyGroup>
<PropertyGroup>
- <MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview6.21281.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
+ <!-- Code analysis dependencies -->
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.10.0-2.final</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisCSharpVersion>3.10.0-2.final</MicrosoftCodeAnalysisCSharpVersion>
+ <MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-rc1.21320.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- Arcade dependencies -->
<MicrosoftDotNetApiCompatVersion>6.0.0-beta.21311.3</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>6.0.0-beta.21311.3</MicrosoftDotNetBuildTasksFeedVersion>
bool compValue = s_connectionStringValidValueRegex.IsMatch(keyvalue);
Debug.Assert((-1 == keyvalue.IndexOf('\u0000')) == compValue, "IsValueValid mismatch with regex");
#endif
- // string.Contains(char) is .NetCore2.1+ specific
- return (-1 == keyvalue.IndexOf('\u0000'));
+ return (-1 == keyvalue.IndexOf('\u0000')); // string.Contains(char) is .NetCore2.1+ specific
}
return true;
}
{
Debug.Assert(name != null, "[FixupName]name!=null");
- // string.Contains(char) is .NetCore2.1+ specific
- if (name.IndexOf('\\') == -1)
+ if (!name.Contains('\\'))
{
return name;
}
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
<!-- opt-out of trimming until it works https://github.com/dotnet/runtime/issues/49062 -->
<SetIsTrimmable>false</SetIsTrimmable>
+ <NoWarn>$(NoWarn);CA1847</NoWarn>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
- <NoWarn>$(NoWarn);CA1838</NoWarn>
+ <NoWarn>$(NoWarn);CA1838;CA1847</NoWarn>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
+ <NoWarn>$(NoWarn);CA1847</NoWarn>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
private static string NormalizeDriveName(string driveName)
{
- if (driveName.Contains("\0")) // string.Contains(char) is .NetCore2.1+ specific
+ if (driveName.Contains('\0'))
{
throw new ArgumentException(SR.Format(SR.Arg_InvalidDriveChars, driveName), nameof(driveName));
}
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<!-- CS0649: uninitialized interop type fields -->
<!-- SA1129: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3277 -->
- <NoWarn>$(NoWarn);CS0649;SA1129</NoWarn>
+ <NoWarn>$(NoWarn);CS0649;SA1129;CA1847</NoWarn>
<SetIsTrimmable>false</SetIsTrimmable>
</PropertyGroup>
<PropertyGroup>
{
string? buildTools = Directory.GetDirectories(Path.Combine(androidSdkDir, "build-tools"))
.Select(Path.GetFileName)
- .Where(file => !file!.Contains("-"))
+ .Where(file => !file!.Contains('-'))
.Select(file => { Version.TryParse(Path.GetFileName(file), out Version? version); return version; })
.OrderByDescending(v => v)
.FirstOrDefault()?.ToString();