gh-142389: Add support for backtick colorisation in argparse help text#149375
gh-142389: Add support for backtick colorisation in argparse help text#149375hugovk merged 8 commits intopython:mainfrom
Conversation
Documentation build overview
|
savannahostrowski
left a comment
There was a problem hiding this comment.
I think there's one edge case here that we haven't considered...and should before extending this to help text. Poking around on GitHub, flake8 uses double backticks to denote code in help text (I also found at least one instance of this in pytest as well but it's not as pervasive). So, right now, with these changes users would see something like this, where there are funky stray backticks and incorrect colouring:
I think if we apply the new regex, update the docs and add a test or two, that should have us covered.
Other than that, I think this looks good. My preference would be to land this feature and then land application of backticks in a separate PR though (i.e. we can leave libregrtest changes for another PR?)
|
When you're done making the requested changes, leave the comment: |
Co-authored-by: Savannah Ostrowski <savannah@python.org>
This reverts commit d8f6526.
|
Updated docs, docstring and added tests. Removed the regrtest change, will be in a followup with other stdlib stuff. I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @savannahostrowski: please review the changes made to this pull request. |
There's a separate issue for this somewhere, and maybe even a PR? |
Please see PR #149384. |
savannahostrowski
left a comment
There was a problem hiding this comment.
Sweeeeet!
Thank Hugo!


#142390 added support for displaying text enclosed in backticks in colour for the help description and epilogue.
This PR adds it for individual help.
Also add backticks to
python -m test --help:Will add to other stdlib CLIs in a followup.