From a21d17c51dd6cf59d745ba2610580135f375a8be Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Mon, 5 May 2025 17:05:56 -0600 Subject: [PATCH 1/9] version updates --- .../Microsoft.ML.GenAI.Samples.csproj | 3 +- .../Microsoft.ML.Samples.csproj | 1 + eng/Versions.props | 70 ++++++++++--------- .../Microsoft.ML.AutoML.Interactive.csproj | 1 + .../Microsoft.ML.AutoML.csproj | 10 ++- .../Microsoft.ML.GenAI.Core.csproj | 1 + .../Microsoft.ML.GenAI.Mistral.csproj | 2 + .../Microsoft.ML.GenAI.Phi.csproj | 1 + .../Code/BestFriendOnPublicDeclarationTest.cs | 1 + .../Code/BestFriendTest.cs | 1 + .../Code/ContractsCheckTest.cs | 2 + .../Code/InstanceInitializerTest.cs | 4 +- .../Code/NameTest.cs | 4 ++ .../Code/ParameterVariableNameTest.cs | 2 + .../Code/RelaxTestNamingTest.cs | 3 + .../Code/SingleVariableDeclarationTest.cs | 2 + .../Code/TypeParamNameTest.cs | 2 + .../Helpers/CSharpCodeFixVerifier`2.cs | 5 ++ .../Microsoft.ML.GenAI.Core.Tests.csproj | 1 + .../Microsoft.ML.GenAI.LLaMA.Tests.csproj | 1 + .../Microsoft.ML.GenAI.Phi.Tests.csproj | 1 + .../EstimatorTypeGenerator.cs | 1 + .../SearchSpaceGenerator.cs | 1 + .../SweepableEstimatorFactoryGenerator.cs | 1 + .../SweepableEstimatorGenerator.cs | 1 + .../BaseTestClassAnalyzer.cs | 9 +-- .../BestFriendAnalyzer.cs | 13 ++-- .../BestFriendOnPublicDeclarationsAnalyzer.cs | 7 +- .../ContractsCheckAnalyzer.cs | 1 + .../INamedTypeSymbolExtensions.cs | 2 +- .../InstanceInitializerAnalyzer.cs | 1 + .../Microsoft.ML.InternalCodeAnalyzer.csproj | 1 + .../NameAnalyzer.cs | 1 + .../NameFixProvider.cs | 5 +- .../ParameterVariableNameAnalyzer.cs | 1 + .../RelaxTestNamingSuppressor.cs | 3 +- .../SingleVariableDeclarationAnalyzer.cs | 1 + .../TypeParamNameAnalyzer.cs | 1 + 38 files changed, 113 insertions(+), 55 deletions(-) diff --git a/docs/samples/Microsoft.ML.GenAI.Samples/Microsoft.ML.GenAI.Samples.csproj b/docs/samples/Microsoft.ML.GenAI.Samples/Microsoft.ML.GenAI.Samples.csproj index c8cee633ac..36bd3377dd 100644 --- a/docs/samples/Microsoft.ML.GenAI.Samples/Microsoft.ML.GenAI.Samples.csproj +++ b/docs/samples/Microsoft.ML.GenAI.Samples/Microsoft.ML.GenAI.Samples.csproj @@ -19,7 +19,8 @@ - + + diff --git a/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj b/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj index 7ea6aef2f0..fe47fdf85a 100644 --- a/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj +++ b/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj @@ -974,6 +974,7 @@ + diff --git a/eng/Versions.props b/eng/Versions.props index ef581b1d00..e7d52bb500 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,40 +12,43 @@ preview 1.0.0.0 - 8.0.0 - 8.0.0 - 8.0.1 - 8.0.0 - 8.0.7 - 8.0.2 + 9.0.4 + 9.0.4 + 9.0.4 + 9.0.4 + 9.0.4 + 9.0.4 6.9.1 2.88.8 - 8.0.0 - 8.0.0 - 6.0.1 - 8.0.1 + 9.0.4 + 9.0.4 + 9.0.4 + 9.0.4 5.0.0 - 9.0.0 + 9.0.4 4.7.0 - 4.3.0 + 4.7.0 5.0.0 - 8.0.0 - 8.0.5 - 8.0.0 + 9.0.4 + 9.0.4 + 9.0.4 14.0.2 - 3.27.1 + 3.30.2 4.6.0 + 5.0.1 + 7.3.4 6.0.0 - 9.0.0 - 3.3.4 - 4.9.2 - 1.0.0-beta.24375.2 - 1.18.1 + 9.0.4 + 3.11.0 + 4.13.0 + 1.0.0-beta.25177.1 + 1.21.0 + 1.21.2 0.0.0.12 9.4.0-preview.1.25207.5 - 4.4.0 + 4.7.0 @@ -58,8 +61,8 @@ 2021.7.1.14939 1 1 - 3.7.0 - 3.7.0 + 3.8.3 + 3.8.3 13.0.3 2.1.3 0.11.1 @@ -68,31 +71,32 @@ 2 2.3.1 1.4.1 - 0.1.0 - 1.15.0 + 0.2.3 + 1.48.0 0.102.7 2.2.1.1 1.12.4 - 6.0.2 + 6.0.4 6.0.0 - 3.3.1 + 4.13.0 4.7.0 4.3.6 - 8.0.0 + + 9.0.4 6.0.0 4.20.70 0.13.12 6.0.26 8.0.1 - 8.0.2 - 1.1.2-beta1.23431.1 + 8.1.0 + 1.1.2 9.0.0-beta.24212.4 5.0.0-preview.5.20278.1 8.0.0-beta.24525.2 - 10.0.0-beta.25253.1 - 8.0.2 + 10.0.0-beta.25225.4 + 9.0.4 0.0.6-test 0.0.13-test 0.0.6-test diff --git a/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj b/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj index 7144833fa2..343defdead 100644 --- a/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj +++ b/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj @@ -14,6 +14,7 @@ + diff --git a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj index d79ca0e5cf..0ea26b0bb9 100644 --- a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj +++ b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj @@ -8,7 +8,7 @@ 1591: Documentation warnings NU5100: Warning that gets triggered because a .dll is not placed under lib folder on package. This is by design as we want AutoML Interactive to be under interactive-extensions folder. --> - $(NoWarn);1591;NU5100 + $(NoWarn);1591;NU5100s $(TargetsForTfmSpecificContentInPackage);AddAutoMLInteractiveToInteractiveExtensionsFolder @@ -38,8 +38,6 @@ - - @@ -52,6 +50,12 @@ + + + + + + diff --git a/src/Microsoft.ML.GenAI.Core/Microsoft.ML.GenAI.Core.csproj b/src/Microsoft.ML.GenAI.Core/Microsoft.ML.GenAI.Core.csproj index 9ed5a2702e..5e338be902 100644 --- a/src/Microsoft.ML.GenAI.Core/Microsoft.ML.GenAI.Core.csproj +++ b/src/Microsoft.ML.GenAI.Core/Microsoft.ML.GenAI.Core.csproj @@ -17,6 +17,7 @@ + diff --git a/src/Microsoft.ML.GenAI.Mistral/Microsoft.ML.GenAI.Mistral.csproj b/src/Microsoft.ML.GenAI.Mistral/Microsoft.ML.GenAI.Mistral.csproj index f20b587631..cffb7bfa75 100644 --- a/src/Microsoft.ML.GenAI.Mistral/Microsoft.ML.GenAI.Mistral.csproj +++ b/src/Microsoft.ML.GenAI.Mistral/Microsoft.ML.GenAI.Mistral.csproj @@ -14,6 +14,8 @@ + + diff --git a/src/Microsoft.ML.GenAI.Phi/Microsoft.ML.GenAI.Phi.csproj b/src/Microsoft.ML.GenAI.Phi/Microsoft.ML.GenAI.Phi.csproj index d19dbe58fa..3f3f6bd834 100644 --- a/src/Microsoft.ML.GenAI.Phi/Microsoft.ML.GenAI.Phi.csproj +++ b/src/Microsoft.ML.GenAI.Phi/Microsoft.ML.GenAI.Phi.csproj @@ -14,6 +14,7 @@ + diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs index 13dc04d5ae..e235b04ef6 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs @@ -19,6 +19,7 @@ public sealed class BestFriendOnPublicDeclarationTest private readonly Lazy _sourceDeclaration = TestUtils.LazySource("BestFriendOnPublicDeclaration.cs"); [Fact] + [Obsolete] public async Task BestFriendOnPublicDeclaration() { var expected = new DiagnosticResult[] { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs index 4b44ccd3f1..6d1533a5d4 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs @@ -28,6 +28,7 @@ public sealed class BestFriendTest private readonly Lazy _sourceUser = TestUtils.LazySource("BestFriendUser.cs"); [Fact] + [Obsolete] public async Task BestFriend() { // The setup to this one is a bit more involved than many of the analyzer tests, diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 6822853ba4..7e5ed99bca 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -22,6 +22,7 @@ public sealed class ContractsCheckTest private readonly Lazy _sourceFriend = TestUtils.LazySource("BestFriendAttribute.cs"); [Fact] + [Obsolete] public async Task ContractsCheck() { const int basis = 11; @@ -95,6 +96,7 @@ public TypeName() private readonly Lazy _sourceDefArgAttr = TestUtils.LazySource("DefaultArgumentAttribute.cs"); [Fact] + [Obsolete] public async Task ContractsCheckFix() { var test = new VerifyCS.Test diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs index a1242c9f74..3491cff9e4 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Xunit; @@ -13,7 +14,8 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests { public sealed class InstanceInitializerTest { - [Fact] + [Fact(Skip = "The analyzer behind this test will be removed in a future PR. Disabling for now to allow version updates.")] + [Obsolete] public async Task InstanceInitializer() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs index 68d93a3d02..f19a0b0308 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Xunit; @@ -14,6 +15,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class NameTest { [Fact] + [Obsolete] public async Task PrivateFieldName() { var expected = new DiagnosticResult[] { @@ -54,6 +56,7 @@ class TypeName }"; [Fact] + [Obsolete] public async Task MoreNameTests() { var expected = new DiagnosticResult[] { @@ -129,6 +132,7 @@ class BeClass { } struct marco { public int polo; } }"; [Fact] + [Obsolete] public async Task ExternName() { const string source = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs index d6a655eaee..e9c3637838 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Xunit; @@ -14,6 +15,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class ParameterVariableNameTest { [Fact] + [Obsolete] public async Task ParameterVariableName() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs index c2b4c9dee4..d5226d1840 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs @@ -100,6 +100,9 @@ public async Task TestMethodAsync() { } }.RunAsync(); } + [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1041:Compiler extensions should be implemented in assemblies targeting netstandard2.0", Justification = "")] + [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] + [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1036:Specify analyzer banned API enforcement setting", Justification = "")] [DiagnosticAnalyzer(LanguageNames.CSharp)] public class WarnForMissingAsyncSuffix : DiagnosticAnalyzer { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs index 89a15a1516..137a47bd39 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Xunit; @@ -14,6 +15,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class SingleVariableDeclarationTest { [Fact] + [Obsolete] public async Task SingleVariableDeclaration() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs index 4517af47ba..2ff5056b76 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Xunit; @@ -14,6 +15,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class TypeParamNameTest { [Fact] + [Obsolete] public async Task TypeParamName() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs index 5a72337a68..2eaab24b01 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs @@ -17,12 +17,15 @@ internal static class CSharpCodeFixVerifier where TAnalyzer : DiagnosticAnalyzer, new() where TCodeFix : CodeFixProvider, new() { + [System.Obsolete] public static DiagnosticResult Diagnostic() => CSharpCodeFixVerifier.Diagnostic(); + [System.Obsolete] public static DiagnosticResult Diagnostic(string diagnosticId) => CSharpCodeFixVerifier.Diagnostic(diagnosticId); + [System.Obsolete] public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) => CSharpCodeFixVerifier.Diagnostic(descriptor); @@ -55,7 +58,9 @@ public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] ex await test.RunAsync(); } +#pragma warning disable CS0618 // Type or member is obsolete internal class Test : CSharpCodeFixTest +#pragma warning restore CS0618 // Type or member is obsolete { public Test() { diff --git a/test/Microsoft.ML.GenAI.Core.Tests/Microsoft.ML.GenAI.Core.Tests.csproj b/test/Microsoft.ML.GenAI.Core.Tests/Microsoft.ML.GenAI.Core.Tests.csproj index 90d312095e..f9ff796999 100644 --- a/test/Microsoft.ML.GenAI.Core.Tests/Microsoft.ML.GenAI.Core.Tests.csproj +++ b/test/Microsoft.ML.GenAI.Core.Tests/Microsoft.ML.GenAI.Core.Tests.csproj @@ -21,6 +21,7 @@ + diff --git a/test/Microsoft.ML.GenAI.LLaMA.Tests/Microsoft.ML.GenAI.LLaMA.Tests.csproj b/test/Microsoft.ML.GenAI.LLaMA.Tests/Microsoft.ML.GenAI.LLaMA.Tests.csproj index e0499f49c8..ec6445363d 100644 --- a/test/Microsoft.ML.GenAI.LLaMA.Tests/Microsoft.ML.GenAI.LLaMA.Tests.csproj +++ b/test/Microsoft.ML.GenAI.LLaMA.Tests/Microsoft.ML.GenAI.LLaMA.Tests.csproj @@ -22,6 +22,7 @@ + diff --git a/test/Microsoft.ML.GenAI.Phi.Tests/Microsoft.ML.GenAI.Phi.Tests.csproj b/test/Microsoft.ML.GenAI.Phi.Tests/Microsoft.ML.GenAI.Phi.Tests.csproj index 086654f79c..1da4290324 100644 --- a/test/Microsoft.ML.GenAI.Phi.Tests/Microsoft.ML.GenAI.Phi.Tests.csproj +++ b/test/Microsoft.ML.GenAI.Phi.Tests/Microsoft.ML.GenAI.Phi.Tests.csproj @@ -23,6 +23,7 @@ + diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs index 600765031f..de08c2cb90 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs @@ -15,6 +15,7 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class EstimatorTypeGenerator : ISourceGenerator { private const string className = "EstimatorType"; diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs index 5f47793993..9efa3c4cfd 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs @@ -15,6 +15,7 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SearchSpaceGenerator : ISourceGenerator { public void Execute(GeneratorExecutionContext context) diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs index 5c569d1ae9..f57ba8c2e3 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs @@ -13,6 +13,7 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SweepableEstimatorFactoryGenerator : ISourceGenerator { private const string className = "SweepableEstimatorFactory"; diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs index 88fcc97b5e..c829776878 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs @@ -12,6 +12,7 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SweepableEstimatorGenerator : ISourceGenerator { private const string SweepableEstimatorAttributeDisplayName = Constant.CodeGeneratorNameSpace + "." + "SweepableEstimatorAttribute"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs index ed45d59a72..c4727d35d6 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs @@ -11,13 +11,14 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BaseTestClassAnalyzer : DiagnosticAnalyzer { private const string Category = "Test"; internal const string DiagnosticId = "MSML_ExtendBaseTestClass"; private const string Title = "Test classes should be derived from BaseTestClass or FunctionalTestBaseClass"; - private const string Format = "Test class '{0}' should extend BaseTestClass or FunctionalTestBaseClass."; + private const string Format = "Test class '{0}' should extend BaseTestClass or FunctionalTestBaseClass"; private const string Description = "Test classes should be derived from BaseTestClass or FunctionalTestBaseClass."; @@ -52,7 +53,7 @@ private sealed class AnalyzerImpl private readonly INamedTypeSymbol _factAttribute; private readonly INamedTypeSymbol _baseTestClass; private readonly INamedTypeSymbol _ITbaseTestClass; - private readonly ConcurrentDictionary _knownTestAttributes = new ConcurrentDictionary(); + private readonly ConcurrentDictionary _knownTestAttributes = new ConcurrentDictionary(SymbolEqualityComparer.Default); public AnalyzerImpl(Compilation compilation, INamedTypeSymbol factAttribute) { @@ -89,8 +90,8 @@ private bool ExtendsBaseTestClass(INamedTypeSymbol namedType) for (var current = namedType; current is object; current = current.BaseType) { - if (Equals(current, _baseTestClass) || - Equals(current, _ITbaseTestClass)) + if (SymbolEqualityComparer.Default.Equals(current, _baseTestClass) || + SymbolEqualityComparer.Default.Equals(current, _ITbaseTestClass)) return true; } diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs index 605f71184c..78d4e0dceb 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs @@ -12,15 +12,16 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BestFriendAnalyzer : DiagnosticAnalyzer { private const string Category = "Access"; internal const string DiagnosticId = "MSML_NoBestFriendInternal"; - private const string Title = "Cross-assembly internal access requires referenced item to have " + AttributeName + " attribute."; + private const string Title = "Cross-assembly internal access requires referenced item to have " + AttributeName + " attribute"; private const string Format = "Access of '{0}' is a cross assembly internal " + "reference, and the declaring assembly wants these accesses to be on something " + - "with the attribute " + AttributeName + "."; + "with the attribute " + AttributeName; private const string Description = "The identifier indicated is defined as an internal member of an assembly that has the " + AssemblyAttributeName + " assembly-level attribute set. Even with friend access to that " + @@ -60,7 +61,7 @@ private void AnalyzeCore(SemanticModelAnalysisContext context, string attributeN return; var myAssembly = comp.Assembly; - var assemblyHasAttrMap = new Dictionary(); + var assemblyHasAttrMap = new Dictionary(SymbolEqualityComparer.Default); int count = 0; foreach (var node in model.SyntaxTree.GetRoot().DescendantNodes(n => !n.IsKind(SyntaxKind.UsingDirective))) @@ -78,7 +79,7 @@ private void AnalyzeCore(SemanticModelAnalysisContext context, string attributeN if (symbol == null) continue; var symbolAssembly = symbol.ContainingAssembly; - if (Equals(symbolAssembly, myAssembly)) + if (SymbolEqualityComparer.Default.Equals(symbolAssembly, myAssembly)) continue; switch (symbol.DeclaredAccessibility) { @@ -96,12 +97,12 @@ private void AnalyzeCore(SemanticModelAnalysisContext context, string attributeN // It's the first of seeing the assembly containing symbol. A key-value pair is added into assemblyHasAttrMap to // indicate if that assembly includes an attribute WantsToBeBestFriends. If an assembly has WantsToBeBestFriends then // its associated value would be true. - assemblyWantsBestFriends = symbolAssembly.GetAttributes().Any(a => Equals(a.AttributeClass, wantsToBeBestFriendsAttributeType)); + assemblyWantsBestFriends = symbolAssembly.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, wantsToBeBestFriendsAttributeType)); assemblyHasAttrMap[symbolAssembly] = assemblyWantsBestFriends; } if (!assemblyWantsBestFriends) continue; - if (symbol.GetAttributes().Any(a => Equals(a.AttributeClass, bestFriendAttributeType))) + if (symbol.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, bestFriendAttributeType))) { // You're not just a friend, you're my best friend! continue; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs index 8b1821013a..807ec1af4f 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs @@ -11,13 +11,14 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BestFriendOnPublicDeclarationsAnalyzer : DiagnosticAnalyzer { private const string Category = "Access"; internal const string DiagnosticId = "MSML_BestFriendOnPublicDeclaration"; - private const string Title = "Public declarations should not have " + AttributeName + " attribute."; - private const string Format = "The " + AttributeName + " should not be applied to publicly visible members."; + private const string Title = "Public declarations should not have " + AttributeName + " attribute"; + private const string Format = "The " + AttributeName + " should not be applied to publicly visible members"; private const string Description = "The " + AttributeName + " attribute is not valid on public identifiers."; @@ -59,7 +60,7 @@ private void AnalyzeCore(SymbolAnalysisContext context, INamedTypeSymbol attribu if (context.Symbol.DeclaredAccessibility != Accessibility.Public) return; - var attribute = context.Symbol.GetAttributes().FirstOrDefault(a => Equals(a.AttributeClass, attributeType)); + var attribute = context.Symbol.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeType)); if (attribute == null) return; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs index ef2bcdce78..e724473a1e 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs @@ -12,6 +12,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class ContractsCheckAnalyzer : DiagnosticAnalyzer { // Detecting that a syntax call is actually on a particular method is computationally diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/INamedTypeSymbolExtensions.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/INamedTypeSymbolExtensions.cs index 38b414bc8b..2ad6272e92 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/INamedTypeSymbolExtensions.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/INamedTypeSymbolExtensions.cs @@ -23,7 +23,7 @@ private static bool ExtendsFactAttribute(INamedTypeSymbol namedType, INamedTypeS Debug.Assert(factAttribute is object); for (var current = namedType; current is object; current = current.BaseType) { - if (Equals(current, factAttribute)) + if (SymbolEqualityComparer.Default.Equals(current, factAttribute)) return true; } diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs index d678267558..c5d0c67d51 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs @@ -12,6 +12,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class InstanceInitializerAnalyzer : DiagnosticAnalyzer { private const string Category = "Declaration"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj b/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj index 44b410a05e..2e9f556792 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj @@ -2,6 +2,7 @@ netstandard2.0 + true diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs index cb1755d3ab..45474db44a 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs @@ -22,6 +22,7 @@ internal enum NameType } [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class NameAnalyzer : DiagnosticAnalyzer { internal const string Category = "Naming"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameFixProvider.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameFixProvider.cs index 94a3b7307f..d0ed78aa50 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameFixProvider.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameFixProvider.cs @@ -31,7 +31,7 @@ public sealed class NameFixProvider : CodeFixProvider { private const string PrivateTitle = "Fix name"; - private static ImmutableArray _fixable = ImmutableArray.Create( + private static readonly ImmutableArray _fixable = ImmutableArray.Create( NameAnalyzer.PrivateFieldName.Id, NameAnalyzer.GeneralName.Id, ParameterVariableNameAnalyzer.Id, TypeParamNameAnalyzer.Id); @@ -111,7 +111,8 @@ private async Task RenameAsync(Document document, // Produce a new solution that has all references to that type renamed, including the declaration. var originalSolution = document.Project.Solution; var optionSet = originalSolution.Workspace.Options; - var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, typeSymbol, newName, optionSet, cancellationToken).ConfigureAwait(false); + SymbolRenameOptions renameOptions = new SymbolRenameOptions(); + var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, typeSymbol, renameOptions, newName, cancellationToken).ConfigureAwait(false); // Return the new solution with the now-uppercase type name. return newSolution; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs index d9b27dcfde..3d47d25fdc 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs @@ -12,6 +12,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class ParameterVariableNameAnalyzer : DiagnosticAnalyzer { private const string Category = "Naming"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs index cdd4d6bd2b..5b85236a15 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs @@ -10,6 +10,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class RelaxTestNamingSuppressor : DiagnosticSuppressor { private const string Id = "MSML_RelaxTestNaming"; @@ -28,7 +29,7 @@ public override void ReportSuppressions(SuppressionAnalysisContext context) return; } - var knownTestAttributes = new ConcurrentDictionary(); + var knownTestAttributes = new ConcurrentDictionary(SymbolEqualityComparer.Default); foreach (var diagnostic in context.ReportedDiagnostics) { diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs index d88d9dae98..3fac988bd5 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs @@ -12,6 +12,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class SingleVariableDeclarationAnalyzer : DiagnosticAnalyzer { private const string Category = "Declaration"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs index 6aa9895f32..bf2d4f30bf 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs @@ -11,6 +11,7 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class TypeParamNameAnalyzer : DiagnosticAnalyzer { private const string Category = "Naming"; From 1eabe4062234eb85861bc722a8ad26c1bcda5d9b Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Mon, 5 May 2025 17:11:25 -0600 Subject: [PATCH 2/9] rebase fixes --- eng/Versions.props | 1 + src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index e7d52bb500..5bfaba4322 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,6 +25,7 @@ 9.0.4 9.0.4 5.0.0 + 9.0.4 9.0.4 4.7.0 4.7.0 diff --git a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj index 0ea26b0bb9..0dd8caa188 100644 --- a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj +++ b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj @@ -53,7 +53,7 @@ - + From 7d95adcf0ea3132625e6b962392c1593107146d6 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Mon, 5 May 2025 18:06:46 -0600 Subject: [PATCH 3/9] fix nuget warning --- src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj index 0dd8caa188..d991124125 100644 --- a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj +++ b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj @@ -8,7 +8,7 @@ 1591: Documentation warnings NU5100: Warning that gets triggered because a .dll is not placed under lib folder on package. This is by design as we want AutoML Interactive to be under interactive-extensions folder. --> - $(NoWarn);1591;NU5100s + $(NoWarn);1591;NU5100 $(TargetsForTfmSpecificContentInPackage);AddAutoMLInteractiveToInteractiveExtensionsFolder From 14bcba0eaccbf82b9d4f1bc27de1e82442f74eed Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 19 May 2025 10:28:41 -0700 Subject: [PATCH 4/9] Refactor obsolete suppressions for XUnitVerifier --- .../Code/BestFriendOnPublicDeclarationTest.cs | 1 - test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs | 1 - .../Code/ContractsCheckTest.cs | 2 -- .../Code/InstanceInitializerTest.cs | 1 - test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs | 5 ++--- .../Code/ParameterVariableNameTest.cs | 1 - .../Code/SingleVariableDeclarationTest.cs | 1 - .../Code/TypeParamNameTest.cs | 1 - .../Helpers/CSharpCodeFixVerifier`2.cs | 5 ++--- 9 files changed, 4 insertions(+), 14 deletions(-) diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs index e235b04ef6..13dc04d5ae 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendOnPublicDeclarationTest.cs @@ -19,7 +19,6 @@ public sealed class BestFriendOnPublicDeclarationTest private readonly Lazy _sourceDeclaration = TestUtils.LazySource("BestFriendOnPublicDeclaration.cs"); [Fact] - [Obsolete] public async Task BestFriendOnPublicDeclaration() { var expected = new DiagnosticResult[] { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs index 6d1533a5d4..4b44ccd3f1 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/BestFriendTest.cs @@ -28,7 +28,6 @@ public sealed class BestFriendTest private readonly Lazy _sourceUser = TestUtils.LazySource("BestFriendUser.cs"); [Fact] - [Obsolete] public async Task BestFriend() { // The setup to this one is a bit more involved than many of the analyzer tests, diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 7e5ed99bca..6822853ba4 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -22,7 +22,6 @@ public sealed class ContractsCheckTest private readonly Lazy _sourceFriend = TestUtils.LazySource("BestFriendAttribute.cs"); [Fact] - [Obsolete] public async Task ContractsCheck() { const int basis = 11; @@ -96,7 +95,6 @@ public TypeName() private readonly Lazy _sourceDefArgAttr = TestUtils.LazySource("DefaultArgumentAttribute.cs"); [Fact] - [Obsolete] public async Task ContractsCheckFix() { var test = new VerifyCS.Test diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs index 3491cff9e4..d2251a780c 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/InstanceInitializerTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class InstanceInitializerTest { [Fact(Skip = "The analyzer behind this test will be removed in a future PR. Disabling for now to allow version updates.")] - [Obsolete] public async Task InstanceInitializer() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs index f19a0b0308..cb0a51821e 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class NameTest { [Fact] - [Obsolete] public async Task PrivateFieldName() { var expected = new DiagnosticResult[] { @@ -56,7 +55,6 @@ class TypeName }"; [Fact] - [Obsolete] public async Task MoreNameTests() { var expected = new DiagnosticResult[] { @@ -132,7 +130,6 @@ class BeClass { } struct marco { public int polo; } }"; [Fact] - [Obsolete] public async Task ExternName() { const string source = @" @@ -152,10 +149,12 @@ public void masterBlaster() {} } "; +#pragma warning disable CS0612 // Type or member is obsolete var expected = new DiagnosticResult[] { VerifyCS.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(7, 11).WithArguments("CLASS"), VerifyCS.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(13, 21).WithArguments("masterBlaster"), }; +#pragma warning restore CS0612 // Type or member is obsolete await VerifyCS.VerifyAnalyzerAsync(source, expected); } diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs index e9c3637838..6b7e0c6406 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ParameterVariableNameTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class ParameterVariableNameTest { [Fact] - [Obsolete] public async Task ParameterVariableName() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs index 137a47bd39..468136f7fe 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/SingleVariableDeclarationTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class SingleVariableDeclarationTest { [Fact] - [Obsolete] public async Task SingleVariableDeclaration() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs index 2ff5056b76..69f87bad1f 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/TypeParamNameTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer.Tests public sealed class TypeParamNameTest { [Fact] - [Obsolete] public async Task TypeParamName() { const string test = @" diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs index 2eaab24b01..351fb05d77 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/CSharpCodeFixVerifier`2.cs @@ -17,17 +17,16 @@ internal static class CSharpCodeFixVerifier where TAnalyzer : DiagnosticAnalyzer, new() where TCodeFix : CodeFixProvider, new() { - [System.Obsolete] public static DiagnosticResult Diagnostic() +#pragma warning disable CS0618 // Type or member is obsolete => CSharpCodeFixVerifier.Diagnostic(); - [System.Obsolete] public static DiagnosticResult Diagnostic(string diagnosticId) => CSharpCodeFixVerifier.Diagnostic(diagnosticId); - [System.Obsolete] public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) => CSharpCodeFixVerifier.Diagnostic(descriptor); +#pragma warning restore CS0618 // Type or member is obsolete public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) { From 4b73dea775816fe545184b536f4d46eb5e25ba73 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 19 May 2025 11:06:40 -0700 Subject: [PATCH 5/9] Centralize some suppressions in analyzers/generators --- .../Code/RelaxTestNamingTest.cs | 3 --- .../Microsoft.ML.CodeAnalyzer.Tests.csproj | 2 ++ .../Microsoft.ML.AutoML.SourceGenerator.csproj | 2 ++ .../SearchSpaceGenerator.cs | 1 - .../SweepableEstimatorFactoryGenerator.cs | 1 - .../SweepableEstimatorGenerator.cs | 1 - .../Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs | 1 - .../Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs | 1 - .../BestFriendOnPublicDeclarationsAnalyzer.cs | 1 - .../ContractsCheckAnalyzer.cs | 1 - .../InstanceInitializerAnalyzer.cs | 1 - .../Microsoft.ML.InternalCodeAnalyzer.csproj | 3 ++- tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs | 1 - .../ParameterVariableNameAnalyzer.cs | 1 - .../RelaxTestNamingSuppressor.cs | 1 - .../SingleVariableDeclarationAnalyzer.cs | 1 - .../Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs | 1 - 17 files changed, 6 insertions(+), 17 deletions(-) diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs index d5226d1840..c2b4c9dee4 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/RelaxTestNamingTest.cs @@ -100,9 +100,6 @@ public async Task TestMethodAsync() { } }.RunAsync(); } - [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1041:Compiler extensions should be implemented in assemblies targeting netstandard2.0", Justification = "")] - [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] - [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1036:Specify analyzer banned API enforcement setting", Justification = "")] [DiagnosticAnalyzer(LanguageNames.CSharp)] public class WarnForMissingAsyncSuffix : DiagnosticAnalyzer { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Microsoft.ML.CodeAnalyzer.Tests.csproj b/test/Microsoft.ML.CodeAnalyzer.Tests/Microsoft.ML.CodeAnalyzer.Tests.csproj index fe86711df0..7389303800 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Microsoft.ML.CodeAnalyzer.Tests.csproj +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Microsoft.ML.CodeAnalyzer.Tests.csproj @@ -3,6 +3,8 @@ false + + $(NoWarn);RS1036;RS1038;RS1041 diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/Microsoft.ML.AutoML.SourceGenerator.csproj b/tools-local/Microsoft.ML.AutoML.SourceGenerator/Microsoft.ML.AutoML.SourceGenerator.csproj index 575b12c03e..f514115703 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/Microsoft.ML.AutoML.SourceGenerator.csproj +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/Microsoft.ML.AutoML.SourceGenerator.csproj @@ -6,6 +6,8 @@ $(GetTargetPathDependsOn);GetDependencyTargetPaths false true + + $(NoWarn);RS1042 diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs index 9efa3c4cfd..5f47793993 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SearchSpaceGenerator.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SearchSpaceGenerator : ISourceGenerator { public void Execute(GeneratorExecutionContext context) diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs index f57ba8c2e3..5c569d1ae9 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorFactoryGenerator.cs @@ -13,7 +13,6 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SweepableEstimatorFactoryGenerator : ISourceGenerator { private const string className = "SweepableEstimatorFactory"; diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs index c829776878..88fcc97b5e 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/SweepableEstimatorGenerator.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class SweepableEstimatorGenerator : ISourceGenerator { private const string SweepableEstimatorAttributeDisplayName = Constant.CodeGeneratorNameSpace + "." + "SweepableEstimatorAttribute"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs index c4727d35d6..ab39be9a01 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BaseTestClassAnalyzer.cs @@ -11,7 +11,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BaseTestClassAnalyzer : DiagnosticAnalyzer { private const string Category = "Test"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs index 78d4e0dceb..9ec7e80ae0 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendAnalyzer.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BestFriendAnalyzer : DiagnosticAnalyzer { private const string Category = "Access"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs index 807ec1af4f..d44815c091 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/BestFriendOnPublicDeclarationsAnalyzer.cs @@ -11,7 +11,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class BestFriendOnPublicDeclarationsAnalyzer : DiagnosticAnalyzer { private const string Category = "Access"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs index e724473a1e..ef2bcdce78 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class ContractsCheckAnalyzer : DiagnosticAnalyzer { // Detecting that a syntax call is actually on a particular method is computationally diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs index c5d0c67d51..d678267558 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/InstanceInitializerAnalyzer.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class InstanceInitializerAnalyzer : DiagnosticAnalyzer { private const string Category = "Declaration"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj b/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj index 2e9f556792..01181e6507 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/Microsoft.ML.InternalCodeAnalyzer.csproj @@ -2,7 +2,8 @@ netstandard2.0 - true + + $(NoWarn);RS1036;RS1038 diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs index 45474db44a..cb1755d3ab 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/NameAnalyzer.cs @@ -22,7 +22,6 @@ internal enum NameType } [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class NameAnalyzer : DiagnosticAnalyzer { internal const string Category = "Naming"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs index 3d47d25fdc..d9b27dcfde 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ParameterVariableNameAnalyzer.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class ParameterVariableNameAnalyzer : DiagnosticAnalyzer { private const string Category = "Naming"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs index 5b85236a15..3f74d7ea12 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/RelaxTestNamingSuppressor.cs @@ -10,7 +10,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class RelaxTestNamingSuppressor : DiagnosticSuppressor { private const string Id = "MSML_RelaxTestNaming"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs index 3fac988bd5..d88d9dae98 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/SingleVariableDeclarationAnalyzer.cs @@ -12,7 +12,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class SingleVariableDeclarationAnalyzer : DiagnosticAnalyzer { private const string Category = "Declaration"; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs index bf2d4f30bf..6aa9895f32 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/TypeParamNameAnalyzer.cs @@ -11,7 +11,6 @@ namespace Microsoft.ML.InternalCodeAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1038:Compiler extensions should be implemented in assemblies with compiler-provided references", Justification = "")] public sealed class TypeParamNameAnalyzer : DiagnosticAnalyzer { private const string Category = "Naming"; From 4a171e8d87927381a6ecda131289956e503d44ca Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 19 May 2025 11:18:32 -0700 Subject: [PATCH 6/9] Remove a couple more suppressions --- test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs | 2 -- .../EstimatorTypeGenerator.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs index cb0a51821e..f7d5775fb0 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs @@ -149,12 +149,10 @@ public void masterBlaster() {} } "; -#pragma warning disable CS0612 // Type or member is obsolete var expected = new DiagnosticResult[] { VerifyCS.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(7, 11).WithArguments("CLASS"), VerifyCS.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(13, 21).WithArguments("masterBlaster"), }; -#pragma warning restore CS0612 // Type or member is obsolete await VerifyCS.VerifyAnalyzerAsync(source, expected); } diff --git a/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs b/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs index de08c2cb90..600765031f 100644 --- a/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs +++ b/tools-local/Microsoft.ML.AutoML.SourceGenerator/EstimatorTypeGenerator.cs @@ -15,7 +15,6 @@ namespace Microsoft.ML.AutoML.SourceGenerator { [Generator] - [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCompatibility", "RS1042:Implementations of this interface are not allowed", Justification = "")] public sealed class EstimatorTypeGenerator : ISourceGenerator { private const string className = "EstimatorType"; From 87fa9856016ee41cbc0a42a1e83a2ac83042f052 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 19 May 2025 14:58:50 -0700 Subject: [PATCH 7/9] Update .NET runtime versions --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 5bfaba4322..039f8a17c3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -89,8 +89,8 @@ 6.0.0 4.20.70 0.13.12 - 6.0.26 - 8.0.1 + 6.0.36 + 8.0.16 8.1.0 1.1.2 9.0.0-beta.24212.4 From 52dc3ec8c05a82b73f290b5229dbe603ed30b61b Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 20 May 2025 11:46:50 -0700 Subject: [PATCH 8/9] Update OnnxRuntime 1.22.0 --- eng/Versions.props | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 039f8a17c3..ca5dabb9de 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,7 @@ 3.11.0 4.13.0 1.0.0-beta.25177.1 - 1.21.0 - 1.21.2 + 1.22.0 0.0.0.12 9.4.0-preview.1.25207.5 From 4f6bd4952486a50c8ebdea66ae1974e8a700d08a Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 20 May 2025 13:40:22 -0700 Subject: [PATCH 9/9] Roll back to OnnxRuntime 1.20.0 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index ca5dabb9de..ae0050be84 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,7 +44,7 @@ 3.11.0 4.13.0 1.0.0-beta.25177.1 - 1.22.0 + 1.20.0 0.0.0.12 9.4.0-preview.1.25207.5