maxcountryman / flask-login

Flask user session management.
https://flask-login.readthedocs.io/
MIT License
3.56k stars 799 forks source link

PEP8 cleanup #27

Closed maxcountryman closed 11 years ago

maxcountryman commented 12 years ago

Currently flask-login does not respect PEP8 conventions. It would be great to have this cleaned up perhaps adding a small script to test for PEP8 compliance via the PEP8 module a la rauth's test suite.

leafstorm commented 12 years ago

A PEP8 compliance test is actually a pretty good idea, but I'm not really seeing where Flask-Login currently violates PEP8 (or the Flask style guide for that matter). Can you provide some specific PEP8 violations?

maxcountryman commented 12 years ago
flask-login/flask_login.py:77:9: E125 continuation line does not distinguish itself from next logical line
flask-login/flask_login.py:133:80: E501 line too long (91 > 79 characters)
flask-login/flask_login.py:210:24: E127 continuation line over-indented for visual indent
flask-login/flask_login.py:344:5: E303 too many blank lines (2)
flask-login/flask_login.py:405:1: E302 expected 2 blank lines, found 1
flask-login/flask_login.py:530:80: E501 line too long (80 > 79 characters)
flask-login/flask_login.py:530:81: W291 trailing whitespace
flask-login/flask_login.py:532:1: W293 blank line contains whitespace
flask-login/example/login-example.py:13:29: E128 continuation line under-indented for visual indent
flask-login/example/login-example.py:14:29: E128 continuation line under-indented for visual indent
flask-login/example/login-example.py:16:1: E302 expected 2 blank lines, found 1
flask-login/example/login-example.py:53:1: E302 expected 2 blank lines, found 1
flask-login/example/login-example.py:60:1: E302 expected 2 blank lines, found 1
flask-login/tests/login.py:21:78: W291 trailing whitespace
flask-login/tests/login.py:31:1: E302 expected 2 blank lines, found 1
flask-login/tests/login.py:51:1: E302 expected 2 blank lines, found 1
flask-login/tests/login.py:54:1: E302 expected 2 blank lines, found 1
flask-login/tests/login.py:63:9: E301 expected 1 blank line, found 0
flask-login/tests/login.py:134:80: E501 line too long (85 > 79 characters)
flask-login/tests/login.py:146:80: E501 line too long (83 > 79 characters)
flask-login/tests/login.py:197:5: E301 expected 1 blank line, found 0
flask-login/tests/login.py:228:5: E301 expected 1 blank line, found 0
flask-login/tests/login.py:349:1: E302 expected 2 blank lines, found 1

Note that this is just a first pass, there are no doubt others that will be revealed during clean up (the script bails out and can miss subsequent violations).

leafstorm commented 12 years ago

Ah, okay. I suppose you literally can't see most of where Flask-Login violates PEP8. :-P

maxcountryman commented 12 years ago

Well it depends on your editor, but it's generally not necessarily visible on GitHub, sure. (It's pretty obvious via my vimrc on the other hand.) :)

maxcountryman commented 11 years ago

Fixed with tag 0.2.0.