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
Soften some edges on help text behavior (rebooted) #611
Conversation
Sorry for opening so many pull requests recently, it's not my goal to overload the maintainer(s) with work. My main motivation was fixing #409 and the others are just attempts to get some low-hanging-fruit issues closed. |
opts["help"] = self.help[name] | ||
help_name_key = name if name in self.help else opts.get("attr_name") | ||
if help_name_key in self.help: | ||
opts["help"] = self.help.pop(help_name_key) |
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.
On line 61 above, we could perhaps use self.help = help.copy() if help else {}
rather than help directly, in case someone is passing the same help dictionary to multiple decorators to avoid copy-pasting
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.
About to read all this over myself, but I think I agree; that sort of defensive/functional-style programming is something I am frequently worrying about but not always finding the time to actually implement 🙃
Looking at this now with an eye for getting it out in 1.5. |
This is a rebase of #580, with added tests.
The original #580 failed on Travis due to code formatting (
black
).New tests:
Fixes #398 Bug report: no error on mismatched help keys and task arguments
Fixes #409 Bug report: help text on parameters with underscore
Closes #533 Duplicate bug report to #409
Closes #590 Duplicate feature request to #409
Closes #580 Original merge request