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

ruff check fix E305 "blank-lines-after-function-or-class" adds incorrectly placed newlines. #11508

Closed
kaddkaka opened this issue May 23, 2024 · 0 comments · Fixed by #12606
Closed
Assignees
Labels
bug Something isn't working

Comments

@kaddkaka
Copy link

kaddkaka commented May 23, 2024

ruff check fix E305 "blank-lines-after-function-or-class" adds incorrectly placed newlines in ruff version 0.4.4

input code:

class A:
    pass

# ====== Cool constants ========
BANANA = 100
APPLE = 200

cmd: ruff check --fix --select=E305 tmp.py --isolated --preview

output:

class A:
    pass

# ====== Cool constants ========


BANANA = 100
APPLE = 200

Expected output:

class A:
    pass


# ====== Cool constants ========
BANANA = 100
APPLE = 200

Could this rule mistakenly identifying the comment as belonging to the class even if the indentation should tell otherwise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants