StyleBro.Migrate 0.2.0-alpha.1

This is a prerelease version of StyleBro.Migrate.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global StyleBro.Migrate --version 0.2.0-alpha.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local StyleBro.Migrate --version 0.2.0-alpha.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=StyleBro.Migrate&version=0.2.0-alpha.1&prerelease
                    
nuke :add-package StyleBro.Migrate --version 0.2.0-alpha.1
                    

stylebro-migrate

Moves a repository from StyleCop.Analyzers to StyleBro without changing its code style. It reads the repository's StyleCop setup (rulesets, global configs, .editorconfig files, stylecop.json, the StyleCop version) and writes the StyleBro and .NET SDK settings that enforce the same things.

dotnet tool install --global StyleBro.Migrate --prerelease
stylebro-migrate path/to/repo           # dry run: what StyleCop enforces, what carries over, the settings
stylebro-migrate path/to/repo --write   # writes them

With --write it:

  • writes the settings into the repository's .editorconfig files, between # BEGIN stylebro-migrate and # END stylebro-migrate (running it again replaces the block);
  • turns StyleBro's preset off in Directory.Build.props, since the generated settings replace it;
  • adds the replacing rule ids to existing StyleCop suppressions (#pragma warning disable, [SuppressMessage], <NoWarn>).

Then add the StyleBro.Analyzers package, remove StyleCop.Analyzers, and run dotnet format.

The report lists the StyleCop rules that nothing enforces after the switch, and why. Details: docs/migrating.md.

Starting without StyleCop

stylebro-migrate init [path] [--write]

Adds the severities of the built-in .NET rules StyleBro relies on (IDE0055 formatting, IDE0036 modifier order, IDE0065 using placement, ...) to the repository's .editorconfig. They have to be there: dotnet format ignores rule severities in a package's global config, where StyleBro's preset is. Not needed after --write, which writes them too.

stylebro-migrate init [path] --modernize [--write]

Also adds the SDK's rules that rewrite code into newer C# and newer APIs (new(), collection expressions, ThrowIfNull, ...), in their own block; in multi-targeted projects the newer-API rules are hidden where a target framework lacks the API (StyleBro's multi-target guard) and the newer-C# rules are suggestions unless LangVersion is set. Works after --write too. Details: docs/modernizing.md.

Formatting multi-targeted projects

stylebro-migrate format [folder, solution or project] [dotnet format options]

dotnet format, once per target framework. In a repository with multi-targeted projects, plain dotnet format crashes on the SDK's formatting fix (IDE0055): Roslyn can't merge the frameworks' copies of a file. This loads the projects for one framework at a time, so there's nothing to merge, and code behind #if gets formatted too. Without multi-targeted projects it's one plain dotnet format run. Options pass through (--verify-no-changes, --severity warn, ...).

Baseline

stylebro-migrate baseline [path] [--project MySolution.sln]

Writes stylebro.baseline with every violation dotnet format would fix today. The StyleBro.Analyzers package then hides those in the build, the IDE and dotnet format, so only new code has to follow the rules; a violation counts as new once its line is edited. Whitespace formatting can't be baselined. Details: docs/baseline.md.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.7.0-alpha.1 267 10/13/2026
0.6.0-alpha.1 62 10/12/2026
0.5.0-alpha.1 328 10/10/2026
0.4.0-alpha.1 55 10/10/2026
0.3.0-alpha.1 54 10/9/2026
0.2.0-alpha.1 64 10/6/2026
0.1.0-alpha.8 68 10/2/2026
0.1.0-alpha.7 60 10/2/2026
0.1.0-alpha.6 66 10/1/2026
0.1.0-alpha.5 69 10/1/2026