yera.config.inspection

Inspect the global Yera configuration without applying runtime resolution.

This module provides a narrow interface for determining whether the global yera.toml file exists and can be parsed. It does not load project-level overrides or resolve active profiles, providers, or models.

Symbols

class ConfigInspection — Result of inspecting the global Yera configuration file.
class ConfigStatus — State of the global Yera configuration file.
def inspect_yera_toml — Inspect the global Yera configuration file.

ConfigInspection

Result of inspecting the global Yera configuration file.

Attributes

path
type: Path

Resolved path inspected by the operation.

status
type: ConfigStatus

State determined from file existence, TOML parsing, and schema validation.

data
type: dict[str, TomlValue] | None

Parsed TOML data when parsing succeeds; otherwise None.

section
type: str | None

Top-level section that failed schema validation; otherwise None.

error
type: str | None

Parsing or validation diagnostic when inspection fails; otherwise None.

ConfigStatus

Inherits: str, Enum

State of the global Yera configuration file.

Attributes

MISSING

The configured yera.toml path does not contain a file.

VALID

The file contains syntactically valid TOML.

MALFORMED

The file exists but cannot be parsed as TOML.

INVALID

The file contains valid TOML but invalid Yera configuration.

inspect_yera_toml

inspect_yera_toml() → ConfigInspection

Inspect the global Yera configuration file.

Resolves the global yera.toml path, checks whether the file exists, and parses its TOML content when present. Parse failures are represented in the returned result rather than raised.

Returns

type: ConfigInspection

The resolved path, inspection status, and any parsed data or parsing diagnostic.

Raises

OSError

If the file exists but cannot be accessed.