From 39537f4372a7fcd5c8639c65fe574ba09d996ad8 Mon Sep 17 00:00:00 2001 From: Harsh Pratap Singh Date: Tue, 26 Aug 2025 16:56:10 +0530 Subject: [PATCH] format {version} on failure (#15527) ## Summary Fixes #15512 ## Test Plan Manually tested : ``` ~/uv/target/release/uv format --version 999.999.999 --preview-features format error: Failed to install ruff 999.999.999 Caused by: Failed to download from: https://github.com/astral-sh/ruff/releases/download/999.999.999/ruff-x86_64-unknown-linux-gnu.tar.gz Caused by: HTTP status client error (404 Not Found) for url (https://github.com/astral-sh/ruff/releases/download/999.999.999/ruff-x86_64-unknown-linux-gnu.tar.gz) ``` --- crates/uv/src/commands/project/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/uv/src/commands/project/format.rs b/crates/uv/src/commands/project/format.rs index 5cd47806c..7ec3b1967 100644 --- a/crates/uv/src/commands/project/format.rs +++ b/crates/uv/src/commands/project/format.rs @@ -59,7 +59,7 @@ pub(crate) async fn format( let version = version.as_ref().unwrap_or(&default_version); let ruff_path = bin_install(Binary::Ruff, version, &client, &cache, &reporter) .await - .context("Failed to install ruff {version}")?; + .with_context(|| format!("Failed to install ruff {version}"))?; let mut command = Command::new(&ruff_path); // Run ruff in the project root