Skip to content

Python IndentationError when class method has decorator #114

@MarcelRobitaille

Description

@MarcelRobitaille

Copying the sample code from the fix in e2aa007 and adding a decorator to the class method results in an IndentationError. My code is now as follows:

from unittest.mock import patch


class Test(object):

    def __init__(self):
        pass

    @patch()
    def an_empty_line_above_this(self):

        return 'No worry about the blank lines'


if __name__ == '__main__':

    print('blank lines are cool, now PEP8 lint stop warning about it’s absence.')

And I get the following errors:
image

Here is a minimal vimrc that will reproduce the issue:

call plug#begin('~/.vim/plugged')
Plug 'metakirby5/codi.vim'
call plug#end()

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions