PyCQA / pycodestyle

Simple Python style checker in one Python file

Home Page:https://pycodestyle.pycqa.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E115, Expected an indented block (comment), not detected

kdart-brt opened this issue · comments

According to PEP-8 on block styles, it merely says:

Block comments generally apply to some (or all) code that follows them, and are indented to the same level as that code. 

The existing E115 is supposed to check this. However, the following test code does not trigger it:

class SomeBase:
    pass


class SomeClass(SomeBase):

    def method(self, arg):
        if not arg:
            return "arg is false"
# Will return true on truthy
        return "arg is true"

I think that should be caught. It does cause a problem with building documentation with Sphinx that includes source code snippets. The generated RST has the de-dented line signalling the end of the code block.

Thanks!