Documentation
¶
Overview ¶
Package settings provides shared helpers for coercing rule-configuration values decoded from YAML/CUE into Go types.
Rule packages receive untyped settings maps (e.g. from `.mdsmith.yml` overrides). YAML numbers may decode as int, float64, or int64 depending on source; YAML sequences decode as []any. These helpers give every rule one coercion implementation with consistent behavior and a single set of tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToFloat ¶
ToFloat coerces v to a float64 when v is float64, int, or int64. NaN and +/-Inf are rejected. Other types are rejected.
func ToInt ¶
ToInt coerces v to an int when v is int, int64, or float64. Float inputs are truncated toward zero. NaN, +/-Inf, and float values outside the int range are rejected (ok=false).
func ToStringSlice ¶
ToStringSlice coerces v to a []string when v is []string or a []any containing only strings. The returned slice is always a fresh copy so callers can mutate it without affecting the input. Other types (including strings) are rejected.
Types ¶
This section is empty.