Skip to content

Commit 9728c2a

Browse files
authored
[EngSys] Update Analyzers version (Azure#51232)
* [EngSys] Update Analyzers version The focus of these changes is to update the Azure analyzers to the latest version, which refines messages and naming suggestions. Included are AZC0034 (Duplicate type names) and AZC0035 (Missing model factory methods) which had been previously added but were never released. A number of temporary suppressions have been added to allow the analyzers to be present without causing build failures. GitHub issues have been created to track the work of fixing the underlying causes. * Exporting API to fix pipeline failures * More fixes
1 parent 7c732ae commit 9728c2a

61 files changed

Lines changed: 185 additions & 46 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eng/Directory.Build.Common.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@
124124
AZC0012; <!-- Single word class names -->
125125
AZC0008;
126126
SCM0005; <!-- Resources currently do not have a parameterless ctor so builders cannot be created for them -->
127+
128+
<!--
129+
Temporarily disable warnings from new analyzers:
130+
AZC0034: Typename is already used in another library.
131+
AZC0035: Missing model factory method
132+
133+
Tracked by # 51312
134+
-->
135+
AZC0034;
136+
AZC0035;
127137
</NoWarn>
128138
</PropertyGroup>
129139

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
-->
295295
<ItemGroup>
296296
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20250728.3" PrivateAssets="All" />
297-
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20250422.1" PrivateAssets="All" />
297+
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20250715.1" PrivateAssets="All" />
298298
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
299299
<!-- Note: Upgrading the .NET SDK version needs to be synchronized with the autorest.csharp repository -->
300300
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="All"/>

eng/globalconfigs/disable_enhanced_analysis.globalconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ dotnet_diagnostic.AZC0030.severity = none
66
dotnet_diagnostic.AZC0031.severity = none
77
dotnet_diagnostic.AZC0032.severity = none
88
dotnet_diagnostic.AZC0033.severity = none
9+
dotnet_diagnostic.AZC0034.severity = none
10+
dotnet_diagnostic.AZC0036.severity = none

sdk/ai/Azure.AI.Inference/src/Azure.AI.Inference.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Version>1.0.0-beta.6</Version>
66
<PackageTags>Azure Inference</PackageTags>
77
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
8-
<NoWarn>$(NoWarn);CS1591;AZC0030;AZC0031</NoWarn>
8+
<NoWarn>$(NoWarn);CS1591;AZC0030;AZC0031;AZC0035;AZC0034</NoWarn>
99
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
1010
</PropertyGroup>
1111

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public partial class AIProjectClient : System.ClientModel.Primitives.ClientConne
9090
protected AIProjectClient() : base (default(int)) { }
9191
public AIProjectClient(System.Uri endpoint, Azure.Core.TokenCredential credential = null) : base (default(int)) { }
9292
public AIProjectClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Projects.AIProjectClientOptions options) : base (default(int)) { }
93-
public Azure.AI.Projects.Connections Connections { get { throw null; } }
94-
public Azure.AI.Projects.Datasets Datasets { get { throw null; } }
95-
public Azure.AI.Projects.Deployments Deployments { get { throw null; } }
96-
public Azure.AI.Projects.Evaluations Evaluations { get { throw null; } }
97-
public Azure.AI.Projects.Indexes Indexes { get { throw null; } }
93+
public virtual Azure.AI.Projects.Connections Connections { get { throw null; } }
94+
public virtual Azure.AI.Projects.Datasets Datasets { get { throw null; } }
95+
public virtual Azure.AI.Projects.Deployments Deployments { get { throw null; } }
96+
public virtual Azure.AI.Projects.Evaluations Evaluations { get { throw null; } }
97+
public virtual Azure.AI.Projects.Indexes Indexes { get { throw null; } }
9898
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
99-
public Azure.AI.Projects.Telemetry Telemetry { get { throw null; } }
99+
public virtual Azure.AI.Projects.Telemetry Telemetry { get { throw null; } }
100100
public override System.Collections.Generic.IEnumerable<System.ClientModel.Primitives.ClientConnection> GetAllConnections() { throw null; }
101101
public OpenAI.Chat.ChatClient GetAzureOpenAIChatClient(string? connectionName = null, string? apiVersion = null, string? deploymentName = null) { throw null; }
102102
public OpenAI.Embeddings.EmbeddingClient GetAzureOpenAIEmbeddingClient(string? connectionName = null, string? apiVersion = null, string? deploymentName = null) { throw null; }

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public partial class AIProjectClient : System.ClientModel.Primitives.ClientConne
9090
protected AIProjectClient() : base (default(int)) { }
9191
public AIProjectClient(System.Uri endpoint, Azure.Core.TokenCredential credential = null) : base (default(int)) { }
9292
public AIProjectClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Projects.AIProjectClientOptions options) : base (default(int)) { }
93-
public Azure.AI.Projects.Connections Connections { get { throw null; } }
94-
public Azure.AI.Projects.Datasets Datasets { get { throw null; } }
95-
public Azure.AI.Projects.Deployments Deployments { get { throw null; } }
96-
public Azure.AI.Projects.Evaluations Evaluations { get { throw null; } }
97-
public Azure.AI.Projects.Indexes Indexes { get { throw null; } }
93+
public virtual Azure.AI.Projects.Connections Connections { get { throw null; } }
94+
public virtual Azure.AI.Projects.Datasets Datasets { get { throw null; } }
95+
public virtual Azure.AI.Projects.Deployments Deployments { get { throw null; } }
96+
public virtual Azure.AI.Projects.Evaluations Evaluations { get { throw null; } }
97+
public virtual Azure.AI.Projects.Indexes Indexes { get { throw null; } }
9898
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
99-
public Azure.AI.Projects.Telemetry Telemetry { get { throw null; } }
99+
public virtual Azure.AI.Projects.Telemetry Telemetry { get { throw null; } }
100100
public override System.Collections.Generic.IEnumerable<System.ClientModel.Primitives.ClientConnection> GetAllConnections() { throw null; }
101101
public OpenAI.Chat.ChatClient GetAzureOpenAIChatClient(string? connectionName = null, string? apiVersion = null, string? deploymentName = null) { throw null; }
102102
public OpenAI.Embeddings.EmbeddingClient GetAzureOpenAIEmbeddingClient(string? connectionName = null, string? apiVersion = null, string? deploymentName = null) { throw null; }

sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@
77
<DisableEnhancedAnalysis>true</DisableEnhancedAnalysis>
88
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
99
<GenerateAPIListing>true</GenerateAPIListing>
10-
<NoWarn>$(NoWarn);CS1591;AZC0012;SA1649;SA1402;</NoWarn>
10+
<LangVersion>latest</LangVersion>
11+
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<NoWarn>
16+
$(NoWarn);
17+
CS1591;
18+
AZC0012;
19+
SA1649;
20+
SA1402;
21+
AZC0035; <!-- Missing model factory methods. #51265-->
22+
</NoWarn>
1123
<!--
1224
Suppression of OPENAI001 handles temporary [Experimental] leakage from OpenAI library internals for generated MRWContext.
1325
The longer-term fix is tracked along with:
1426
- https://github.com/Azure/azure-sdk-for-net/issues/51256
1527
- https://github.com/Azure/autorest.csharp/issues/5364
1628
-->
1729
<NoWarn>$(NoWarn);OPENAI001;</NoWarn>
18-
<LangVersion>latest</LangVersion>
19-
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
2030
</PropertyGroup>
2131

2232
<ItemGroup>

sdk/attestation/Azure.Security.Attestation/src/Azure.Security.Attestation.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<DisableEnhancedAnalysis>true</DisableEnhancedAnalysis>
1010
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
1111
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
12+
<NoWarn>$(NoWarn);AZC0035</NoWarn>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

sdk/batch/Azure.Compute.Batch/src/Azure.Compute.Batch.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<PackageTags>Azure.Compute.Batch</PackageTags>
77
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
88
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
9+
<NoWarn>$(NoWarn);AZC0034;AZC0035</NoWarn>
910
</PropertyGroup>
1011

1112
<ItemGroup>

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Azure.AI.Language.Conversations.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PackageTags>Azure AI Language Conversations</PackageTags>
99
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
1010
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
11+
<NoWarn>$(NoWarn);AZC0034;AZC0035</NoWarn>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

0 commit comments

Comments
 (0)