Skip to content

Refactor: remove the 'total_lines' variable from the 'trailing_blank_lines' check #1144

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

Closed
wants to merge 2 commits into from
Closed

Refactor: remove the 'total_lines' variable from the 'trailing_blank_lines' check #1144

wants to merge 2 commits into from

Conversation

jayaddison
Copy link

May resolve #1142.

@pablogsal
Copy link

Give us one week or so because we may change this upstream (although I want to reiterate that we don't really need to).

@asottile asottile closed this May 31, 2023
@jayaddison
Copy link
Author

Any interest in this as a cleanup despite the upstream fix, @asottile? (I'm guessing not, and will likely delete the branch/fork soon, but figured it'd be worth checking)

@asottile
Copy link
Member

asottile commented Jun 1, 2023

it has a correctness issue so probably not

(with blank line at end)

print(1)


print(2)


print(3)
$ python3 -m pycodestyle t.py
t.py:1:1: W391 blank line at end of file
t.py:2:1: W391 blank line at end of file
t.py:3:1: W391 blank line at end of file
t.py:4:1: W391 blank line at end of file
t.py:5:1: W391 blank line at end of file
t.py:6:1: W391 blank line at end of file
t.py:7:1: W391 blank line at end of file
t.py:8:1: W391 blank line at end of file

@jayaddison
Copy link
Author

Hehe, ok - yep, that definitely settles it. Thank you.

@jayaddison
Copy link
Author

(I did test it in combination with flake8-pyi, but evidently missed whatever issue that is. I might take another look, probably not though)

@jayaddison
Copy link
Author

It's because it runs once per-line, of course. Never mind, ignore me. I seem to be getting worse and worse at computers.

@jayaddison jayaddison deleted the issue-1142/line-tokenization branch June 1, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

W391: spurious warnings with python 3.12 beta
3 participants