HawsLabs.Analyzers 26.603.21316

dotnet add package HawsLabs.Analyzers --version 26.603.21316
                    
NuGet\Install-Package HawsLabs.Analyzers -Version 26.603.21316
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HawsLabs.Analyzers" Version="26.603.21316">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HawsLabs.Analyzers" Version="26.603.21316" />
                    
Directory.Packages.props
<PackageReference Include="HawsLabs.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HawsLabs.Analyzers --version 26.603.21316
                    
#r "nuget: HawsLabs.Analyzers, 26.603.21316"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HawsLabs.Analyzers@26.603.21316
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HawsLabs.Analyzers&version=26.603.21316
                    
Install as a Cake Addin
#tool nuget:?package=HawsLabs.Analyzers&version=26.603.21316
                    
Install as a Cake Tool

HawsLabs C# Code Analyzers

HawsLabs.Analyzers is a Roslyn analyzer package with C# diagnostics and code fixes for HawsLabs formatting conventions.

Install

Install the package into each project that should be analyzed:

dotnet add package HawsLabs.Analyzers

Keep analyzer references private so they do not flow to downstream consumers of your project:

<ItemGroup>
	<PackageReference Include="HawsLabs.Analyzers" Version="x.y.z" PrivateAssets="all" />
</ItemGroup>

For projects that use Central Package Management, put the version in Directory.Packages.props:

<ItemGroup>
	<PackageVersion Include="HawsLabs.Analyzers" Version="x.y.z" />
</ItemGroup>

Then reference the analyzer from each project:

<ItemGroup>
	<PackageReference Include="HawsLabs.Analyzers" PrivateAssets="all" />
</ItemGroup>

Configure

Configure diagnostics in .editorconfig with standard Roslyn analyzer severity settings:

[*.cs]
dotnet_diagnostic.HA9000.severity = warning
dotnet_diagnostic.HA9001.severity = warning
dotnet_diagnostic.HA9002.severity = warning
dotnet_diagnostic.HA9003.severity = warning
dotnet_diagnostic.HA9004.severity = warning
dotnet_diagnostic.HA9005.severity = warning
dotnet_diagnostic.HA9006.severity = warning

Use error to fail builds for a rule, or none to disable a rule.

Several formatting rules also read existing EditorConfig settings:

[*]
max_line_length = 110
indent_brace_style = 1TBS

[*.cs]
csharp_prefer_braces = true:error
csharp_new_line_before_open_brace = none
csharp_new_line_before_else = false
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_between_query_expression_clauses = false
dotnet_diagnostic.IDE0011.severity = error

Use

After restore, the analyzers run anywhere Roslyn analyzers run: Visual Studio, VS Code with C# Dev Kit, dotnet build, and CI builds.

Apply supported code fixes from your editor, or run them from the command line:

dotnet format <solution-or-project> analyzers --diagnostics HA9000 HA9001 HA9002 HA9003 HA9004 HA9006

Rules

Rule ID ranges

Range Category
HA1000-1199 Design
HA1200-1299 Documentation
HA1300-1399 Globalization
HA1400-1499 Interoperability
HA1500-1699 Maintainability
HA1700-1799 Naming
HA1800-1999 Performance
HA2000-2099 Reliability
HA2100-2199 Security
HA2200-2299 Usage
HA2300-2399 SingleFile
HA9000-9999 Style

Rule catalog

Id Category Description Severity Enabled Code fix
HA9000 Style Put hanging-list closing parenthesis on its own line ⚠️ ✔️ ✔️
HA9001 Style Put split list items on separate lines ⚠️ ✔️ ✔️
HA9002 Style Keep parameter-list continuations with the closing parenthesis ⚠️ ✔️ ✔️
HA9003 Style Keep short First calls with their receiver ⚠️ ✔️ ✔️
HA9004 Style Format multiline raw string literal indentation ⚠️ ✔️ ✔️
HA9005 Style Keep 1TBS brace settings consistent ⚠️ ✔️
HA9006 Style Align hanging-list items with continuation indentation ⚠️ ✔️ ✔️

Contributing

Contributor setup, development commands, VS Code tasks, and publishing notes live in CONTRIBUTING.md.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.603.21316 90 6/3/2026
26.603.20140 82 6/3/2026
26.601.1610 104 6/1/2026
26.531.212425 94 5/31/2026
26.526.143640 97 5/26/2026
26.521.231112 97 5/21/2026
26.521.31017 92 5/21/2026
26.521.24004 90 5/21/2026
26.521.3447 95 5/21/2026

See CHANGELOG.md for release notes.