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 at end of file #40
Comments
pep8.py correctly detects '\n\n' at end of file with warning W391. |
I've installed pep8 0.7.0 from PyPI. Then I did: $ echo -en '\n' > /tmp/test.py So pep8 from PyPI still has this problem |
You did not do the right test.
|
Right. So I close the issue. |
PEP8 doesn't require that files are ending with blank lines - http://www.python.org/dev/peps/pep-0008/ |
Yes, Vim treats \n as end of line, not as carriage return like in many editors. So I may type one symbol less - less typing - less work :-) |
Actually it is more typing, because without \n\n in Vim you can not just go to the end of file an press enter. You enter will at the start of the last line. It suxx that PEP8 validator forces everybody to this annoyance. |
You can type o command to start new line after you go to the end of file |
Yes, I can, but I forget all the time. |
And still PEP8 doesn't require that files should not end with blank lines. |
I understand each developer has its habits. If you like, you can pass |
Of course developers have habits. Why make it more harder for other people if doesn't make any difference for yourself? Will the presence of \n\n endspace instead of \n bug you more than absence of \n\n bugs me, DXist and other people? You still can apply your rule to count('\n') > 2 |
W391 is annoying. |
@jorgesumle So turn it off? I find it useful. |
I remember there was some unix story about those linefeeds at the end of file, so this must be some unix kludge from the past and now is a cargo ritual. =) |
Nice point from http://stackoverflow.com/questions/5813311/no-newline-at-end-of-file
So the last new line is important for diff tools (including Github) and must have for C/C++. I guess early C development toolchain incorrectly handled the last line without line terminator symbols. I think new line at the end of file is a part of best practices and I dislike editors/IDEs that don't put last new line by default. Rituals support common and clear coding style. |
What is more 'pythonic' - to leave blank line at end of file or not? Most tools require blank line at end of file. There is no ugly message "\ No newline at end of file" in diff output. Why does pep8 tool require no blank lines at end of file?
The text was updated successfully, but these errors were encountered: