Skip to content

Cleanup style: unused usings and file-scoped namespaces - #53491

Merged
tmat merged 2 commits into
dotnet:release/10.0.3xxfrom
tmat:StyleCleanup
Mar 18, 2026
Merged

tmat merged 2 commits into
dotnet:release/10.0.3xxfrom
tmat:StyleCleanup

Conversation

@tmat

@tmat tmat commented Mar 16, 2026

Copy link
Copy Markdown
Member

No description provided.

@tmat
tmat marked this pull request as ready for review March 17, 2026 19:05
@tmat
tmat requested a review from a team as a code owner March 17, 2026 19:05
Copilot AI review requested due to automatic review settings March 17, 2026 19:05
@tmat

tmat commented Mar 17, 2026

Copy link
Copy Markdown
Member Author

@DustinCampbell ptal

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 standardizes style across dotnet-watch (and related test utilities) by removing unused using directives and converting many C# files to file-scoped namespaces, reducing indentation and improving consistency.

Changes:

  • Removed unused using directives across watch, middleware, Hot Reload, and test projects.
  • Converted many files from block-scoped to file-scoped namespaces and flattened type nesting/indentation.
  • Updated sdk.slnx organization to place dotnet-format under a dedicated /src/Dotnet.Format/ folder.

Reviewed changes

Copilot reviewed 89 out of 89 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/dotnet-watch.Tests/Web/RSATests.cs Removes unused using directives.
test/dotnet-watch.Tests/Watch/NoRestoreTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/Watch/GlobbingAppTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/Watch/FileUpdateTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/Watch/BuildEvaluatorTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/TestUtilities/TestReporter.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/TestUtilities/TestConsole.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/TestUtilities/TaskExtensions.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/TestUtilities/DotNetWatchTestBase.cs Removes unused using directives.
test/dotnet-watch.Tests/HotReload/TerminationTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/HotReload/SourceFileUpdateTests.HotReloadNotSupported.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/HotReload/MetadataUpdateHandlerTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/HotReload/MauiHotReloadTests.cs Converts to file-scoped namespace; removes unused using.
test/dotnet-watch.Tests/HotReload/LoggingTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/HotReload/BuildProjectsTests.cs Removes unused using directives.
test/dotnet-watch.Tests/ConsoleReporterTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/CommandLine/SubcommandTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/CommandLine/ProgramTests.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/CommandLine/ProgramTests.HostArguments.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/CommandLine/ProgramTests.Arguments.cs Converts to file-scoped namespace; formatting/indentation cleanup.
test/dotnet-watch.Tests/CommandLine/LaunchSettingsTests.cs Converts to file-scoped namespace; removes unused using.
test/dotnet-watch-test-browser/Program.cs Removes unused using directives.
src/Dotnet.Watch/dotnet-watch/Watch/StaticFileHandler.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/dotnet-watch/Watch/MsBuildFileSetFactory.cs Converts to file-scoped namespace; removes unused using directives; formatting cleanup.
src/Dotnet.Watch/dotnet-watch/Watch/MSBuildFileSetResult.cs Converts to file-scoped namespace; flattens nested types into top-level internal types.
src/Dotnet.Watch/dotnet-watch/Watch/DotNetWatcher.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/dotnet-watch/Watch/BuildEvaluator.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Web.Middleware/ResponseStreamWrapper.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Web.Middleware/HostingStartup.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Web.Middleware/BrowserScriptMiddleware.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Web.Middleware/BlazorWasmHotReloadMiddleware.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Web.Middleware/ApplicationPaths.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Utilities/ProcessUtilities.cs Removes unused using directives.
src/Dotnet.Watch/Watch/UI/TargetFrameworkSelectionPrompt.cs Removes unused using directives.
src/Dotnet.Watch/Watch/UI/RestartPrompt.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs Converts to file-scoped namespace; removes unused using directives; formatting cleanup.
src/Dotnet.Watch/Watch/UI/IConsole.cs Removes outdated infrastructure comment.
src/Dotnet.Watch/Watch/UI/ConsoleReporter.cs Converts to file-scoped namespace; removes outdated infrastructure comment; formatting cleanup.
src/Dotnet.Watch/Watch/UI/ConsoleInputReader.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Process/RunningProject.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Process/ProjectLauncher.cs Removes unused using directives.
src/Dotnet.Watch/Watch/Process/ProcessSpec.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Process/ProcessLaunchResult.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Process/LaunchSettingsProfile.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Process/IRuntimeProcessLauncherFactory.cs Removes unused using directives.
src/Dotnet.Watch/Watch/HotReload/HotReloadProjectUpdatesBuilder.cs Removes unused using directives.
src/Dotnet.Watch/Watch/FileWatcher/PollingDirectoryWatcher.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/FileWatcher/EventBasedDirectoryWatcher.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Context/EnvironmentOptions.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Context/DotNetWatchContext.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Build/ProjectGraphUtilities.cs Removes unused using directives.
src/Dotnet.Watch/Watch/Build/LoadedProjectGraph.cs Converts to file-scoped namespace; removes unused using directives; formatting cleanup.
src/Dotnet.Watch/Watch/Build/FileItem.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/Watch/Browser/BrowserRefreshServerFactory.cs Removes unused using directives.
src/Dotnet.Watch/Watch/Browser/BrowserLauncher.cs Removes unused using directives.
src/Dotnet.Watch/Watch.Aspire/Server/WatchStatusEvent.cs Removes unused using directives.
src/Dotnet.Watch/Watch.Aspire/Server/WatchControlReader.cs Removes unused using directives.
src/Dotnet.Watch/Watch.Aspire/Program.cs Removes unused using directives.
src/Dotnet.Watch/Watch.Aspire/Host/AspireHostLauncher.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/Web/WebAssemblyHotReloadClient.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/HotReloadClient/Web/StaticWebAsset.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/Web/AbstractBrowserRefreshServer.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/Utilities/ResponseFunc.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/Utilities/PathExtensions.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/Logging/LogEvents.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadClient/HotReloadClients.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadAgent/MetadataUpdateHandlerInvoker.cs Removes unused using directives.
src/Dotnet.Watch/HotReloadAgent.WebAssembly.Browser/WebAssemblyHotReload.cs Removes unused using directives.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/RequiredMemberAttribute.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/IsExternalInit.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/CompilerFeatureRequiredAttribute.cs Converts to file-scoped namespace; formatting/indentation cleanup.
src/Dotnet.Watch/DotNetWatchTasks/FileSetSerializer.cs Converts to file-scoped namespace; formatting/indentation cleanup.
sdk.slnx Reorganizes solution folder structure to place dotnet-format under /src/Dotnet.Format/.

Comment thread src/Dotnet.Watch/Watch/UI/ConsoleReporter.cs
Comment thread src/Dotnet.Watch/HotReloadClient/Web/WebAssemblyHotReloadClient.cs
@tmat

tmat commented Mar 17, 2026

Copy link
Copy Markdown
Member Author

@copilot open a new pull request to apply changes based on the comments in this thread

@tmat

tmat commented Mar 17, 2026

Copy link
Copy Markdown
Member Author

@DustinCampbell @MichaelSimons ptal

@DustinCampbell DustinCampbell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed all changes with ?w=1 👍

@tmat
tmat merged commit f062f1b into dotnet:release/10.0.3xx Mar 18, 2026
33 checks passed
@tmat
tmat deleted the StyleCleanup branch March 18, 2026 18:30
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.

5 participants