-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(chore): use a callable for defaults #559
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Changelog requirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
|
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.
Lazy loading them is a good idea.
We cannot just use a lambda otherwise cli arguments will be ignored and we will always load the default.
I remake a couple of tests and it seems, the issue occurs only when |
I reproduce the issue in a simplier app https://github.com/sileht/click-bug :
|
ThanksI am not sure I understand why user input does not always prevail when it is passed but I'll take a better look to find a fix. |
9e08c11
to
3f71a07
Compare
Without callables the defaults are evaluated on import which causes unexpected errors with other commands. This lazy load the defaults.
3f71a07
to
602da4b
Compare
Without a callable the defaults are evaluated on import which causes unexpected errors with other commands.