Fixed inconsistency in forwarding params in Context.forward#1840
Merged
davidism merged 1 commit intopallets:masterfrom Apr 13, 2021
Merged
Fixed inconsistency in forwarding params in Context.forward#1840davidism merged 1 commit intopallets:masterfrom
davidism merged 1 commit intopallets:masterfrom
Conversation
Member
|
It seems a little weird to treat all kwargs as params, since |
2bc5547 to
0435112
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context.forwardusesContext.paramsto fill in the options and passes thekwargstoContext.invokewhich creates a newContextfor the sub-command but doesn't pass the params to the newContextnor does it remove unusedkwargs.From the example mentioned in the issue, now a union of params from the context and sub-context will be forwarded.
For e.g. - If
command_1has optionsa and bandcommand_2has optionsa and c, command_1 forwards to command_2, thencommand_2will receivea, b and caskwargs.I was unsure whether or not to remove the unused options, so I've kept them for now.
Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.