Mithril.Analyzers
0.1.1
dotnet add package Mithril.Analyzers --version 0.1.1
NuGet\Install-Package Mithril.Analyzers -Version 0.1.1
<PackageReference Include="Mithril.Analyzers" Version="0.1.1" />
<PackageVersion Include="Mithril.Analyzers" Version="0.1.1" />
<PackageReference Include="Mithril.Analyzers" />
paket add Mithril.Analyzers --version 0.1.1
#r "nuget: Mithril.Analyzers, 0.1.1"
#:package Mithril.Analyzers@0.1.1
#addin nuget:?package=Mithril.Analyzers&version=0.1.1
#tool nuget:?package=Mithril.Analyzers&version=0.1.1
Mithril.Analyzers
Mithril.Analyzers is an MIT-licensed Roslyn analyzer package focused on backend maintainability guardrails and repository-informed architecture checks.
The first delivery wave stays intentionally small and conservative:
- V1 covers
BGA001toBGA005 - configuration lives in
.editorconfig - generated code is ignored by default
- the package is packed as analyzer-only content so consumers get no runtime dependency
Package Status
- Status: bootstrap in progress
- Current scope: V1 maintainability parity for oversized files, methods, accessors, async cancellation exposure, and
ContainsKeydouble lookups - Deferred to later phases:
BGA100+repository-informed architecture diagnostics
Rule Table
| ID | Title | Default severity | Primary config | Docs |
|---|---|---|---|---|
BGA001 |
File Too Long | warning |
mithril_analyzers.max_file_lines |
BGA001 |
BGA002 |
Method Too Long | warning |
mithril_analyzers.max_method_lines |
BGA002 |
BGA003 |
Accessor Too Long | warning |
mithril_analyzers.max_accessor_lines |
BGA003 |
BGA004 |
Async Method Should Expose Cancellation | suggestion |
mithril_analyzers.allow_missing_cancellation_for_tests |
BGA004 |
BGA005 |
Prefer TryGetValue |
suggestion |
n/a | BGA005 |
Install
Use the package as a build-only analyzer dependency:
<ItemGroup>
<PackageReference Include="Mithril.Analyzers" Version="0.1.0" PrivateAssets="all" />
</ItemGroup>
.editorconfig Example
[*.cs]
dotnet_diagnostic.BGA001.severity = warning
dotnet_diagnostic.BGA002.severity = warning
dotnet_diagnostic.BGA003.severity = warning
dotnet_diagnostic.BGA004.severity = suggestion
dotnet_diagnostic.BGA005.severity = suggestion
mithril_analyzers.max_accessor_lines = 60
mithril_analyzers.allow_missing_cancellation_for_tests = true
[src/**/*.cs]
mithril_analyzers.max_file_lines = 800
mithril_analyzers.max_method_lines = 100
[tests/**/*.cs]
mithril_analyzers.max_file_lines = 1000
mithril_analyzers.max_method_lines = 140
[tools/**/*.cs]
mithril_analyzers.max_file_lines = 800
mithril_analyzers.max_method_lines = 100
Suppression Examples
Use the normal Roslyn suppression surfaces when a diagnostic is intentionally not actionable:
#pragma warning disable BGA004
public Task<string> ExecuteAsync()
{
return Task.FromResult("intentionally non-cancellable");
}
#pragma warning restore BGA004
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Maintainability",
"BGA002:Method Too Long",
Justification = "Legacy orchestration remains until the module split ships.")]
Repository Layout
- src/Mithril.Analyzers contains production analyzers and shared helpers
- tests/Mithril.Analyzers.Tests contains Roslyn analyzer tests
- docs/architecture.md describes the project structure
- docs/migration-from-menees.md outlines the migration path away from
Menees.Analyzers
Development
dotnet restore Mithril.Analyzers.sln
dotnet build Mithril.Analyzers.sln --no-restore
dotnet test Mithril.Analyzers.sln --no-build
Releasing
Push a semver tag like v0.1.0 for a commit reachable from main after updating src/Mithril.Analyzers/Mithril.Analyzers.csproj and configuring the NUGET_API_KEY GitHub Actions secret. The Release Package GitHub Action validates the tag/version pair, builds and tests the solution, publishes the package to NuGet.org, and attaches the .nupkg to the matching GitHub Release.
See docs/releasing.md for the full checklist.
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 |
|---|---|---|
| 0.1.1 | 407 | 3/30/2026 |