From 64361e43226d7f1daa124b6c5507f11e1e49690f Mon Sep 17 00:00:00 2001 From: Pan Shao Date: Wed, 19 Jun 2024 16:09:01 +0800 Subject: [PATCH 1/3] Remove AZC0006 and AZC0007 --- .../src/Azure.Verticals.AgriFood.Farming.csproj | 2 +- .../Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs | 3 --- .../Azure.Developer.DevCenter/src/GlobalSuppressions.cs | 2 -- .../src/Properties/AssemblyInfo.cs | 1 - .../Azure.Messaging.EventHubs/src/Properties/AssemblyInfo.cs | 1 - .../Azure.Search.Documents/src/Azure.Search.Documents.csproj | 2 +- .../Azure.Search.Documents/src/Indexes/SearchIndexClient.cs | 1 - .../Azure.Search.Documents/src/Indexes/SearchIndexerClient.cs | 1 - sdk/search/Azure.Search.Documents/src/SearchClient.cs | 1 - .../Azure.Messaging.ServiceBus/Directory.Build.props | 2 -- .../Azure.Messaging.ServiceBus/src/Properties/AssemblyInfo.cs | 1 - 11 files changed, 2 insertions(+), 15 deletions(-) diff --git a/sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Azure.Verticals.AgriFood.Farming.csproj b/sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Azure.Verticals.AgriFood.Farming.csproj index dba7365ae142..43105391ff66 100644 --- a/sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Azure.Verticals.AgriFood.Farming.csproj +++ b/sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Azure.Verticals.AgriFood.Farming.csproj @@ -5,7 +5,7 @@ 1.0.0-beta.2 Azure FarmBeats $(RequiredTargetFrameworks) - $(NoWarn);AZC0012;AZC0007;AZC0006 + $(NoWarn);AZC0012 $(DefineConstants);EXPERIMENTAL true diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs index 9f553868ea30..cb4f52ab2e07 100644 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs @@ -2,6 +2,3 @@ // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0007: A client type should have a public constructor with equivalent parameters that doesn't take a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0006: A client type should have a public constructor with equivalent parameters that takes a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")] diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs index 9d3acf89871a..c75c5faae707 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs @@ -3,7 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "False positives on minimal constructors", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] -[assembly: SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "False positives on options constructors", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] [assembly: SuppressMessage("Usage", "AZC0031: Model name 'EnvironmentDefinition' ends with 'Definition'. Suggest to rename it to an appropriate name.", Justification = "Environment Definition is a Deployment Environment concept", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] [assembly: SuppressMessage("Usage", "AZC0030: Model name 'EnvironmentDefinitionParameter' ends with 'Parameter'. Suggest to rename it to 'EnvironmentDefinitionContent' or 'EnvironmentDefinitionPatch' or any other appropriate name.", Justification = "Environment Definition Parameter is a Deployment Environment concept", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Properties/AssemblyInfo.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Properties/AssemblyInfo.cs index a8d20fb985d7..c886fd4c8c17 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Properties/AssemblyInfo.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Properties/AssemblyInfo.cs @@ -9,5 +9,4 @@ [assembly: SuppressMessage("Usage", "AZC0004:DO provide both asynchronous and synchronous variants for all service methods.", Justification = "As an AMQP-based offering, Event Hubs has been exempted from providing a synchronous surface.")] [assembly: SuppressMessage("Usage", "AZC0008:ClientOptions should have a nested enum called ServiceVersion", Justification = "The Event Hubs interface does not support the concept of versions.")] -[assembly: SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Analysis is flagging incorrectly. The Event Hubs constructor patterns adhere to guidance and have obtained board approval.")] [assembly: SuppressMessage("Usage", "AZC0015:Unexpected client method return type.", Justification = "As an AMQP-based offering, Event Hubs has been exempted from HTTP-based return types.")] diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Properties/AssemblyInfo.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Properties/AssemblyInfo.cs index e202a207fc40..7b65ffce0c45 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Properties/AssemblyInfo.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Properties/AssemblyInfo.cs @@ -9,5 +9,4 @@ [assembly: SuppressMessage("Usage", "AZC0004:DO provide both asynchronous and synchronous variants for all service methods.", Justification = "As an AMQP-based offering, Event Hubs has been exempted from providing a synchronous surface.")] [assembly: SuppressMessage("Usage", "AZC0008:ClientOptions should have a nested enum called ServiceVersion", Justification = "The Event Hubs interface does not support the concept of versions.")] -[assembly: SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Analysis is flagging incorrectly. The Event Hubs constructor patterns adhere to guidance and have obtained board approval.")] [assembly: SuppressMessage("Usage", "AZC0015:Unexpected client method return type.", Justification = "As an AMQP-based offering, Event Hubs has been exempted from HTTP-based return types.")] diff --git a/sdk/search/Azure.Search.Documents/src/Azure.Search.Documents.csproj b/sdk/search/Azure.Search.Documents/src/Azure.Search.Documents.csproj index abe7f2860d3f..93d233bb99bc 100644 --- a/sdk/search/Azure.Search.Documents/src/Azure.Search.Documents.csproj +++ b/sdk/search/Azure.Search.Documents/src/Azure.Search.Documents.csproj @@ -14,7 +14,7 @@ true $(RequiredTargetFrameworks) - $(NoWarn);AZC0007;AZC0004 + $(NoWarn);AZC0004 true diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexClient.cs b/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexClient.cs index 7ec0d0d9aced..52a3d6de4ce1 100644 --- a/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexClient.cs @@ -121,7 +121,6 @@ public SearchIndexClient( /// Client configuration options for connecting to Azure Cognitive Search. /// Thrown when the or is null. /// Thrown when the is not using HTTPS. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Avoid ambiguous method definition")] public SearchIndexClient( Uri endpoint, TokenCredential tokenCredential, diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexerClient.cs b/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexerClient.cs index 856869331e9e..ca68395ea1a5 100644 --- a/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexerClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Indexes/SearchIndexerClient.cs @@ -119,7 +119,6 @@ public SearchIndexerClient( /// Client configuration options for connecting to Azure Cognitive Search. /// Thrown when the or is null. /// Thrown when the is not using HTTPS. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Avoid ambiguous method definition")] public SearchIndexerClient( Uri endpoint, TokenCredential tokenCredential, diff --git a/sdk/search/Azure.Search.Documents/src/SearchClient.cs b/sdk/search/Azure.Search.Documents/src/SearchClient.cs index 964524b642ae..3177a6e99568 100644 --- a/sdk/search/Azure.Search.Documents/src/SearchClient.cs +++ b/sdk/search/Azure.Search.Documents/src/SearchClient.cs @@ -240,7 +240,6 @@ public SearchClient( /// Thrown when the is not using HTTPS or /// the is empty. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Avoid ambiguous method definition")] public SearchClient( Uri endpoint, string indexName, diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props index 03647177e773..4155bb929372 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props @@ -10,8 +10,6 @@ --> $(NoWarn); - AZC0006; - AZC0007; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Properties/AssemblyInfo.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Properties/AssemblyInfo.cs index 39fbb62fd0a7..fe09eff0d78d 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Properties/AssemblyInfo.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Properties/AssemblyInfo.cs @@ -9,6 +9,5 @@ [assembly: SuppressMessage("Usage", "AZC0004:DO provide both asynchronous and synchronous variants for all service methods.", Justification = "As an AMQP-based offering, Service Bus has been exempted from providing a synchronous surface.")] [assembly: SuppressMessage("Usage", "AZC0008:ClientOptions should have a nested enum called ServiceVersion", Justification = "The Service Bus interface does not support the concept of versions.")] -[assembly: SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "Analysis is flagging incorrectly. The Service Bus constructor patterns adhere to guidance and have obtained board approval.")] [assembly: SuppressMessage("Usage", "AZC0015:Unexpected client method return type.", Justification = "As an AMQP-based offering, Service Bus has been exempted from HTTP-based return types.")] [assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.ServiceBus")] From cb5593e92a5e4a1641806892efeebe4be189621d Mon Sep 17 00:00:00 2001 From: Pan Shao Date: Thu, 20 Jun 2024 10:03:57 +0800 Subject: [PATCH 2/3] update --- sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props index 4155bb929372..148a6dfa9ce1 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props @@ -9,6 +9,7 @@ These analyzers are blocked by https://github.com/Azure/azure-sdk-tools/issues/127 --> + AZC0007; $(NoWarn); From f818bcd1b81a8561fcfacf6cff7e8497227dc0c4 Mon Sep 17 00:00:00 2001 From: Pan Shao Date: Fri, 21 Jun 2024 12:51:12 +0800 Subject: [PATCH 3/3] update --- .../Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs | 4 ---- .../Azure.Messaging.ServiceBus/Directory.Build.props | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs deleted file mode 100644 index cb4f52ab2e07..000000000000 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props index 148a6dfa9ce1..fd20707be0b8 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/Directory.Build.props @@ -9,8 +9,8 @@ These analyzers are blocked by https://github.com/Azure/azure-sdk-tools/issues/127 --> - AZC0007; $(NoWarn); + AZC0007;