-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
E302 for multiline comment before class at beginning of file #108
Comments
In GitLab by @sigmavirus24 on Jun 26, 2015, 06:15 This is a bug in pep8. Please check for already opened bug reports before filing a new one. ~ ❯❯❯ cat foo.py; pep8 foo.py
# comment comment comment comment comment comment comment comment comment
# comment
class Foo(object):
pass
foo.py:3:1: E302 expected 2 blank lines, found 0 |
In GitLab by @dradetsky on Jun 26, 2015, 08:11 Sorry. Found issue PyCQA/pycodestyle#174 |
In GitLab by @sigmavirus24 on Jun 26, 2015, 11:16 No need to apologize! Thanks for finding this! You're improving the quality of pep8 and flake8. =D |
Just found that flake8 doesn't consider comments as blank lines,
In my head, lines 2,3 and 4 are considered white spaces, but flake8 only counts line 2 (missiging a second line as stated in error E302) The solution is to add a new line (the missing one) on line 2, with this rule will pass.
Not that obvious, but wanted to share the solution. P.D.: They need to be consecutive, this example doesn't work for the count
Havin line 2 and 4 as "2 blank lines" before the method is not enoug to make the rule pass Best, |
In GitLab by @dradetsky on Jun 25, 2015, 12:58
Not certain that this is a flake8 bug rather than a bug in a flake8 component. In any case, see the stackoverflow discussion:
http://stackoverflow.com/questions/31058607/how-to-fix-flake8-pyflakes-treats-multiline-comment-before-class-as-error
I'm using flake8 with emacs. If I begin a file with
It says there is no syntax error. But if I wrap it to:
I get "E302 expected 2 blank lines, found 0" for the "class" line.
The text was updated successfully, but these errors were encountered: