From c1cd212dd5a927d9e354c44d89a307f6a6f4df37 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 20 Mar 2026 15:34:55 -0500 Subject: [PATCH] Add a comment explaining the `lock --check` error handling (#18595) --- crates/uv/src/commands/project/lock.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index ae40a6909..3a72b9e59 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -253,6 +253,8 @@ pub(crate) async fn lock( Ok(ExitStatus::Success) } + // Lock mismatches from `--check`/`--locked` are expected validation failures. + // Handle them here so we return exit code 1 instead of bubbling up as an error (exit code 2). Err(err @ ProjectError::LockMismatch(..)) => { writeln!(printer.stderr(), "{}", err.to_string().bold())?; Ok(ExitStatus::Failure)