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)