ReflectionFormattingAnalyzerModule

PackageAxial.Guardrails
The `ReflectionFormatting` analyzer: flags formatting that relies on F#'s reflection-based structured printer, which fails at run time under NativeAOT and full trimming. F# unions and records get a compiler-generated `ToString()` that calls `sprintf "%+A"`. FSharp.Core's own option, voption, list, Result, Choice, Map and Set override `ToString()` but print their contents the same way. `%A`/`%O` walk the value with `FSharp.Reflection`. NativeAOT strips the metadata this needs, so the call throws — for example `KeyNotFoundException` from `FSharpValue.GetUnionFields` — and the build gives no warning, because the reflection happens inside FSharp.Core, whose trim warnings are reported once for the whole assembly. Formatting a type parameter is flagged too: it is only as safe as whatever type is substituted, and a generic helper like `Cause.prettyPrint string` is exactly where a union slips in unnoticed. Render such values explicitly instead (a `describe`/`render` function or a hand-written `ToString` override).

Summary

NameSignatureSynopsis
Operations
rawRangesWithNativeAotrawRangesWithNativeAot nativeAot ctxNo description available.
analyzeWithNativeAotanalyzeWithNativeAot nativeAot ctxNo description available.
analyzeanalyze ctxNo description available.
reflectionFormattingAnalyzerreflectionFormattingAnalyzer ctxNo description available.

Operations

kind:member

rawRangesWithNativeAot

rawRangesWithNativeAot nativeAot ctx
Member

Parameters

NameTypeDescription
nativeAotbool
ctxCliContext

Returns

range list
kind:member

analyzeWithNativeAot

analyzeWithNativeAot nativeAot ctx
Member

Parameters

NameTypeDescription
nativeAotbool
ctxCliContext

Returns

Message list
kind:member

analyze

analyze ctx
Member

Parameters

NameTypeDescription
ctxCliContext

Returns

Message list
kind:member

reflectionFormattingAnalyzer

reflectionFormattingAnalyzer ctx
Member

Parameters

NameTypeDescription
ctxCliContext

Returns

Async<Message list>