metakirby5 / codi.vim

:notebook_with_decorative_cover: The interactive scratchpad for hackers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python IndentationError when class method has decorator

MarcelRobitaille opened this issue · comments

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

  • Arch Linux (Linux Zeus 5.2.0-arch2-1-ARCH #1 SMP PREEMPT Mon Jul 8 18:18:54 UTC 2019 x86_64 GNU/Linux)
  • Last line in man script: util-linux June 2014 SCRIPT(1)
  • The following in a pastebin, to reduce visual clutter:

@heshiyou Any thoughts?

commented

Are we having expectation on this fix?