-
Notifications
You must be signed in to change notification settings - Fork 122
Format multiline doc strings to match style of other help messages #1007
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
Conversation
Changed cmd2 do_cmd to dedent docstrings using `pydoc.getdoc`. This patch provides output for docstrings that look like using argparse or a single line docstring
@bambu Thanks for the PR. Can you please fix the @kmvanbrunt @anselor Do either of you have an opinion about the changes in this PR? It changes the way help is displayed, but it isn't clear to me if the change makes things better or worse or if its just neautral. |
@tleonhardt I would like some time to check out the effects of this PR. Unfortunately I've been sick, so I'll take a look when I'm well. |
@kmvanbrunt I don’t think there is any rush for merging this in. @bambu needs to fix the flake8 error(s) first anyways. So take your time. |
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
==========================================
+ Coverage 97.87% 97.89% +0.02%
==========================================
Files 22 22
Lines 4613 4616 +3
==========================================
+ Hits 4515 4519 +4
+ Misses 98 97 -1
Continue to review full report at Codecov.
|
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.
To me, the change appears neutral - better in some ways and worse in others. It doesn't seem to hurt anything. I'm pretty ambivalent in regards to whether we merge this in or reject it.
@kmvanbrunt @anselor @kotfu If any of you has an opinion, please weigh in. There is no rush to merge this, so lets gather input from all interested in providing it.
@bambu Thanks for fixing the minor flake8 error so the all of the continuous integration checks can pass. |
@tleonhardt it is definitely a minor change. I primarily like the consistency of having the same amount of indentation whether you are using argparse or a docstring. IMHO it also looks odd when the docstring itself has some indentation. In these cases there are multiple levels of indentation and usually inconsistent spacing. Also, no rush on the merge |
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.
Changes look good.
TravisCI appears to potentially broken for us today. If its a temporary thing fine. If not, we might need to look into our configuration and/or moving to GitHubActions.
Changed cmd2 do_cmd to dedent doc strings using
pydoc.getdoc
in order for the output of multi-line doc strings to look similar to argparse or a single line doc string. It continues prioritizinghelp_func
functions over doc strings.Before patch:
After patch: