-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
refactor: use RegistryOrIndex
enum to replace two booleans
#12677
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move the validation upfront to clap
…wed registry The message is misleading and shouldn't proceed when `--index` presents.
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
A-cli
Area: Command-line interface, option parsing, etc.
A-interacts-with-crates.io
Area: interaction with registries
Command-init
Command-install
Command-login
Command-logout
Command-new
Command-owner
Command-publish
Command-search
Command-yank
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 15, 2023
Rustin170506
approved these changes
Sep 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
Thanks! @bors r=hi-rustin |
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 17, 2023
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 18, 2023
Update cargo 6 commits in d5336f813df39d476e61fc46daabb1446350660a..b4ddf95ad9954118ac0dae835f2966394ad04c02 2023-09-14 19:55:49 +0000 to 2023-09-18 03:48:09 +0000 - doc: differentiate defaults for split-debuginfo (rust-lang/cargo#12680) - feat(cli): Add '-n' to dry-run (rust-lang/cargo#12660) - feat: stabilize credential-process and registry-auth (rust-lang/cargo#12649) - refactor: use `RegistryOrIndex` enum to replace two booleans (rust-lang/cargo#12677) - doc: clarify caret requirements (rust-lang/cargo#12679) - feat(pkgid): Allow incomplete versions when unambigious (rust-lang/cargo#12614) r? ghost
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.
A-interacts-with-crates.io
Area: interaction with registries
Command-init
Command-install
Command-login
Command-logout
Command-new
Command-owner
Command-publish
Command-search
Command-yank
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
fn registry()
has two booleans representing--index
and--registry
respectively. However, they are inherently mutually exclusive and better to use a single sum typeRegistryOrIndex
to model them.How should we test and review this PR?
This PR is expected not to bring any behavior change. The only change is that the cli arg conflict detection is now moved to command line parsing phase (clap).
A new test
publish_failed_with_index_and_only_allowed_registry
demonstrates a quirky message was emitted whenpackage.publish = […]
contains the only one registry that trigger an implicit publish--index
arg was provided and took precedence over the implicit registry publishThis behavior should be fixed IMO but let's leave it to another PR.
Additional information