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

Wrapping yield tag #253

Closed
jonyscathe opened this issue Jul 11, 2023 · 2 comments · Fixed by #254
Closed

Wrapping yield tag #253

jonyscathe opened this issue Jul 11, 2023 · 2 comments · Fixed by #254
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: enhancement Feature that is outside the scope of PEP 257 U: low A relatively low urgency issue

Comments

@jonyscathe
Copy link

Hi,
With the latest docformatter (1.7.4) any yield tags in my docstrings are being wrapped into the line above.

    """
    My test fixture.

    :param caplog: Pytest caplog fixture.
    :yield: Until test complete, then run cleanup.
    """

Turns into

    """
    My test fixture.

    :param caplog: Pytest caplog fixture. :yield: Until test complete, then run cleanup.
    """

I understand that yield is not part of the official Sphinx docstring spec, but we have adopted them as we use darglint to lint our docstrings and that flags a `DAR301 Missing "Yields" in Docstring" if we do not document our yield.
Plus it is good to be able to document what functions yield within their docstring.

I am running docformatter in a pre-commit hook with the following configuration:

  - repo: https://github.com/pycqa/docformatter
    rev: v1.7.4
    hooks:
      - id: docformatter
        args:
          - --black
          - --in-place
          - --pre-summary-newline
          - --wrap-summaries=120
          - --wrap-descriptions=120
@github-actions github-actions bot added the fresh This is a new issue label Jul 11, 2023
@weibullguy weibullguy added P: enhancement Feature that is outside the scope of PEP 257 C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) and removed fresh This is a new issue labels Jul 11, 2023
@github-actions github-actions bot added the U: low A relatively low urgency issue label Jul 11, 2023
This was referenced Jul 11, 2023
@weibullguy
Copy link
Member

@jonyscathe v1.7.5-rc1 should fix this if you want to give it a try.

@jonyscathe
Copy link
Author

@jonyscathe v1.7.5-rc1 should fix this if you want to give it a try.

Thanks for the quick fix. And yes, v1.7.5-rc1 fixes the issue.

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: enhancement Feature that is outside the scope of PEP 257 U: low A relatively low urgency issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants