Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pep8 warn about 8-space indent

This bit of code:

def foo():
        print("hello")

violates PEP 0008, which states

Use 4 spaces per indentation level.

But neither the pep8, pyflakes, or flake8 commands warn about it.

How can I get one of them to complain about this unpythonic code?

like image 367
andrewdotn Avatar asked Oct 18 '22 13:10

andrewdotn


1 Answers

pylint would warn about this violation:

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

Note that pep8 would warn you only if indentation is not a multiple of four (E111 error code).

like image 128
alecxe Avatar answered Oct 21 '22 04:10

alecxe