Skip to main content

load

Function load 

Source
pub fn load(start: &Path) -> Result<Config, ConfigError>
Expand description

Load and merge configuration from standard locations.

Search order (first found wins for each layer):

  1. .marque.toml discovered by walking upward from start per contracts/cli.md. The walk stops at the first of:

    • a directory containing .marque.toml
    • a directory containing .git/ (git repository root)
    • the filesystem root

    If the walk finds a .marque.toml, that directory is the project root for both Layer 1 (committed) and Layer 2 (local). If the walk finds a git root or filesystem root first, no project config is loaded — Layer 3 (env vars) still runs.

  2. .marque.local.toml only in the same directory as the discovered .marque.toml. The local-config search is never independently walked, so a stray .marque.local.toml in a parent directory cannot silently attach to a child project’s config.

  3. Environment variables (MARQUE_CLASSIFIER_ID, MARQUE_CONFIDENCE_THRESHOLD, MARQUE_LOG).

Hard-fail validators run after merging all layers.