Skip to content
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

non-chained group invoked without subcommand invokes result callback #1621

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

IamCathal
Copy link
Contributor

@IamCathal IamCathal commented Jul 6, 2020

As mentioned in #1178 this behavior is actually desired. I believe that the changes to the comments seem to do the job but I am not 100%. Apart from that the simple code fix I made I'm not too sure if more changes are needed else where where result callbacks are referenced.

Added a simple test to show the functionality with my addition.

fixes #1178

src/click/core.py Outdated Show resolved Hide resolved
@IamCathal IamCathal force-pushed the result-callback-invocation-1178 branch from 95c0399 to 7b763f7 Compare August 5, 2020 13:50
@IamCathal
Copy link
Contributor Author

Rebased commits and added changelog entry

@davidism davidism force-pushed the result-callback-invocation-1178 branch from 7b763f7 to 32ddbb1 Compare August 5, 2020 15:07
@davidism
Copy link
Member

davidism commented Aug 5, 2020

Changed so regular groups invoke the result callback with None, while chained groups invoke it with []. Parametrized the test to test both cases.

@davidism davidism added this to the 8.0.0 milestone Aug 5, 2020
@davidism davidism added the f:chain feature: chained commands label Aug 5, 2020
@davidism davidism changed the title Add result callback invocation for subcommands non-chained group invoked without subcommand invokes result callback Aug 5, 2020
@davidism davidism merged commit 6271cee into pallets:master Aug 5, 2020
@IamCathal IamCathal deleted the result-callback-invocation-1178 branch August 5, 2020 15:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f:chain feature: chained commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resultcallback is not being called when invoke_without_command=True
3 participants