Skip to content

Commit b63aaf8

Browse files
committed
Do not allow uv add --group ... --script
1 parent cb9499c commit b63aaf8

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,7 +3404,12 @@ pub struct AddArgs {
34043404
/// Add the requirements to the development dependency group.
34053405
///
34063406
/// This option is an alias for `--group dev`.
3407-
#[arg(long, conflicts_with("optional"), conflicts_with("group"))]
3407+
#[arg(
3408+
long,
3409+
conflicts_with("optional"),
3410+
conflicts_with("group"),
3411+
conflicts_with("script")
3412+
)]
34083413
pub dev: bool,
34093414

34103415
/// Add the requirements to the package's optional dependencies for the specified extra.
@@ -3418,7 +3423,12 @@ pub struct AddArgs {
34183423
/// Add the requirements to the specified dependency group.
34193424
///
34203425
/// These requirements will not be included in the published metadata for the project.
3421-
#[arg(long, conflicts_with("dev"), conflicts_with("optional"))]
3426+
#[arg(
3427+
long,
3428+
conflicts_with("dev"),
3429+
conflicts_with("optional"),
3430+
conflicts_with("script")
3431+
)]
34223432
pub group: Option<GroupName>,
34233433

34243434
/// Add the requirements as editable.
@@ -3547,11 +3557,21 @@ pub struct RemoveArgs {
35473557
pub dev: bool,
35483558

35493559
/// Remove the packages from the project's optional dependencies for the specified extra.
3550-
#[arg(long, conflicts_with("dev"), conflicts_with("group"))]
3560+
#[arg(
3561+
long,
3562+
conflicts_with("dev"),
3563+
conflicts_with("group"),
3564+
conflicts_with("script")
3565+
)]
35513566
pub optional: Option<ExtraName>,
35523567

35533568
/// Remove the packages from the specified dependency group.
3554-
#[arg(long, conflicts_with("dev"), conflicts_with("optional"))]
3569+
#[arg(
3570+
long,
3571+
conflicts_with("dev"),
3572+
conflicts_with("optional"),
3573+
conflicts_with("script")
3574+
)]
35553575
pub group: Option<GroupName>,
35563576

35573577
/// Avoid syncing the virtual environment after re-locking the project.

0 commit comments

Comments
 (0)