Skip to main content

validation_options_from_options

Function validation_options_from_options 

Source
pub fn validation_options_from_options(options: &Options) -> ValidationOptions
Expand description

Shared option→validation mapping and document-dir resolution — single source of truth so the LSP/MCP diagnostics cannot drift from check (issue #1648). Map loader Options to rustledger_validate::ValidationOptions.

The single source of truth for the option-derived validation settings: custom account-type names (name_*) and the tolerance options (inferred_tolerance_default, inferred_tolerance_multiplier, infer_tolerance_from_cost). Path-relative settings (document directories) and the effective booking method are layered on by callers that hold the necessary context — see build_validation_options.

Both rledger check (via build_validation_options) and the LSP/MCP diagnostics path call this, so the two cannot drift. Issue #1648 was exactly that drift: the LSP built its own ValidationOptions that dropped the tolerance options, so it reported residual errors check did not.