Skip to content

Docstrings containing backticks are not formatted #272

@maddenp-cu

Description

@maddenp-cu

I posted a comment in #243 but am not sure that will be seen since that issue is closed. I have

% docformatter --version
docformatter 1.7.5

and the fix from that issue appears to apply only to the first line and not to the description lines that follow, e.g.

% cat foo.py
def f():
    """
    Here is a sufficiently long docstring first line with a ``word`` wrapped in backticks which will be wrapped as expected.

    Here is a sufficiently long docstring description with a ``word`` wrapped in backticks which will not be wrapped as expected.
    """
    pass
% docformatter foo.py
% cat foo.py
def f():
    """
    Here is a sufficiently long docstring first line with a ``word`` wrapped in backticks which will
    be wrapped as expected.

    Here is a sufficiently long docstring description with a ``word`` wrapped in backticks which will not be wrapped as expected.
    """
    pass

Is this intended / am I doing it wrong?

Here's my config block in pyproject.toml:

[tool.docformatter]
black = true
in-place = true
make-summary-multi-line = true
pre-summary-newline = true
recursive = true
wrap-descriptions = 100
wrap-summaries = 100

Thanks in advance for any guidance, and thanks in general for this great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: styleRelates to docstring format style (e.g., Google, NumPy, Sphinx)P: bugPEP 257 violation or existing functionality that doesn't work as documentedU: mediumA relatively medium urgency issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions