Skip to main content
Any Framework

C# formatter with width-aware reflow while honouring the full IDE0055 .editorconfig option surface.

Published
Aug 27, 2026
1mo ago
Total Downloads
3.1K
3,064

Install

dotnet add package curb-cli.osx-arm64 --version 0.7.0

No framework information available.

README

Curb

A C# formatter that reads your .editorconfig β€” all of it.

Curb reflows C# to a line width, the way Prettier does, while honouring the complete set of .NET formatting options (code style rule IDE0055). Its defaults are Roslyn's defaults, so it agrees with Visual Studio and Rider out of the box.

πŸ“– Documentation β€” full option reference, design rationale, and the build integration guide.

Why

Fast enough to run on every build. curb is a native-AOT binary with no warm-up cost. Measured cold on Newtonsoft.Json (945 files):

curb dnf whitespace CSharpier
Newtonsoft.Json (945 files) 0.26 s 3.47 s 4.85 s

dnf whitespace is dotnet format whitespace β€” the whitespace-only pass, curb's closest equivalent. Across twelve real repositories curb is 5–25Γ— faster than dotnet format whitespace, while doing more: it reflows long lines, sorts using directives, and applies syntax-level code style on top. Fast enough to wire into dotnet build and forget about it. Full numbers: Benchmarks.

On subsequent builds the MSBuild integration skips unchanged projects entirely β€” no process starts. For projects with changes, only the files that changed since the last build are reformatted. curb is FAST cold, FASTER warm.

Plays well with your IDE and dotnet format. Curb supports the full set of .editorconfig formatting properties that Visual Studio, Rider and dotnet format read β€” all 39 csharp_* and dotnet_* keys of IDE0055, plus the ReSharper wrapping and blank-line keys. Running dotnet format whitespace over Curb's output never disagrees β€” measured across 41,000 files, gated on every push.

Install

MSBuild β€” runs on every dotnet build

<PackageReference Include="curb" Version="*" PrivateAssets="all" />

Curb runs before CoreCompile, rewriting source in Debug and checking in Release. With EnforceCodeStyleInBuild set, the only style diagnostics left are the ones that genuinely require a compilation β€” everything mechanical is already fixed before the compiler reads the file.

This is the recommended integration for most projects. It is particularly effective in agentic workflows: any code an agent writes or edits is formatted automatically on the next build, without the agent having to think about it. See the build integration docs.

CLI β€” pre-commit hooks, CI, scripting

dotnet tool install -g curb-cli

Ships as a native-AOT binary per platform (linux-x64, linux-arm64, win-x64, win-arm64, osx-arm64), with a portable fallback. About 10 ms startup.

curb format ./src          # format in place
curb check ./src           # exit 1 if anything would change
curb print-config Foo.cs   # show every resolved option and its source

For code style rules that need a compilation (unused usings, var, naming), run a build first and let Curb read what it reported:

dotnet build && curb cleanup

curb rules lists what Curb fixes and what it leaves to dotnet format style.

Building from source

Requires the .NET 10 SDK.

git clone https://github.com/nullean/curb.git
cd curb
./build.sh build
./build.sh test

License

MIT β€” see LICENSE.txt.

Changes from Previous Version

No structural changes between v0.6.2 and v0.7.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.