Reihitsu.Analyzer
0.21.0
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Reihitsu.Analyzer --version 0.21.0
NuGet\Install-Package Reihitsu.Analyzer -Version 0.21.0
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="Reihitsu.Analyzer" Version="0.21.0"> <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="Reihitsu.Analyzer" Version="0.21.0" />
<PackageReference Include="Reihitsu.Analyzer"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
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 Reihitsu.Analyzer --version 0.21.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Reihitsu.Analyzer, 0.21.0"
#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 Reihitsu.Analyzer@0.21.0
#: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=Reihitsu.Analyzer&version=0.21.0
#tool nuget:?package=Reihitsu.Analyzer&version=0.21.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Reihitsu.Analyzer
A Roslyn-based C# analyzer package that enforces coding rules across multiple categories: Clarity, Design, Naming, Formatting, Documentation, Ordering, Performance, and Analyzer.
Installation
dotnet add package Reihitsu.Analyzer
Rules
The Formatter column indicates whether running the Reihitsu formatter can automatically correct the rule without relying on an analyzer code fix.
| ID | Description | Analyzer | Code Fix | Formatter |
|---|---|---|---|---|
| Clarity | ||||
| RH0001 | Not operator should not be used. | ✔ | ✔ | ❌ |
| RH0002 | Do not prefix calls with base. unless a local implementation exists. |
✔ | ✔ | ❌ |
| RH0003 | Code must not contain empty statements. | ✔ | ✔ | ❌ |
| RH0004 | Statement must not use unnecessary parentheses. | ✔ | ✔ | ❌ |
| RH0005 | Comments must contain text. | ✔ | ✔ | ❌ |
| RH0006 | Use string.Empty for empty strings. |
✔ | ✔ | ❌ |
| RH0007 | Use shorthand for nullable types. | ✔ | ✔ | ❌ |
| RH0008 | Do not use default value type constructor. | ✔ | ✔ | ❌ |
| RH0009 | Use lambda syntax. | ✔ | ✔ | ❌ |
| RH0010 | Use readable conditions. | ✔ | ✔ | ❌ |
| RH0011 | Conditional expressions must declare precedence. | ✔ | ✔ | ❌ |
| RH0012 | Do not prefix local members with this.. |
✔ | ✔ | ❌ |
| RH0013 | Do not use query syntax. | ✔ | ❌ | ❌ |
| Design | ||||
| RH0101 | Private auto-implemented properties should not be used. | ✔ | ✔ | ❌ |
| RH0102 | Async void methods should not be used. | ✔ | ❌ | ❌ |
| RH0103 | NotImplementedException should not be used. | ✔ | ❌ | ❌ |
| RH0104 | Access modifier must be declared. | ✔ | ✔ | ❌ |
| RH0105 | Fields must be private. | ✔ | ✔ | ❌ |
| RH0106 | File may only contain a single namespace. | ✔ | ❌ | ❌ |
| RH0107 | Code analysis suppressions must have a justification. | ✔ | ❌ | ❌ |
| RH0108 | Debug.Assert must provide message text. | ✔ | ❌ | ❌ |
| RH0109 | Debug.Fail must provide message text. | ✔ | ❌ | ❌ |
| RH0110 | Unnecessary delegate parentheses should be removed. | ✔ | ✔ | ❌ |
| RH0111 | Unnecessary attribute constructor parentheses should be removed. | ✔ | ✔ | ❌ |
| RH0112 | File may only contain a single top-level type. | ✔ | ❌ | ❌ |
| RH0113 | Nested types should not be used. | ✔ | ❌ | ❌ |
| Naming | ||||
| RH0201 | The name of the type should match the filename. | ✔ | ✔ | ❌ |
| RH0202 | Class names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0203 | Struct names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0204 | Enum names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0205 | Enum member names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0206 | Interface names should use the I prefix and PascalCase. | ✔ | ✔ | ❌ |
| RH0207 | Event names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0208 | Delegate names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0209 | Method names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0210 | Local function names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0211 | Method parameter names should be in camelCase. | ✔ | ✔ | ❌ |
| RH0212 | Private field names should be in _camelCase. | ✔ | ✔ | ❌ |
| RH0213 | Protected field names should be in _camelCase. | ✔ | ✔ | ❌ |
| RH0214 | Internal field names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0215 | Public field names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0216 | Const field names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0217 | Private property names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0218 | Protected property names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0219 | Internal property names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0220 | Public property names should be in PascalCase. | ✔ | ✔ | ❌ |
| RH0221 | Local variable names should be in camelCase. | ✔ | ✔ | ❌ |
| RH0222 | Tuple element names should be in camelCase. | ✔ | ✔ | ❌ |
| RH0223 | Deconstruction variable names should be in camelCase. | ✔ | ✔ | ❌ |
| RH0224 | Tuple expression argument names should be in camelCase. | ✔ | ✔ | ❌ |
| RH0225 | File scoped namespace declarations should be in PascalCase. | ✔ | ❌ | ❌ |
| RH0226 | Namespace declarations should be in PascalCase. | ✔ | ❌ | ❌ |
| RH0227 | The given namespace is not allowed. | ✔ | ❌ | ❌ |
| RH0228 | Single-letter identifiers should not be used. | ✔ | ❌ | ❌ |
| Formatting | ||||
| RH0301 | #region and #endregion descriptions should match. | ✔ | ✔ | ✔ |
| RH0302 | Object initializer should be formatted correctly. | ✔ | ✔ | ✔ |
| RH0303 | try-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0304 | if-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0305 | while-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0306 | do-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0307 | using-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0308 | foreach-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0309 | for-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0310 | return-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0311 | goto-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0312 | break-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0313 | break statement should be followed by a blank line. | ✔ | ✔ | ✔ |
| RH0314 | continue-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0315 | throw-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0316 | switch-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0317 | checked-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0318 | unchecked-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0319 | fixed-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0320 | lock-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0321 | yield-Statement should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0322 | Single line comments should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0323 | Local declarations should be followed by a blank line. | ✔ | ✔ | ✔ |
| RH0324 | Method chains should be aligned. | ✔ | ✔ | ✔ |
| RH0325 | Expression style methods should not be used. | ✔ | ✔ | ✔ |
| RH0326 | Expression style constructors should not be used. | ✔ | ✔ | ✔ |
| RH0327 | Expression style get-only properties should be single lined. | ✔ | ✔ | ✔ |
| RH0328 | #region description should start with an uppercase letter. | ✔ | ✔ | ✔ |
| RH0329 | Logical expressions should be formatted correctly. | ✔ | ✔ | ✔ |
| RH0330 | Raw string literals should be formatted correctly. | ✔ | ✔ | ✔ |
| RH0331 | The first argument should be on the same line as the opening parenthesis. | ✔ | ✔ | ✔ |
| RH0332 | Arguments should either all be on one line or each on its own line. | ✔ | ✔ | ✔ |
| RH0333 | Multi-line arguments should be aligned. | ✔ | ✔ | ✔ |
| RH0334 | Keywords must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0335 | Commas must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0336 | Semicolons must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0337 | Documentation lines must begin with single space. | ✔ | ✔ | ✔ |
| RH0338 | Preprocessor keywords must not be preceded by space. | ✔ | ✔ | ✔ |
| RH0339 | Operator keyword must be followed by space. | ✔ | ✔ | ✔ |
| RH0340 | Opening parenthesis must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0341 | Opening square brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0342 | Closing square brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0343 | Opening braces must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0344 | Closing braces must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0345 | Opening generic brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0346 | Closing generic brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0347 | Opening attribute brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0348 | Closing attribute brackets must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0349 | Nullable type symbols must not be preceded by space. | ✔ | ✔ | ✔ |
| RH0350 | Member access symbols must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0351 | Increment/decrement symbols must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0352 | Negative signs must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0353 | Positive signs must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0354 | Dereference and access-of symbols must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0355 | Colons must be spaced correctly. | ✔ | ✔ | ✔ |
| RH0356 | No space after new for implicitly typed arrays. | ✔ | ✔ | ✔ |
| RH0357 | Tab characters must not be used. | ✔ | ✔ | ✔ |
| RH0358 | Code must not contain trailing whitespace. | ✔ | ✔ | ✔ |
| RH0359 | Braces for multi-line statements must not share line. | ✔ | ✔ | ✔ |
| RH0360 | Statement must not be on a single line. | ✔ | ✔ | ✔ |
| RH0361 | Element must not be on a single line. | ✔ | ✔ | ✔ |
| RH0362 | Braces must not be omitted. | ✔ | ✔ | ✔ |
| RH0363 | Opening brace must not be followed by blank line. | ✔ | ✔ | ✔ |
| RH0364 | Element documentation headers must not be followed by blank line. | ✔ | ✔ | ✔ |
| RH0365 | Code must not contain multiple blank lines in a row. | ✔ | ✔ | ✔ |
| RH0366 | Closing brace must not be preceded by blank line. | ✔ | ✔ | ✔ |
| RH0367 | Opening brace must not be preceded by blank line. | ✔ | ✔ | ✔ |
| RH0368 | Chained statement blocks must not be preceded by blank line. | ✔ | ✔ | ✔ |
| RH0369 | While-do footer must not be preceded by blank line. | ✔ | ✔ | ✔ |
| RH0370 | Element documentation header must be preceded by blank line. | ✔ | ✔ | ✔ |
| RH0371 | Code must not contain blank lines at the start of the file. | ✔ | ✔ | ✔ |
| RH0372 | File must not end with a newline. | ✔ | ✔ | ✔ |
| RH0373 | Braces must not be omitted from multi-line child statements. | ✔ | ✔ | ✔ |
| RH0374 | Use braces consistently. | ✔ | ✔ | ✔ |
| RH0375 | Code must not contain multiple statements on one line. | ✔ | ✔ | ✔ |
| RH0376 | Comments must be on their own line. | ✔ | ✔ | ✔ |
| RH0377 | Opening parenthesis must be on declaration line. | ✔ | ✔ | ✔ |
| RH0378 | Closing parenthesis must be on line of last argument. | ✔ | ✔ | ✔ |
| RH0379 | Comma must be on same line as previous parameter. | ✔ | ✔ | ✔ |
| RH0380 | Parameter list must follow declaration. | ✔ | ✔ | ✔ |
| RH0381 | Parameters must be on same line or separate lines. | ✔ | ✔ | ✔ |
| RH0382 | Do not combine fields. | ✔ | ✔ | ✔ |
| RH0383 | Do not place regions within elements. | ✔ | ✔ | ✔ |
| RH0384 | Generic type constraints should be on their own line with proper indentation. | ✔ | ✔ | ✔ |
| RH0385 | Code must not contain mixed line endings. | ✔ | ✔ | ✔ |
| RH0386 | Region directives must use consistent indentation with containing code. | ✔ | ✔ | ✔ |
| RH0387 | Types should be organized with regions. | ✔ | ❌ | ❌ |
| RH0387A | Types with multiple member kinds should be organized with regions. | ✔ | ❌ | ❌ |
| RH0388 | Region descriptions should not end with implementation. | ✔ | ✔ | ❌ |
| RH0389 | Indentation must use 4 spaces per scope level. | ✔ | ✔ | ✔ |
| RH0390 | Using directives should be organized into groups. | ✔ | ✔ | ✔ |
| RH0391 | Assignments must have proper line breaks. | ✔ | ✔ | ✔ |
| RH0392 | Statement lambda opening braces should be aligned. | ✔ | ✔ | ✔ |
| RH0393 | Local declarations should be preceded by a blank line. | ✔ | ✔ | ✔ |
| RH0394 | Blank line after closing brace. | ✔ | ✔ | ✔ |
| RH0395 | Break statements should not be inside explicit switch case blocks. | ✔ | ✔ | ❌ |
| RH0396 | Using declarations should not be used. | ✔ | ✔ | ❌ |
| RH0397 | Region descriptions should not be Member or Members. | ✔ | ❌ | ❌ |
| Documentation | ||||
| RH0401 | The inheritdoc tag should be used if possible. | ✔ | ✔ | ❌ |
| RH0402 | Non-private classes must be documented. | ✔ | ❌ | ❌ |
| RH0403 | Private classes must be documented. | ✔ | ❌ | ❌ |
| RH0404 | Non-private structs must be documented. | ✔ | ❌ | ❌ |
| RH0405 | Private structs must be documented. | ✔ | ❌ | ❌ |
| RH0406 | Non-private interfaces must be documented. | ✔ | ❌ | ❌ |
| RH0407 | Private interfaces must be documented. | ✔ | ❌ | ❌ |
| RH0408 | Non-private records must be documented. | ✔ | ❌ | ❌ |
| RH0409 | Private records must be documented. | ✔ | ❌ | ❌ |
| RH0410 | Non-private record structs must be documented. | ✔ | ❌ | ❌ |
| RH0411 | Private record structs must be documented. | ✔ | ❌ | ❌ |
| RH0412 | Non-private enums must be documented. | ✔ | ❌ | ❌ |
| RH0413 | Private enums must be documented. | ✔ | ❌ | ❌ |
| RH0414 | Enum members in non-private enums must be documented. | ✔ | ❌ | ❌ |
| RH0415 | Enum members in private enums must be documented. | ✔ | ❌ | ❌ |
| RH0416 | Non-private delegates must be documented. | ✔ | ❌ | ❌ |
| RH0417 | Private delegates must be documented. | ✔ | ❌ | ❌ |
| RH0418 | Non-private constructors must be documented. | ✔ | ❌ | ❌ |
| RH0419 | Private constructors must be documented. | ✔ | ❌ | ❌ |
| RH0420 | Destructors must be documented. | ✔ | ❌ | ❌ |
| RH0421 | Non-private methods must be documented. | ✔ | ❌ | ❌ |
| RH0422 | Private methods must be documented. | ✔ | ❌ | ❌ |
| RH0423 | Non-private properties must be documented. | ✔ | ❌ | ❌ |
| RH0424 | Private properties must be documented. | ✔ | ❌ | ❌ |
| RH0425 | Non-private indexers must be documented. | ✔ | ❌ | ❌ |
| RH0426 | Private indexers must be documented. | ✔ | ❌ | ❌ |
| RH0427 | Non-private fields must be documented. | ✔ | ❌ | ❌ |
| RH0428 | Private fields must be documented. | ✔ | ❌ | ❌ |
| RH0429 | Non-private events must be documented. | ✔ | ❌ | ❌ |
| RH0430 | Private events must be documented. | ✔ | ❌ | ❌ |
| RH0431 | Element documentation must have summary text. | ✔ | ❌ | ❌ |
| RH0432 | <value> tag must not be used. | ✔ | ✔ | ❌ |
| RH0433 | Element parameters must be documented. | ✔ | ❌ | ❌ |
| RH0434 | Element parameter documentation must match element parameters. | ✔ | ❌ | ❌ |
| RH0435 | Element parameter documentation must declare parameter name. | ✔ | ❌ | ❌ |
| RH0436 | Element parameter documentation must have text. | ✔ | ❌ | ❌ |
| RH0437 | Element return value must be documented. | ✔ | ❌ | ❌ |
| RH0438 | Element return value documentation must have text. | ✔ | ❌ | ❌ |
| RH0439 | Void return value must not be documented. | ✔ | ✔ | ❌ |
| RH0440 | Generic type parameters must be documented. | ✔ | ❌ | ❌ |
| RH0441 | Generic type parameter documentation must match type parameters. | ✔ | ❌ | ❌ |
| RH0442 | Generic type parameter documentation must declare parameter name. | ✔ | ❌ | ❌ |
| RH0443 | Generic type parameter documentation must have text. | ✔ | ❌ | ❌ |
| RH0444 | Single-line comments must not use documentation style slashes. | ✔ | ✔ | ❌ |
| RH0445 | <inheritdoc> must be used with inheriting class. | ✔ | ❌ | ❌ |
| RH0446 | Do not use placeholder elements. | ✔ | ✔ | ❌ |
| RH0447 | XML documentation elements must be on separate lines. | ✔ | ✔ | ❌ |
| RH0448 | Summary element must span at least three lines. | ✔ | ✔ | ✔ |
| RH0449 | XML documentation element text must not end with a period. | ✔ | ✔ | ❌ |
| RH0450 | Content after opening XML tag must be on same line as closing tag. | ✔ | ✔ | ✔ |
| RH0451 | No content should appear after closing XML tags. | ✔ | ✔ | ❌ |
| RH0452 | Files must start with configured copyright header. | ✔ | ✔ | ❌ |
| Ordering | ||||
| RH0601 | Constants must appear before fields. | ✔ | ✔ | ❌ |
| RH0602 | Static elements must appear before instance elements. | ✔ | ✔ | ❌ |
| RH0603 | Partial elements must declare access modifier. | ✔ | ✔ | ❌ |
| RH0604 | Declaration keywords must follow order. | ✔ | ✔ | ❌ |
| RH0605 | Protected must come before internal. | ✔ | ✔ | ❌ |
| RH0606 | System using directives must be placed before other using directives. | ✔ | ✔ | ❌ |
| RH0607 | Using alias directives must be placed after other using directives. | ✔ | ✔ | ❌ |
| RH0608 | Using directives must be ordered alphabetically by namespace. | ✔ | ✔ | ❌ |
| RH0609 | Using alias directives must be ordered alphabetically by alias name. | ✔ | ✔ | ❌ |
| RH0610 | Property accessors must follow order. | ✔ | ✔ | ❌ |
| RH0611 | Event accessors must follow order. | ✔ | ✔ | ❌ |
| RH0612 | Readonly elements must appear before non-readonly elements. | ✔ | ✔ | ❌ |
| RH0613 | Using static directives must be placed at correct position. | ✔ | ✔ | ❌ |
| RH0614 | Using static directives must be ordered alphabetically. | ✔ | ✔ | ❌ |
| Performance | ||||
| RH0501 | Types used as dictionary keys or in hash sets must implement equality members. | ✔ | ❌ | ❌ |
| RH0502 | Types used for equality comparison must implement equality members. | ✔ | ❌ | ❌ |
| RH0503 | Use string interpolation instead of string concatenation. | ✔ | ❌ | ❌ |
| Analyzer | ||||
| RH0701 | reihitsu.json configuration must be valid. | ✔ | ❌ | ❌ |
| RH0702 | Documentation rules are currently not active for this project. | ✔ | ❌ | ❌ |
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 |
|---|---|---|
| 1.0.0-beta5 | 417 | 7/5/2026 |
| 1.0.0-beta4 | 449 | 6/29/2026 |
| 1.0.0-beta3 | 187 | 6/21/2026 |
| 1.0.0-beta2 | 249 | 6/17/2026 |
| 1.0.0-beta1 | 328 | 5/31/2026 |
| 0.21.0 | 243 | 5/17/2026 |
| 0.20.0 | 126 | 5/14/2026 |
| 0.19.2 | 113 | 5/3/2026 |
| 0.19.1 | 112 | 5/2/2026 |
| 0.19.0 | 106 | 5/1/2026 |
| 0.18.0 | 111 | 5/1/2026 |
| 0.17.1 | 145 | 4/26/2026 |
| 0.17.0 | 119 | 4/25/2026 |
| 0.16.0 | 154 | 4/19/2026 |
| 0.15.0 | 157 | 4/13/2026 |
| 0.14.0 | 142 | 4/4/2026 |
| 0.13.0 | 121 | 4/2/2026 |
| 0.12.1 | 138 | 3/14/2026 |
| 0.12.0 | 120 | 3/14/2026 |
| 0.11.1 | 136 | 2/28/2026 |
Loading failed