Muonroi.CodeStandards
2.0.2
dotnet add package Muonroi.CodeStandards --version 2.0.2
NuGet\Install-Package Muonroi.CodeStandards -Version 2.0.2
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="Muonroi.CodeStandards" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Muonroi.CodeStandards" Version="2.0.2" />
<PackageReference Include="Muonroi.CodeStandards" />
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 Muonroi.CodeStandards --version 2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Muonroi.CodeStandards, 2.0.2"
#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 Muonroi.CodeStandards@2.0.2
#: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=Muonroi.CodeStandards&version=2.0.2
#tool nuget:?package=Muonroi.CodeStandards&version=2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Muonroi.CodeStandards
Roslyn analyzers ensuring strict adherence to the Muonroi coding guidelines.
Overview
Provides a suite of Roslyn-based analyzers and code fixes, such as Mstd0001_ForbiddenThrowAnalyzer, Mstd0002_NullForgivingAnalyzer, and Mstd0003_LoggingViaMLogAnalyzer.
Features
- Strict Exception Handling:
Mstd0001_ForbiddenThrowAnalyzerensures proper exception types are thrown. - Null Safety:
Mstd0002_NullForgivingAnalyzerandMstd0002_NullForgivingCodeFixlimit the use of the null-forgiving operator (!). - Logging Standards:
Mstd0003_LoggingViaMLogAnalyzerenforces logging through the standard MLog structure. - Guard Rails:
Mstd0004_DirectMGuardBypassAnalyzerensuresMGuardis used appropriately.
Installation
dotnet add package Muonroi.CodeStandards
Quick Start
<PackageReference Include="Muonroi.CodeStandards" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Ecosystem Combinations
- With Muonroi.Core: Enforces the usage of
MGuardinstead of standard exceptions when developing core services. - Full Stack Example:
// The analyzer will flag this if standard throw is used instead of MGuard
// throw new Exception("Error"); -> MGuard.NotNull(value, nameof(value));
Samples
Check out the Samples directory for full examples.
License
MIT
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.