refactor: use RegistryOrIndex enum to replace two booleans#12677
Merged
bors merged 4 commits intorust-lang:masterfrom Sep 17, 2023
Merged
refactor: use RegistryOrIndex enum to replace two booleans#12677bors merged 4 commits intorust-lang:masterfrom
RegistryOrIndex enum to replace two booleans#12677bors merged 4 commits intorust-lang:masterfrom
Conversation
Move the validation upfront to clap
…wed registry The message is misleading and shouldn't proceed when `--index` presents.
Collaborator
|
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
Contributor
|
Thanks! @bors r=hi-rustin |
Contributor
Contributor
Contributor
|
☀️ 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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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--indexand--registryrespectively. However, they are inherently mutually exclusive and better to use a single sum typeRegistryOrIndexto 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_registrydemonstrates a quirky message was emitted whenpackage.publish = […]contains the only one registry that trigger an implicit publish--indexarg 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