C# / ROSLYN ANALYZERS
Make intent unmistakable.
Explicit null contracts. Meaningful test failures. Warning suppressions that explain themselves.
Wrangler puts practical guardrails where you write code, without hiding missing data behind fabricated defaults.
From your C# project folder, install the NuGet prerelease:
dotnet add package DotNetWrangler.Analyzers --prerelease
Individually configurable. Intentional exceptions welcome.
Instead of hiding missing data
public string Name { get; init; } = null!;
WRANGLER0002 Null-forgiving operator fabricates a non-null value
Express the contract
public required string Name { get; init; }
Find your starting point
A focused rule set, with the reasoning and the escape hatches documented.
Adopt at your pace
Choose a severity for each rule. Enable the optional pragma policies only when they fit your team.
Understand the diagnostic
See what triggers a rule, compare preferred code, and check framework-specific advice.
Keep exceptions explicit
Valid uses can still trigger a diagnostic. Document the reason with a narrow suppression, not a silent workaround.