pep8 警告 8-space 缩进

pep8 warn about 8-space indent

这段代码:

def foo():
        print("hello")

违反了PEP 0008,即

Use 4 spaces per indentation level.

但是 pep8pyflakesflake8 命令都没有警告它。

我怎样才能让其中之一抱怨这个非 Python 代码?

pylint 将警告此违规行为:

$ pylint test.py
No config file found, using default configuration
************* Module test
W:  2, 0: Bad indentation. Found 8 spaces, expected 4 (bad-indentation)

请注意,pep8 只会在 如果缩进 is not a multiple of four(E111 错误代码)时警告您。