Skip to content

topmark.config package index

topmark / config

TopMark configuration API (public re-exports).

This package defines the configuration model and the utilities to normalize and resolve paths and pattern sources. The implementation is split for clarity:

Higher-level concerns (file discovery, TOML parsing/serialization, multi-layer load/merge) may live in dedicated modules (loader.py, discovery.py) and be re-exported here, keeping callers stable:

Config-validation diagnostics are represented internally as staged validation logs (validation_logs) on FrozenConfig / MutableConfig. Flattened diagnostics are no longer stored on the model and are instead derived at reporting and output boundaries.

from topmark.config.model import FrozenConfig
from topmark.config.model import MutableConfig
from topmark.config.types import PatternSource

Path resolution policy (summary): * Globs in config files → resolved relative to the config file directory. * Globs passed via CLI → resolved relative to the invocation CWD. * Path-to-file settings → resolved against their declaring source (config dir or CWD). * relative_to is used only for header metadata (e.g. file_relpath).

Immediate children in this package

topmark.config.io
Config-domain I/O helpers for TopMark.
topmark.config.machine
Machine-output support for config-related commands.
topmark.config.model
Configuration model and merge policy.
topmark.config.overrides
Apply internal config-like override intent to a resolved MutableConfig draft.
topmark.config.paths
Pure helpers for path normalization and PatternSource construction.
topmark.config.policy
Policy model for TopMark (global and per-file-type).
topmark.config.resolution
Layered config-resolution helpers for TopMark.
topmark.config.types
Lightweight config types and aliases.
topmark.config.validation
Stage-aware validation logs for config loading and preflight checks.