Safety Analyzers
Catch Result<T> and OneOf mistakes at compile time — 6 diagnostics and 3 code fixes.
Install once, protect your whole codebase.
dotnet add package REslava.Result.Analyzers
-
RESL1001 — Unsafe .Value
[Warning + Code Fix]Detects.Valueaccess without anIsSuccessguard. -
RESL1002 — Discarded Result
[Warning]Warns when aResult<T>return value is silently ignored. -
RESL1003 — Prefer Match
[Info]Suggests.Match()over manualif/elsewhen both branches use the result. -
RESL1004 — Async Not Awaited
[Warning + Code Fix]DetectsTask<Result<T>>assigned withoutawait. -
RESL1005 — Suggest Domain Error
[Info]Suggests domain-specific error types over genericnew Error("..."). -
RESL1006 — Conflicting Validate Attributes
[Error]Detects conflicting[Validate]and[FluentValidate]on the same type. -
RESL2001 — Unsafe OneOf.AsT*
[Warning + Code Fix]Detects.AsT1/.AsT2access without an.IsT1/.IsT2guard.