NetAgents.Analyzers
26.9.29.6639
dotnet add package NetAgents.Analyzers --version 26.9.29.6639
NuGet\Install-Package NetAgents.Analyzers -Version 26.9.29.6639
<PackageReference Include="NetAgents.Analyzers" Version="26.9.29.6639"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="NetAgents.Analyzers" Version="26.9.29.6639" />
<PackageReference Include="NetAgents.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add NetAgents.Analyzers --version 26.9.29.6639
#r "nuget: NetAgents.Analyzers, 26.9.29.6639"
#:package NetAgents.Analyzers@26.9.29.6639
#addin nuget:?package=NetAgents.Analyzers&version=26.9.29.6639
#tool nuget:?package=NetAgents.Analyzers&version=26.9.29.6639
โจ NetAgents
Consistent C# standards, enforced on every build.
Keep formatting, naming, and code quality consistent across your .NET projects. NetAgents automatically formats your source files and applies available code fixes when you build.
๐ฆ Install
dotnet add package NetAgents.Analyzers
Requires the .NET 10 SDK or newer. Your projects can target older .NET versions.
Set PrivateAssets="all" on the package reference to keep the dependency private to your project. Shared rules apply automatically.
๐ ๏ธ Build and format
dotnet build
On each build, NetAgents:
- Formats your source files and applies available code fixes automatically.
- Checks the updated code against the shared rules.
- Reports any remaining violations as build errors for you to resolve.
Builds can change your source files. Every rewritten file is named in the build log, including when the build then fails on a violation no fix can repair. Review those changes before committing. Some violations require a manual fix; IDE quick fixes and dotnet format are also available.
๐ Formatting rules
- Conditions: keep conditions on one line, with at most 128 characters. Extract longer expressions into separate variables. Ternary conditions follow this rule; their
?and:branches can span multiple lines. - Arguments and parameters: keep lists on one line when their normalized contents fit within 128 characters, excluding the surrounding delimiters. Longer lists put each item and the closing delimiter on separate lines. This applies to calls and declarations, including constructors and records.
- Layout: use consistent spacing, blank lines between methods and around control flow and multiline declarations, braces based on body layout, and a final newline.
- Clarity: name literal arguments, pass every other argument positionally, and remove unused imports.
๐๏ธ Member order
Members are sorted by kind, visibility, const/static/instance, readonly, then name. Nested classes follow methods. Overloads with matching sorting keys retain their relative order.
Sorting preserves initializer order and storage order in structs and types with explicit layout. Types containing preprocessor directives retain their member order.
โ Code standards
| Area | What to expect |
|---|---|
| ๐งฉ Type safety | Nullable analysis is required. No boxing, object/dynamic values, or untyped collections. |
| ๐๏ธ Design | Return dedicated named records, classes, or structs instead of tuple result types, including wrapped tuple results. |
| ๐ท๏ธ Naming and structure | Descriptive names, one top-level type per matching file, files under 1,000 lines, and at most 16 authored C# files per directory. |
| ๐ก๏ธ Reliability | Consume return values. No discarded results, empty catches, null-forgiving operators, or unconditional loops. |
| โก Concurrency | Use asynchronous composition or Nito.AsyncEx for coordination. No lock, framework synchronization primitives, or blocking waits. |
| ๐ Documentation | XML comments are required for public APIs. |
Existing editor and project settings must agree with the shared rules. See the complete rule reference for details.
๐ฆ NuGet package ยท ๐ Rule reference ยท โ๏ธ MIT license
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.9.29.6639 | 308 | 9/29/2026 |
| 26.9.28.2514 | 245 | 9/28/2026 |
| 26.9.25.7387 | 510 | 9/25/2026 |
| 26.9.22.6016 | 933 | 9/22/2026 |
| 26.9.21.5138 | 866 | 9/21/2026 |
| 26.9.21.2887 | 330 | 9/21/2026 |
| 26.9.21.2034 | 157 | 9/21/2026 |
| 26.9.21.1441 | 124 | 9/21/2026 |
| 26.9.21.1265 | 85 | 9/21/2026 |
| 26.9.21.1229 | 758 | 9/21/2026 |
| 26.9.21.1169 | 93 | 9/21/2026 |
| 26.9.20.9967 | 101 | 9/21/2026 |
| 26.9.20.9631 | 89 | 9/20/2026 |
| 26.9.20.9536 | 102 | 9/20/2026 |
| 26.9.20.9111 | 100 | 9/20/2026 |
| 26.9.20.8033 | 129 | 9/20/2026 |
| 26.9.20.7737 | 98 | 9/20/2026 |
| 26.9.20.3335 | 114 | 9/20/2026 |
| 26.9.20.3080 | 104 | 9/20/2026 |
| 26.9.20.1500 | 111 | 9/20/2026 |