Use dotnet format from SDK#138
Merged
martincostello merged 1 commit intomainfrom Jun 2, 2025
Merged
Conversation
- Use `dotnet format` from the .NET SDK instead of the `dotnet-format` tool which is deprecated and does not understand modern C# features like primary constructors. - Fix warnings from `dotnet format`. - Explicitly set the line endings to use for files. - Downgrade `csharp_style_namespace_declarations` to a suggestion to avoid forcing adoption on existing files now and creating additional code churn.
There was a problem hiding this comment.
Pull Request Overview
This PR migrates code formatting to use the .NET SDK's dotnet format tool and cleans up the code by removing deprecated and unused using directives. Key changes include:
- Replacing the deprecated dotnet-format tool with dotnet format in the GitHub workflow.
- Removing several obsolete using directives from test and source files.
- Updating configuration files (.editorconfig, .gitattributes) to explicitly set line endings and adjust code style suggestions.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/* | Removed deprecated/unused using directives from test files. |
| src/* | Removed unused using directives and adjusted using ordering. |
| .github/workflows/dotnet-format.yml | Switched from installing dotnet-format to using dotnet format. |
| .gitattributes | Added line ending configuration. |
| .editorconfig | Set explicit end_of_line and downgraded namespace declaration severity to suggestion. |
matt-hensley
approved these changes
Jun 2, 2025
This was referenced Aug 12, 2025
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.
Changes
dotnet formatfrom the .NET SDK instead of thedotnet-formattool which is deprecated (see 🎉🥳 dotnet-format is now part of the .NET 6 SDK dotnet/format#1268) and does not understand modern C# features like primary constructors.dotnet format.csharp_style_namespace_declarationsto a suggestion to avoid forcing adoption on existing files now and creating additional code churn.Merge requirement checklist
CHANGELOG.mdfile updated for non-trivial changes