Remove ModelFactoryAnalyzer (AZC0035) - migrated to azure-sdk-for-net#15884
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 fromAzure.ClientSdk.Analyzers. - Deleted the AZC0035 unit tests that targeted the removed analyzer.
- Removed the AZC0035
DiagnosticDescriptorfromDescriptors.csto 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. |
jsquire
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the
ModelFactoryAnalyzer(AZC0035) from this repo. The analyzer was migrated toAzure/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
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelFactoryAnalyzer.cssrc/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0035Tests.csAZC0035DiagnosticDescriptorfromDescriptors.csLeft 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/apiviewfor 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 testonAzure.ClientSdk.Analyzers.sln: 391/391 passing on net472 + net8.0.