StyleBro¶
Roslyn analyzers and code fixes that keep C# code tidy, built so that dotnet format fixes everything they
report: every rule has a fix, Fix All works, and one run leaves nothing behind. Most StyleCop rules have a StyleBro
or SDK replacement, and bro migrate moves a StyleCop project over without reformatting it.
Every warning comes with its fix. Rule IDs use the
BROprefix.
- Every rule has a code fix, and Fix All works. Fixes are written for
dotnet format: deterministic, idempotent, and they converge in a single pass. One exception, on purpose: a rename that would break code only the fix can see (a name read by reflection, used in generated code) keeps its warning, andbro formatlists it with the reason (Findings kept on purpose). - Don't duplicate the SDK. If a built-in
IDErule already covers a StyleCop rule, StyleBro uses that rule instead of shipping a copy: the preset sets its options andbro initturns it on in.editorconfig. - Configurable through
.editorconfig, with a recommended preset shipped in the package.
Install¶
<PackageReference Include="StyleBro.Analyzers" Version="0.8.0-alpha.1" PrivateAssets="all" />
dotnet tool install --global StyleBro.Tool --prerelease
bro init --write # turns on the built-in rules StyleBro relies on, in .editorconfig
bro format # whitespace + StyleBro's rules + those built-in rules
Coming from StyleCop? Run bro migrate --write instead of init: see
Migrating from StyleCop.
Where next¶
- Getting started: from install to the first
dotnet formatrun. - Rules: every rule, by area, with what it replaces and whether it's on by default.
- Configuration: every
stylebro_*setting. - Baseline: fail only on new violations. CI: checking it in a pipeline.
- StyleCop rule mapping: which StyleBro or SDK rule replaces each StyleCop rule.
- Source, issues and releases: github.com/bisforboman/stylebro.