diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 4631414599589..8faa50e9a6f00 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -126,6 +126,7 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 99fb28cb6e9bd..5c1f457ae40f4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -219,5 +219,9 @@ https://github.com/dotnet/runtime-assets 8d7b898b96cbdb868cac343e938173105287ed9e + + https://github.com/dotnet/roslyn-analyzers + fcddb771f42866f9521f23f093b1f30e129018bb + diff --git a/eng/Versions.props b/eng/Versions.props index b62b9b4854cfc..2295b6e440d51 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -45,9 +45,10 @@ 3.8.0 - 6.0.0-preview6.21281.1 + 3.10.0-2.final 3.10.0-2.final + 6.0.0-rc1.21320.2 6.0.0-beta.21311.3 6.0.0-beta.21311.3 diff --git a/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs b/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs index fda8cc871d916..80a092104ae50 100644 --- a/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs +++ b/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs @@ -406,8 +406,7 @@ private static bool IsValueValidInternal(string? keyvalue) 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; } diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs index 54054d809c284..ea5a83315216d 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs @@ -628,8 +628,7 @@ private static string FixupName(string name) { Debug.Assert(name != null, "[FixupName]name!=null"); - // string.Contains(char) is .NetCore2.1+ specific - if (name.IndexOf('\\') == -1) + if (!name.Contains('\\')) { return name; } diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj index 104386de5edba..209d36e49c51b 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent);netstandard2.0;net461 false + $(NoWarn);CA1847 diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj index 14a4d33561620..a093eb35ac7fb 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj +++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj @@ -2,7 +2,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0;net461 - $(NoWarn);CA1838 + $(NoWarn);CA1838;CA1847 diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj index f66b352c9c186..600f6fc58b993 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj @@ -2,6 +2,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0;net461 + $(NoWarn);CA1847 diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs index 51892986a5df6..b39b223228834 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs @@ -24,7 +24,7 @@ public static DriveInfo[] GetDrives() 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)); } diff --git a/src/libraries/System.Speech/src/System.Speech.csproj b/src/libraries/System.Speech/src/System.Speech.csproj index a38b451935628..8493864d2f6d6 100644 --- a/src/libraries/System.Speech/src/System.Speech.csproj +++ b/src/libraries/System.Speech/src/System.Speech.csproj @@ -4,7 +4,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0 - $(NoWarn);CS0649;SA1129 + $(NoWarn);CS0649;SA1129;CA1847 false diff --git a/src/tasks/AndroidAppBuilder/ApkBuilder.cs b/src/tasks/AndroidAppBuilder/ApkBuilder.cs index 346f854c383e6..b979ba316b33d 100644 --- a/src/tasks/AndroidAppBuilder/ApkBuilder.cs +++ b/src/tasks/AndroidAppBuilder/ApkBuilder.cs @@ -495,7 +495,7 @@ private static string GetLatestBuildTools(string androidSdkDir) { 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();