﻿---
title: Why Curb
description: Why a .NET developer should use Curb — fast, non-fighting, and runs inside dotnet build.
url: https://docs-v3-preview.elastic.dev/why
---

# 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.

## It's fast

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](https://docs-v3-preview.elastic.dev/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](https://docs-v3-preview.elastic.dev/workflow/msbuild) 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.

## It doesn't fight what you already run

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.

## Turn on EnforceCodeStyleInBuild without fear

```xml
<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.

## Capability table


|                                                                             | `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.

## Read more

- [Design principles](https://docs-v3-preview.elastic.dev/design-principles) — parser-only, arena IR, full reprint, safety
- [Reflow](https://docs-v3-preview.elastic.dev/design-principles/reflow) — what `max_line_length` does and what each mode costs
- [Performance](https://docs-v3-preview.elastic.dev/design-principles/performance) — the numbers and why they hold
- [Conformance](https://docs-v3-preview.elastic.dev/design-principles/conformance) — how the `dotnet format` fixed-point is measured
- [Benchmarks](https://docs-v3-preview.elastic.dev/benchmarks) — twelve repositories, three tools, measured