yera.config.loaders.settings

Settings loader — merges and validates settings from both config sources.

Symbols

def load_and_validate_settings — Load settings from pyproject.toml and yera.toml, then validate.

load_and_validate_settings

load_and_validate_settings(
    fatal: bool = True,
) → Settings | None

Load settings from pyproject.toml and yera.toml, then validate.

Resolution order per field: pyproject.toml → yera.toml → model default.

Only keys matching Settings model fields are extracted from [tool.yera]; other keys (e.g. hub) are ignored.

Parameters

fatal
type: bool = True

Whether invalid settings should raise instead of returning None.

Returns

type: Settings | None

The merged validated settings, or None when validation is non-fatal and fails.