Skip to content

Commit

Permalink
Fix E305 regression in 2.1.0 due to fix for PyCQA#400
Browse files Browse the repository at this point in the history
  • Loading branch information
markpeek committed Nov 6, 2016
1 parent d12e2ea commit ce71d1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number,
Okay: def a():\n pass\n\n\ndef b():\n pass
Okay: def a():\n pass\n\n\nasync def b():\n pass
Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1
E301: class Foo:\n b = 0\n def bar():\n pass
E302: def a():\n pass\n\ndef b(n):\n pass
Expand Down Expand Up @@ -291,7 +293,7 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number,
elif blank_before != 2:
yield 0, "E302 expected 2 blank lines, found %d" % blank_before
elif (logical_line and not indent_level and blank_before != 2 and
previous_unindented_logical_line.startswith(('def', 'class'))):
previous_unindented_logical_line.startswith(('def ', 'class '))):
yield 0, "E305 expected 2 blank lines after " \
"class or function definition, found %d" % blank_before

Expand Down

0 comments on commit ce71d1e

Please sign in to comment.