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

Invalid removal of black lines for function with only a docstring #173

Closed
Sillocan opened this issue Apr 4, 2023 · 3 comments · Fixed by #171
Closed

Invalid removal of black lines for function with only a docstring #173

Sillocan opened this issue Apr 4, 2023 · 3 comments · Fixed by #171
Labels
C: convention Relates to docstring format convention P: bug PEP 257 violation or existing functionality that doesn't work as documented
Milestone

Comments

@Sillocan
Copy link

Sillocan commented Apr 4, 2023

Using docformatter==1.6.0, all blank lines are removed after a function with only a single line docstring.

i.e.

"""Here are some examples.

This module docstring should be dedented.
"""


def launch_rocket():
    """Launch the rocket."""

def factorial(x):
    """Return x factorial.

    This uses math.factorial.
    """
    import math
    return math.factorial(x)

is being parsed to

"""Here are some examples.

This module docstring should be dedented.
"""


def launch_rocket():
    """Launch the rocket."""
def factorial(x):
    """Return x factorial.

    This uses math.factorial.
    """
    import math
    return math.factorial(x)

This seems like a regression

@github-actions github-actions bot added the fresh This is a new issue label Apr 4, 2023
@weibullguy weibullguy added P: bug PEP 257 violation or existing functionality that doesn't work as documented C: convention Relates to docstring format convention and removed fresh This is a new issue labels Apr 5, 2023
@hofbi
Copy link

hofbi commented Apr 11, 2023

Could be related to #156

@weibullguy
Copy link
Member

@Sillocan tag v1.6.1-rc1 should have the fix you need if you're interested in giving it a try before I officially release v1.6.1.

@Sillocan
Copy link
Author

Sillocan commented Apr 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: convention Relates to docstring format convention P: bug PEP 257 violation or existing functionality that doesn't work as documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants