diff --git a/crates/ruff_workspace/src/configuration.rs b/crates/ruff_workspace/src/configuration.rs index 1ef320cd20fe9..8b99965360bef 100644 --- a/crates/ruff_workspace/src/configuration.rs +++ b/crates/ruff_workspace/src/configuration.rs @@ -377,7 +377,7 @@ impl Configuration { .cache_dir .map(|dir| { let dir = shellexpand::full(&dir); - dir.map(|dir| PathBuf::from(dir.as_ref())) + dir.map(|dir| fs::normalize_path_to(dir.as_ref(), project_root)) }) .transpose() .map_err(|e| anyhow!("Invalid `cache-dir` value: {e}"))?,