Skip to content

Regression, false negative E302 #858

Description

@asottile

sample code

def f():
    pass

# wat
@hi
def g():
    pass

2.5.0 behaviour

$ ./venv/bin/pycodestyle --version
2.5.0
$ ./venv/bin/pycodestyle  t.py
$ echo $?
0

2.4.0 behaviour

$ ./venv/bin/pycodestyle --version
2.4.0
$ ./venv/bin/pycodestyle  t.py 
t.py:5:1: E302 expected 2 blank lines, found 1

git bisection

$ git bisect start
$ git bisect good 2.4.0
$ git bisect bad 2.5.0
$ git bisect run bash -c '! python3 pycodestyle.py ../t.py'
...
running bash -c ! python3 pycodestyle.py ../t.py
0138bb106403241564a0c5af67886c05a2f4f690 is the first bad commit
commit 0138bb106403241564a0c5af67886c05a2f4f690
Author: Antony Lee <anntzer.lee@gmail.com>
Date:   Wed Nov 28 00:43:17 2018 +0100

    Allow omitting blank lines around one-liner definitions.

:100755 100755 c9e1667150d1a78fd236f8272906f3862425b3d5 27009c648ff090847cf78ec26c83fbd79be11d5a M	pycodestyle.py
:040000 040000 c138e2e23b06e384dfc052ffdfaaf372d203c480 817cc37bedea6034c3cf06468c42811b0111de27 M	testsuite
bisect run success

0138bb1

CC @anntzer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions