Skip to content

Fix various analyzer errors#9518

Merged
glen-84 merged 1 commit intomainfrom
gai/fix-analyzer-errors
Apr 9, 2026
Merged

Fix various analyzer errors#9518
glen-84 merged 1 commit intomainfrom
gai/fix-analyzer-errors

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Apr 9, 2026

Summary of the changes (Less than 80 chars)

  • Fix various analyzer errors.

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

Fixes a collection of analyzer/style issues across Nitro CommandLine, HotChocolate Fusion, and Mocha projects to reduce warnings and keep code consistent with configured conventions.

Changes:

  • Remove unused using directives and redundant casts across multiple test and source files.
  • Apply naming/style fixes (e.g., s_-prefixed static fields, const naming, formatting) and adopt collection expressions where applicable.
  • Simplify Nitro client API creation by passing ApiKind? directly (removing a now-redundant mapping helper).

Reviewed changes

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

Show a summary per file
File Description
src/Nitro/CommandLine/test/CommandLine.Tests/MockErrorFactory.cs Simplifies mock setup by removing redundant casting and uses collection expressions.
src/Nitro/CommandLine/test/CommandLine.Tests/HttpClient/NitroClientRegistrationTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Workspaces/WorkspacesCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Workspaces/SetDefaultWorkspaceCommandTests.cs Updates mock field usage to renamed session service mock.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Workspaces/CreateWorkspaceCommandTests.cs Updates mock field usage to renamed session service mock.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Stages/EditStagesCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Stages/DeleteStageCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Session/SessionCommandTestBase.cs Updates session service mock usage and removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Schemas/PublishSchemaCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/PersonalAccessTokens/PersonalAccessTokensCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/PersonalAccessTokens/ListPersonalAccessTokenCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/ValidateOpenApiCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/PublishOpenApiCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/OpenApiCommandTestBase.cs Const naming cleanup and removes unused static import.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mocks/UpdateMockCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mocks/MocksCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mocks/CreateMockCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/ValidateMcpFeatureCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/UploadMcpFeatureCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/PublishMcpFeatureCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/McpCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/DeleteMcpFeatureCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/CreateMcpFeatureCollectionCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishValidateCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishCommitCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Environments/EnvironmentsCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/CommandTestBase.cs Renames session service mock field and updates DI replacement wiring.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/ValidateClientCommandTests.cs Removes unused usings.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/PublishClientCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/DeleteClientCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/CreateClientCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/ClientsCommandTestBase.cs Removes unused using and static import.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/SetApiSettingsCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/ListApiCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/DeleteApiCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/CreateApiCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/ApisCommandTestBase.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/ApiKeys/DeleteApiKeyCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/ApiKeys/CreateApiKeyCommandTests.cs Removes unused using.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/ApiKeys/ApiKeysCommandTestBase.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/ThrowHelper.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Services/Configuration/ConfigService.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Options/OptionalOutputFormatOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Helpers/ExamplesHelpAction.cs Renames static field to s_ prefix and updates execution context access.
src/Nitro/CommandLine/src/CommandLine/Helpers/CommandExecutionContext.cs Renames AsyncLocal field to s_services.
src/Nitro/CommandLine/src/CommandLine/Extensions/ServiceCollectionExtensions.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Extensions/RootCommandExtensions.cs Updates to renamed execution context field.
src/Nitro/CommandLine/src/CommandLine/Extensions/OptionExtensions.cs Updates to renamed execution context field and removes unused using.
src/Nitro/CommandLine/src/CommandLine/Extensions/NitroConsoleExtensions.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Extensions/CommandExtensions.cs Updates to renamed execution context field.
src/Nitro/CommandLine/src/CommandLine/Commands/Workspaces/ShowWorkspaceCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Workspaces/ListWorkspaceCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Stages/ListStagesCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Stages/EditStagesCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Stages/DeleteStageCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/UploadSchemaCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/SchemaHelpers.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/PersonalAccessTokens/RevokePersonalAccessTokenCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/PersonalAccessTokens/Options/PersonalAccessTokenDescriptionOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/PersonalAccessTokens/ListPersonalAccessTokenCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/PersonalAccessTokens/CreatePersonalAccessTokenCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/PublishOpenApiCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/Options/OpenApiCollectionNameOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/Options/OpenApiCollectionIdOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/ListOpenApiCollectionCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/DeleteOpenApiCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mocks/UpdateMockCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mocks/ListMockCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mocks/CreateMockCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/UploadMcpFeatureCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/Options/McpFeatureCollectionNameOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/Options/McpFeatureCollectionIdOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/McpFeatureCollectionHelpers.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/ListMcpFeatureCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/DeleteMcpFeatureCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/CreateMcpFeatureCollectionCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Login/LoginCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishStartCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishingState.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishBeginCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionUploadCommand.cs Removes unused usings and aliases.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionRunCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionMigrationHelpers.cs Renames static options field to s_ prefix.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionDownloadCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Environments/ShowEnvironmentCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Environments/ListEnvironmentCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Environments/CreateEnvironmentCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/UnpublishClientCommand.cs Removes unused static import.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/ShowClientCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/PublishClientCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/Options/ClientTagsToUnpublishOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/Options/ClientNameOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/ListClientVersionsCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/ListClientPublishedVersionsCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/ListClientCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DownloadClientCommand.cs Removes unused static import.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DeleteClientCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Clients/CreateClientCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/ShowApiCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/SetApiSettingsCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Options/TreatDangerousAsBreakingOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Options/ApiPathOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Options/ApiNameOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Options/ApiKindOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Options/AllowBreakingSchemaChangesOption.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/ListApiCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/DeleteApiCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/Apis/CreateApiCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/ApiKeys/ListApiKeyCommand.cs Removes unused usings.
src/Nitro/CommandLine/src/CommandLine/Commands/ApiKeys/DeleteApiKeyCommand.cs Removes unused using.
src/Nitro/CommandLine/src/CommandLine/Commands/ApiKeys/CreateApiKeyCommand.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Workspaces/WorkspacesClient.cs Removes redundant self/namespace usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Workspaces/IWorkspacesClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Stages/StagesClient.cs Removes redundant self/namespace usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Schemas/ISchemasClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/PersonalAccessTokens/PersonalAccessTokensClient.cs Removes redundant self/namespace usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/PersonalAccessTokens/IPersonalAccessTokensClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/OpenApi/OpenApiClient.cs Removes redundant self/namespace usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Mocks/MocksClient.cs Removes redundant usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Mocks/IMocksClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Mcp/McpClient.cs Removes redundant self/namespace usings.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Environments/IEnvironmentsClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Environments/EnvironmentsClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Clients/IClientsClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Apis/IApisClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/Apis/ApisClient.cs Removes redundant ApiKind mapping helper and passes kind directly.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/ApiKeys/IApiKeysClient.cs Removes unused using.
src/Nitro/CommandLine/src/ChilliCream.Nitro.Client/ApiKeys/ApiKeysClient.cs Removes unused using.
src/Mocha/test/Mocha.Transport.InMemory.Tests/Behaviors/RedeliveryTests.cs Removes unused using.
src/Mocha/src/Mocha.EntityFrameworkCore.Postgres/Scheduling/ScheduledMessageDispatcher.cs Expands rollback try/catch for analyzer/style compliance.
src/Mocha/src/Mocha.EntityFrameworkCore.Postgres/Outbox/OutboxProcessor.cs Expands rollback try/catch for analyzer/style compliance.
src/HotChocolate/Utilities/src/Utilities.Buffers/ChunkedArrayWriter.cs Adds targeted pragma to avoid IDE suggestion incompatible with netstandard2.0.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Transport/Http/DefaultGraphQLHttpClientTests.cs Minor style updates (var in loops, collection expression spacing).
src/HotChocolate/Fusion/test/Fusion.Caching.Tests/FusionCachingTests.cs Normalizes using directives and alias placement.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FileUploadTests.cs Fixes minor formatting in object initializer.
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs Replaces ImmutableStack.Empty assignment with collection expression.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/PathUtilities.cs Renames static field to s_ prefix and updates usage.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/SourceSchemaHttpClient.cs Removes unused using and formats object initializer properties.
src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/DependencyInjection/InMemoryFusionGatewayBuilderExtensions.cs Removes unused using.
src/HotChocolate/AspNetCore/test/Transport.Http.Tests/RequestDeduplicationHandlerTests.cs Uses collection initializer syntax for multipart content to satisfy analyzers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glen-84 glen-84 merged commit 1be748d into main Apr 9, 2026
132 checks passed
@glen-84 glen-84 deleted the gai/fix-analyzer-errors branch April 9, 2026 15:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (6bac912) to head (a0c16d7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #9518   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants