Levelup Software build standards, analyzers, and code style enforcement for .NET projects.
Lvlup.Build is a NuGet meta-package that provides:
- Analyzers: StyleCop, Microsoft .NET Analyzers, and Visual Studio Threading Analyzers
- Build Properties: Consistent settings for nullable reference types, warnings-as-errors, and deterministic builds
- Override Points: Easy customization for project-specific needs
Add to your Directory.Build.props:
<ItemGroup>
<PackageReference Include="Lvlup.Build" PrivateAssets="all" />
</ItemGroup>And to your Directory.Packages.props:
<ItemGroup>
<PackageVersion Include="Lvlup.Build" Version="1.0.0" />
</ItemGroup>| Package | Version | Purpose |
|---|---|---|
| StyleCop.Analyzers | 1.2.0-beta.556 | Code style and formatting |
| Microsoft.CodeAnalysis.NetAnalyzers | 10.0.0 | Code quality and .NET best practices |
| Microsoft.VisualStudio.Threading.Analyzers | 17.14.15 | Async/threading correctness |
The package includes a default stylecop.json that is automatically linked to your projects. To override:
- Add your own
stylecop.jsonto yoursrc/directory - Or disable the default:
<LvlupIncludeStyleCopConfig>false</LvlupIncludeStyleCopConfig>
The package automatically configures:
LangVersion:latestImplicitUsings:enableNullable:enableEnableNETAnalyzers:trueAnalysisLevel:latestTreatWarningsAsErrors:trueDeterministic:true
Customize behavior by setting properties before the package is imported:
<!-- In your Directory.Build.props -->
<PropertyGroup>
<!-- Disable warnings-as-errors for Debug builds -->
<LvlupTreatWarningsAsErrors Condition="'$(Configuration)' == 'Debug'">false</LvlupTreatWarningsAsErrors>
<!-- Disable all analyzers (not recommended) -->
<LvlupEnableAnalyzers>false</LvlupEnableAnalyzers>
<!-- Disable nullable reference types -->
<LvlupEnableNullable>false</LvlupEnableNullable>
<!-- Don't run analyzers during build (IDE only) -->
<LvlupRunAnalyzersDuringBuild>false</LvlupRunAnalyzersDuringBuild>
</PropertyGroup>For full code style enforcement, pair this package with:
.editorconfig- Code formatting rules and analyzer severitiesstylecop.json- StyleCop-specific settings (company name, documentation rules)
Templates for these files are available via the /dotnet-standards Claude skill:
/dotnet-standards scaffold MyProject --company "My Company"This package is published to nuget.org. No special configuration needed.
MIT