Skill page Code Quality v1.0.0

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

  1. Prefer the SDK-provided dotnet format command instead of inventing custom format scripts.
  2. Start with verify mode in CI: dotnet format TARGET --verify-no-changes.
  3. Use narrower subcommands only when the repo needs them:

- whitespace - style - analyzers

  1. Keep .editorconfig as the source of truth for style preferences.
  2. If the repo also uses CSharpier, document which tool owns which file types or rules.

Deliver

  • explicit dotnet format commands for local and CI runs
  • formatting that follows .editorconfig

Validate

  • formatting is reproducible on CI
  • no overlapping formatter ownership is left ambiguous

Load References

Related skills