topmark.runtime.writer_options¶
topmark / runtime / writer_options
Persisted writer options loaded from TopMark TOML sources.
This module defines the non-layered writer preferences that may be authored in the
same TOML document as layered TopMark configuration. These options are resolved
separately from FrozenConfig and do not
participate in config-layer merging.
WriterOptions
dataclass
¶
Persisted writer preferences parsed from TOML.
Attributes:
| Name | Type | Description |
|---|---|---|
file_write_strategy |
FileWriteStrategy | None
|
Preferred file write strategy declared in the
|
apply_resolved_writer_options ¶
Overlay resolved persisted writer preferences onto runtime options.
Persisted writer preferences are applied only when the invocation has not already selected a conflicting execution-only output mode.
Precedence
- explicit runtime output routing (for example STDOUT)
- explicit runtime file write strategy
- resolved TOML writer preference
- otherwise keep the original runtime options unchanged
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_options
|
RunOptions
|
Execution-only runtime options for the current run. |
required |
writer_options
|
WriterOptions | None
|
Resolved persisted writer preferences, if any. |
required |
Returns:
| Type | Description |
|---|---|
RunOptions
|
Runtime options with the resolved writer preference applied when doing |
RunOptions
|
so does not conflict with explicit runtime intent. |
Source code in src/topmark/runtime/writer_options.py
writer_options_to_toml_table ¶
Convert resolved writer options into a TopMark TOML table fragment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
writer_options
|
WriterOptions | None
|
The writer options to render as TOML. |
required |
Returns:
| Type | Description |
|---|---|
TomlTable
|
A TopMark TOML table fragment containing a |
TomlTable
|
writer options are present, or an empty table otherwise. |
Note
Export-only convenience for configuration dumps, documentation, and snapshots. Pairs with topmark.config.io.serializers.config_to_topmark_toml_table.