Skip to content

Remove ModelFactoryAnalyzer (AZC0035) - migrated to azure-sdk-for-net#15884

Merged
m-nash merged 1 commit into
Azure:mainfrom
m-nash:remove/azc0035-analyzer
Jun 4, 2026
Merged

Remove ModelFactoryAnalyzer (AZC0035) - migrated to azure-sdk-for-net#15884
m-nash merged 1 commit into
Azure:mainfrom
m-nash:remove/azc0035-analyzer

Conversation

@m-nash
Copy link
Copy Markdown
Member

@m-nash m-nash commented Jun 3, 2026

Removes the ModelFactoryAnalyzer (AZC0035) from this repo. The analyzer was migrated to Azure/azure-sdk-for-net (sdk/tools/Azure.SdkAnalyzers) in azure-sdk-for-net#59647, which also fixed an AZC0035 false-positive on output models defined in external assemblies. With both copies installed, AZC0035 was firing twice on every Azure SDK build.

Changes

  • Delete src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelFactoryAnalyzer.cs
  • Delete src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0035Tests.cs
  • Remove the AZC0035 DiagnosticDescriptor from Descriptors.cs

Left intact

  • src/dotnet/ErrorAnalyzers/src/Azure.Tools.ErrorAnalyzers/AnalyzerPrompts.Client.cs — text-only AI-agent prompt template keyed on the diagnostic ID. AZC0035 is still emitted (from azure-sdk-for-net's analyzer), so the prompt remains valid.

APIView dependency check

Searched tools/apiview for any reference to AZC0035 — none found. APIView does not consume this analyzer, so no new package needs to be published from azure-sdk-for-net.

Validation

dotnet test on Azure.ClientSdk.Analyzers.sln: 391/391 passing on net472 + net8.0.

The ModelFactoryAnalyzer was migrated to Azure/azure-sdk-for-net (sdk/tools/Azure.SdkAnalyzers) in PR #59647, which also fixed an AZC0035 false-positive on output models from external assemblies. Removing the duplicate analyzer here so AZC0035 only fires from one source. APIView does not depend on AZC0035.

- Delete ModelFactoryAnalyzer.cs and AZC0035Tests.cs
- Remove AZC0035 DiagnosticDescriptor from Descriptors.cs
- AnalyzerPrompts.Client.cs reference to AZC0035 retained (text-only prompt template; diagnostic still emitted by azure-sdk-for-net's analyzer)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 23:50
@m-nash m-nash requested review from a team and jsquire as code owners June 3, 2026 23:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the duplicated ModelFactoryAnalyzer implementation for AZC0035 from azure-sdk-tools now that the rule has been migrated to azure-sdk-for-net (Azure.SdkAnalyzers). This prevents AZC0035 from being reported twice when both analyzer sources are present in Azure SDK builds.

Changes:

  • Deleted ModelFactoryAnalyzer (AZC0035) implementation from Azure.ClientSdk.Analyzers.
  • Deleted the AZC0035 unit tests that targeted the removed analyzer.
  • Removed the AZC0035 DiagnosticDescriptor from Descriptors.cs to keep the analyzer catalog consistent.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelFactoryAnalyzer.cs Removed the in-repo implementation of the AZC0035 analyzer (now owned by azure-sdk-for-net).
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs Removed the AZC0035 descriptor entry from the analyzers’ descriptor registry.
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0035Tests.cs Removed tests that specifically validated the deleted AZC0035 analyzer.

@m-nash m-nash merged commit 3ac4e76 into Azure:main Jun 4, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants