gh-142389: Add support for backtick colorisation in argparse help text#149375
gh-142389: Add support for backtick colorisation in argparse help text#149375hugovk wants to merge 3 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>
#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.