Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这段代码:
def foo(): print("hello")
违反PEP 0008,其中规定
每个缩进级别使用 4 个空格。
但是 , 或 命令都没有pep8警告pyflakes它flake8。
pep8
pyflakes
flake8
我怎样才能让他们中的一个抱怨这个 unpythonic 代码?
pylint会警告这种违规行为:
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)
请注意,仅当缩进不是四的倍数(E111 错误代码)时pep8才会警告您。