Skip to content

E301: reported incorrectly after ignored E303 #925

@SukiCZ

Description

@SukiCZ

Hello, 👋

I have a following code in foo.py:

     1	class FooBar:
     2	
     3	    def foo(self):
     4	        pass
     5	
     6	
     7	    # Comment
     8	
     9	    def bar(self):
    10	        pass


and running pycodestyle --ignore=E303 foo.py (E303 - Too many blank lines) reports foo.py:9:5: E301 expected 1 blank line, found 0 even there is a blank line.

There is one more thing that is confusing me - I'm able to fix this error by adding new line between def bar and pass.

Any idea what could be wrong here?
Thanks

Activity

asottile

asottile commented on Apr 20, 2020

@asottile
Member

can confirm this is a bug -- seems pycodestyle has been doing this for a while (checked back to 2.4 at least) -- thanks for the report!

changed the title [-]E301 reported incorrectly after ignored E303[/-] [+]E301: reported incorrectly after ignored E303[/+] on Jun 14, 2020
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

        Participants

        @asottile@SukiCZ

        Issue actions

          E301: reported incorrectly after ignored E303 · Issue #925 · PyCQA/pycodestyle