From c7a5859e1770dbc7cbc7cb1785c34b880162dfac Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 23 Feb 2026 01:23:40 +0900 Subject: fix(global): add ~/.composer fallback, XDG auto-detection, and no-arg handling Rewrite composer_home() with Composer-compatible resolution: detect XDG environment (any XDG_* var or /etc/xdg), prefer existing directories, and fall back to ~/.composer for legacy systems. Consolidate duplicate composer_home_dir() from global.rs into shared config_helpers. Accept no subcommand gracefully with a helpful error instead of a parse error. Co-Authored-By: Claude Opus 4.6 --- crates/mozart-autoload/src/autoload.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'crates/mozart-autoload/src') diff --git a/crates/mozart-autoload/src/autoload.rs b/crates/mozart-autoload/src/autoload.rs index 8d59db5..97fb9b0 100644 --- a/crates/mozart-autoload/src/autoload.rs +++ b/crates/mozart-autoload/src/autoload.rs @@ -857,9 +857,10 @@ pub fn generate(config: &AutoloadConfig) -> anyhow::Result { ); for (class, path_expr) in scanned { if let Some(existing) = data.classmap.get(&class) - && existing != &path_expr { - ambiguous_found = true; - } + && existing != &path_expr + { + ambiguous_found = true; + } // Also generate the static expression // We store the dynamic expression in data.classmap; static_data.classmap // will be populated similarly. For now we insert into both. @@ -884,9 +885,10 @@ pub fn generate(config: &AutoloadConfig) -> anyhow::Result { psr_violations = violations; for (class, path_expr) in opt_dyn { if let Some(existing) = data.classmap.get(&class) - && existing != &path_expr { - ambiguous_found = true; - } + && existing != &path_expr + { + ambiguous_found = true; + } data.classmap.entry(class).or_insert(path_expr); } for (class, path_expr) in opt_static { -- cgit v1.3.1