From cd0b3ef6695e520e8c4757fed34891e6860dd7bd Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 23 Jun 2021 02:34:38 -0400 Subject: [PATCH] Update NetAnalyzers version (#54511) * Update NetAnalyzers version * Add NetAnalyzers to dependency flow Co-authored-by: Viktor Hofer --- eng/CodeAnalysis.ruleset | 1 + eng/Version.Details.xml | 4 ++++ eng/Versions.props | 3 ++- .../Common/src/System/Data/Common/DbConnectionOptions.Common.cs | 3 +-- .../Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs | 3 +-- .../src/System.Configuration.ConfigurationManager.csproj | 1 + .../src/System.Diagnostics.EventLog.csproj | 2 +- .../src/System.Diagnostics.PerformanceCounter.csproj | 1 + .../src/System/IO/DriveInfo.UnixOrBrowser.cs | 2 +- src/libraries/System.Speech/src/System.Speech.csproj | 2 +- src/tasks/AndroidAppBuilder/ApkBuilder.cs | 2 +- 11 files changed, 15 insertions(+), 9 deletions(-) diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 4631414..8faa50e 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 99fb28c..5c1f457 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 b62b9b4..2295b6e 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 fda8cc8..80a0921 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 @@ namespace System.Data.Common 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 54054d8..ea5a833 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 @@ namespace Microsoft.Win32 { 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 104386d..209d36e 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 14a4d33..a093eb3 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 f66b352..600f6fc 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 5189298..b39b223 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 @@ namespace System.IO 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 a38b451..8493864 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 346f854..b979ba3 100644 --- a/src/tasks/AndroidAppBuilder/ApkBuilder.cs +++ b/src/tasks/AndroidAppBuilder/ApkBuilder.cs @@ -495,7 +495,7 @@ public class ApkBuilder { 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(); -- 2.7.4