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

D411: Missing blank line before section -- false positive #7216

Closed
pepoluan opened this issue Sep 7, 2023 · 0 comments · Fixed by #7351
Closed

D411: Missing blank line before section -- false positive #7216

pepoluan opened this issue Sep 7, 2023 · 0 comments · Fixed by #7351
Labels
docstring Related to docstring linting or formatting

Comments

@pepoluan
Copy link

pepoluan commented Sep 7, 2023

The code looks like this:

class JobProgress:
    """
    Tracks progress by generating job batches and recording the last issued job.
    
    Attributes
    ----------
        next_coordinate(int):
    """

Ruff D411 complains that a blank line must precede the Attributes section.

But as you can see, there is actually a blank line ... though it actually contains 4 spaces, this is due to the auto-indent feature of my IDE (PyCharm).

Such a line (containing only spaces) should not trigger D411 because visually they are the same.

I am using ruff 0.0.277 on Windows.

@charliermarsh charliermarsh added the docstring Related to docstring linting or formatting label Sep 12, 2023
charliermarsh added a commit that referenced this issue Sep 13, 2023
This better aligns with the definition of "blank line" that we use
throughout the docstring rules.

Closes #7216.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docstring Related to docstring linting or formatting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants