Loading

Why Curb

Curb runs inside dotnet build. It formats your source before the compiler reads it, so formatting offences never become build errors. Neither you nor a coding agent has to spend time on brace placement.

0.26 s on 945 files (Newtonsoft.Json), cold. dotnet format whitespace on the same files: 3.47 s. Across twelve real repositories, curb is 5–25× faster than dotnet format whitespace — and does more: reflow to line width, using-directive sorting, and syntax-level code style on top. See Benchmarks for the full table.

Speed is what makes running on every build viable. All benchmark numbers are cold. Warm runs are faster still: the build integration skips unchanged projects entirely — no process starts. For projects with changes, only the files that changed since the last build are reformatted. The local cache autoinvalidates after one week and clears with dotnet clean. curb is FAST cold, FASTER warm.

Curb's defaults are Roslyn's defaults — the same values Visual Studio and Rider use for Format Document. Its output is a 100% fixed point of dotnet format whitespace, measured and gated in CI on every push. Hit Format Document in your IDE after Curb ran and nothing moves.

It reads the .editorconfig you already have — all 39 IDE0055 formatting options, plus the ReSharper wrapping and blank-line keys Rider already reads. It invents no keys of its own.

<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
		

Without a formatter in the build, this setting turns every misformatted file into a build error. With Curb, the syntax-level offences are gone before the compiler runs. The diagnostics that survive are the ones that needed a compilation to decide — worth fixing, not noise.

dotnet format whitespace dotnet format style Curb
Runs on a bare folder, no restore or build
All 39 IDE0055 formatting options
Reflow to max_line_length
Syntax-level code style (braces, expression bodies, file-scoped namespaces)
Semantic code style (var, unused usings, naming) by design

The last row is the scope boundary. Curb never loads a compilation, and that is what keeps it fast enough to run inside every build.

  • Design principles — parser-only, arena IR, full reprint, safety
  • Reflow — what max_line_length does and what each mode costs
  • Performance — the numbers and why they hold
  • Conformance — how the dotnet format fixed-point is measured
  • Benchmarks — twelve repositories, three tools, measured