From d52cd1d0a36e89cde576c574b7ad8a990d497238 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Fri, 5 Jun 2026 11:52:14 +0200 Subject: [PATCH] feat(config): attribute layered config errors to their layer's file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap the global/project layer loads with file context (in global config / in project config ) so a strict v1 error names which file is at fault — a loud, attributable failure across layers (invariant 13). The single-layer load_config_in path keeps its raw message (one obvious file). Pairs with the layer-prefixed deprecation warnings the layered loader already surfaces. --- crates/omnigraph-config/src/lib.rs | 45 ++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/crates/omnigraph-config/src/lib.rs b/crates/omnigraph-config/src/lib.rs index 31b1f2d..c87e89c 100644 --- a/crates/omnigraph-config/src/lib.rs +++ b/crates/omnigraph-config/src/lib.rs @@ -5,7 +5,7 @@ use std::fs; use std::path::{Path, PathBuf}; use clap::ValueEnum; -use color_eyre::eyre::{Result, bail, eyre}; +use color_eyre::eyre::{Result, WrapErr, bail, eyre}; use serde::{Deserialize, Serialize}; mod merge; @@ -1118,6 +1118,8 @@ fn load_config_in(cwd: &Path, config_path: Option<&PathBuf>) -> Result load_single_layer(cwd, &path), None => { let mut config = OmnigraphConfig::default(); @@ -1132,6 +1134,7 @@ fn load_config_in(cwd: &Path, config_path: Option<&PathBuf>) -> Result