Move --help option defaults from its class to its decorator#2840
Move --help option defaults from its class to its decorator#2840Rowlando13 merged 1 commit intopallets:mainfrom kdeldycke:help-option-fix
--help option defaults from its class to its decorator#2840Conversation
--help option defaults from its class to its decorator
Remove custom HelpOption class. Refs: pallets/click#2563 pallets/click#2832 pallets/click#2840
|
Can you rebase this on stable then we can include this in 8.1.9? I assume we can keep this in 8.2.0, though we'll need to document it. |
|
Yes! I can rebase it to 8.1.9. I was targeting 8.2.0 as I didn't know if a 8.1.9 would see the light of day given that 8.2.0 seems imminent. Also, something I realized, when #2563 was merged back into Lines 1028 to 1035 in 8fcf9b0 So I felt like this PR, by targeting |
|
Approved with the suggestions I just commented. |
Removes `click.decorators.HelpOption` class. Closes #2832. # Conflicts: # CHANGES.rst
|
I just merged the changes proposed by @davidism and rebase this PR on top of All tests are passing but the So unless you have other issues to point to, I think this PR is ready to be merged upstream. |
This is a proposal to fix #2832, which points to a subtle change in behavior of the help option introduced in 8.1.8.
The root of the problem is that by deduplicating code in 8.1.8 (see: #2563), I introduced a
HelpOptionclass, to centralize the setup necessary to make a standardOptionbehave like an help option.In #2832, a user is relying on a custom class to feed the
@help_optiondecorator. This bypass all the custom setup made byHelpOption, and produce the discrepancy in behavior between 8.1.7 and 8.1.8.This PR:
HelpOptionclass@help_optionimplementation with the way Click is doing for the others (like@password_option,@version_option, ...)click.decorators.HelpOptionclass as a consequenceChecklist:
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.