Use a repo-root `.editorconfig` to configure free .NET analyzer and style rules.
dotnet format
Use the free first-party `dotnet format` CLI for .NET formatting and analyzer fixes. Use when a .NET repo needs formatting commands, `--verify-no-changes` CI checks, or `.editorconfig`-driven code style enforcement.
Trigger On
- the repo uses
dotnet format - you need a CI-safe formatting check for .NET
- the repo wants
.editorconfig-driven style enforcement
Workflow
- Prefer the SDK-provided
dotnet formatcommand instead of inventing custom format scripts. - Start with verify mode in CI:
dotnet format TARGET --verify-no-changes. - Use narrower subcommands only when the repo needs them:
- whitespace - style - analyzers
- Keep
.editorconfigas the source of truth for style preferences. - If the repo also uses
CSharpier, document which tool owns which file types or rules.
Deliver
- explicit
dotnet formatcommands for local and CI runs - formatting that follows
.editorconfig
Validate
- formatting is reproducible on CI
- no overlapping formatter ownership is left ambiguous
Load References
references/format.mdreferences/commands.mdreferences/config.md
Related skills
Use the open-source free `CSharpier` formatter for C# and XML.
CSharpier
Use Chous in .NET repositories that ship sizeable frontend codebases and want file-structure linting, naming convention enforcement, and folder-layout policy as a CLI gate.
Chous