diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 80cd4ca77..f4850ac21 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -3753,7 +3753,7 @@ pub struct LockArgs { /// missing or needs to be updated, uv will exit with an error. /// /// Equivalent to `--locked`. - #[arg(long, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade", "locked"])] + #[arg(long, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade"], overrides_with = "check")] pub check: bool, /// Check if the lockfile is up-to-date. @@ -3762,7 +3762,7 @@ pub struct LockArgs { /// missing or needs to be updated, uv will exit with an error. /// /// Equivalent to `--check`. - #[arg(long, env = EnvVars::UV_LOCKED, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade", "check"], hide = true)] + #[arg(long, env = EnvVars::UV_LOCKED, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade"], hide = true)] pub locked: bool, /// Assert that a `uv.lock` exists without checking if it is up-to-date. diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index 5810b9e44..e2fb3ebb7 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -13392,6 +13392,19 @@ fn check_outdated_lock() -> Result<()> { Resolved 2 packages in [TIME] The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`. "); + + // Providing both `--check` and `--locked` is okay + uv_snapshot!(context.filters(), context.lock() + .arg("--check").arg("--locked"), @r" + success: false + exit_code: 1 + ----- stdout ----- + + ----- stderr ----- + Resolved 2 packages in [TIME] + The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`. + "); + Ok(()) }