dotnet format
The dotnet command that applies the repository's EditorConfig style and analyzer fixes to code.
In more detail
It reads the same EditorConfig settings as the editor and the build. Developers run it locally to fix formatting; continuous integration runs dotnet format --verify-no-changes, which fails without rewriting anything.
Example
dotnet format --verify-no-changesRelated terms
- EditorConfig — A plain-text .editorconfig file that records a repository's coding style, and in .NET also the severity of each analyzer rule, for editors and the build to apply.
- code formatter — A tool that rewrites source code into a consistent layout, such as indentation and spacing, without changing what it does.
- continuous integration — Automatically building and testing every change as soon as it is pushed, so problems are caught early.
Taught in
- Code Quality: .editorconfig and Roslyn Analyzers — Modern .NET Core, C# & Enterprise Microservices