Skip to content

Improved error message for versions prefixed with v #15484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 4, 2025

Conversation

Pyr0de
Copy link
Contributor

@Pyr0de Pyr0de commented May 3, 2025

What does this PR try to resolve?

  • Added an error message when version in CRATE[@<VER>] or --version <VER> starts with 'v' for install, add, yank and update --precise <VER>
  • Check if version is valid in cargo yank

Fixes #12331

How should we test and review this PR?

Added tests for each subcommand

@rustbot
Copy link
Collaborator

rustbot commented May 3, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. Command-add Command-install Command-yank S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks nice.

Would you mind following the atomic commit pattern the contributor guide suggests? Which we add a new test first than captures the current behavior, followed by the next commit containing both the fix and test change. That makes the behavior change more prominent.

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there is a way to reuse these logic, but given they are simple it is fine. Thank you!

@weihanglo weihanglo added this pull request to the merge queue May 4, 2025
Merged via the queue into rust-lang:master with commit 6cba807 May 4, 2025
25 checks passed
@Pyr0de Pyr0de deleted the issue-12331 branch May 4, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. Command-add Command-install Command-yank S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the error message when running cargo add cubing @v0.5.0
4 participants