Skip to content
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

Docstrings containing backticks are not formatted #272

Open
maddenp-noaa opened this issue Dec 18, 2023 · 1 comment
Open

Docstrings containing backticks are not formatted #272

maddenp-noaa opened this issue Dec 18, 2023 · 1 comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue

Comments

@maddenp-noaa
Copy link

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!

@github-actions github-actions bot added the fresh This is a new issue label Dec 18, 2023
@weibullguy weibullguy added P: bug PEP 257 violation or existing functionality that doesn't work as documented C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) and removed fresh This is a new issue labels Dec 21, 2023
@github-actions github-actions bot added the U: medium A relatively medium urgency issue label Dec 21, 2023
@MrFizzyBubbs
Copy link

I am also encountering the same issue on version 1.7.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue
Projects
None yet
Development

No branches or pull requests

3 participants