Skip to content

updated yank error message#8697

Merged
bors merged 2 commits into
rust-lang:masterfrom
mikastiv:pr-8695
Sep 15, 2020
Merged

updated yank error message#8697
bors merged 2 commits into
rust-lang:masterfrom
mikastiv:pr-8695

Conversation

@mikastiv

@mikastiv mikastiv commented Sep 10, 2020

Copy link
Copy Markdown
Contributor

Fixes #8695

@rust-highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2020
@Eh2406

Eh2406 commented Sep 10, 2020

Copy link
Copy Markdown
Contributor

I think there will probably need to be tests updated. If not then we will need to figure out how to add a test.

@ehuss What do you think of the new text?

@ehuss

ehuss commented Sep 12, 2020

Copy link
Copy Markdown
Contributor

Perhaps .required(true) can just be added to the --vers flag and let clap handle it. That would make the help text better (it explicitly shows --vers is required), and the error would look like this:

error: The following required arguments were not provided:
    --vers <VERSION>

USAGE:
    cargo yank [OPTIONS] --vers <VERSION> [--] [crate]

For more information try --help

@mikastiv

mikastiv commented Sep 12, 2020

Copy link
Copy Markdown
Contributor Author

This works better and is a good idea, but now the test alt_registry::bad_registry_name fails because it expects the --vers argument. Should I remove yank cmd from this test? Or maybe I put the required at the wrong place

@mikastiv

Copy link
Copy Markdown
Contributor Author

It works using .required_unless("registry"). Would this be a good option?

@ehuss

ehuss commented Sep 12, 2020

Copy link
Copy Markdown
Contributor

You can just put in a bogus version to fix that test, like this:

diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
index f9129e284..c3ed37633 100644
--- a/tests/testsuite/alt_registry.rs
+++ b/tests/testsuite/alt_registry.rs
@@ -637,7 +637,7 @@ Caused by:
         "owner",
         "publish",
         "search",
-        "yank",
+        "yank --vers 1.2.3",
     ] {
         p.cargo(cmd)
             .arg("--registry")

@mikastiv

Copy link
Copy Markdown
Contributor Author

Alright I did it.

@ehuss

ehuss commented Sep 15, 2020

Copy link
Copy Markdown
Contributor

Thanks!
@bors r+

@bors

bors commented Sep 15, 2020

Copy link
Copy Markdown
Contributor

📌 Commit 51fa3a4 has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2020
@bors

bors commented Sep 15, 2020

Copy link
Copy Markdown
Contributor

⌛ Testing commit 51fa3a4 with merge 8777a6b...

@bors

bors commented Sep 15, 2020

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 8777a6b to master...

@bors bors merged commit 8777a6b into rust-lang:master Sep 15, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 15, 2020
Update cargo

6 commits in 875e0123259b0b6299903fe4aea0a12ecde9324f..8777a6b1e8834899f51b7e09cc9b8d85b2417110
2020-09-08 20:17:21 +0000 to 2020-09-15 19:11:03 +0000
- updated yank error message (rust-lang/cargo#8697)
- Fix non-determinism with new feature resolver. (rust-lang/cargo#8701)
- Display formatted output for JSON diffing in tests. (rust-lang/cargo#8692)
- Add --name suggestion for cargo new (rust-lang/cargo#8675)
- Sweep unrelated message from unnecessary workspace infromation (rust-lang/cargo#8681)
- Docs: Make it more clear we have two types of workspaces (rust-lang/cargo#8666)
@mikastiv mikastiv deleted the pr-8695 branch September 22, 2020 22:26
@ehuss ehuss added this to the 1.48.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo yank's error message should be clearer

5 participants