Add help string formatters that don't use escaped characters.
I'd love to use the \f and \b in my docstrings to have a single source of help text. However, Ruff D301 enforces PEP 257 which requires docstrings to be raw (r"""…""") if they have any backslashes in them. Doing that breaks the VS Code syntax highlighting to no longer treat the string as a docstring.
So, I've had to move documentation out of the docstring for the function and into the help argument, repeating the docstring first line, all because I want to use \b and \f to fight Click's helpful auto-formatting. Please add an additional formatting mechanism to support these functions. If I'm going to put visual garbage in my source file to get the formatting to behave, it would be nice if it were self-documenting, e.g.
@click.option(…)
@click.option(…)
def myfunc(cats: int = 0, feet: int = 0) -> None:
"""Does good stuff.
Here's more detailed information
on how this works.
<<click-preserve-whitespace>>
Examples:
# basic usage
$ myfunc
# overrides
$ myfunc --cats 1 --feet 17
<<click-end-help>>
Args:
cats: Number of cats to assume prowling around.
feet: How far cats can jump during attacks.
"""
pass
Click is a long standing project that has been using \b and \f for a very long time. I would suggest turning off Ruff D301 or seeing if there is a VS code setting you can alter. Is there something I am missing ? @kdeldycke