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

Blank line removal incompatible with black #176

Closed
AntoineD opened this issue Apr 21, 2023 · 2 comments · Fixed by #177
Closed

Blank line removal incompatible with black #176

AntoineD opened this issue Apr 21, 2023 · 2 comments · Fixed by #177
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
Milestone

Comments

@AntoineD
Copy link
Contributor

If a class docstring contains a line that is too long and cannot be reformatted, passing flake8 can be done by appending a #noqa to the docstring.
The following was not modified with docformatter 1.5.1 and black when triggered by pre-commit:

class C:
    """Class.""" #noqa

    attr: int
    """Attr."""

With docformatter 1.6.1, this is changed to:

class C:
    """Class.""" #noqa
    attr: int
    """Attr."""

and pre-commit always fails because docformatter and black both apply opposite changes.

This behavior is triggered by the comment appended to the docstring.

@github-actions github-actions bot added the fresh This is a new issue label Apr 21, 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 C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) and removed fresh This is a new issue C: convention Relates to docstring format convention labels Apr 22, 2023
@AntoineD
Copy link
Contributor Author

Thank you very much!
When do you plan to release it?

@weibullguy
Copy link
Member

Well, if I hadn't forgotten to git pull on the master branch after merging the PR that fixed this problem, it would've been part of v1.6.1! 🤦🏻‍♂️ I just released v1.6.2 with this fix.

@weibullguy weibullguy added this to the v1.7.0 milestone Apr 28, 2023
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants