Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the pep8 linter to accept 2 space indents?

The pep8 default states indents should be multiples of 4.

What argument can I pass to a pep8 config file so indents with a multiple of 2 are accepted?

like image 347
Dan O'Boyle Avatar asked Oct 31 '22 13:10

Dan O'Boyle


1 Answers

After some digging, From the Docs:

Example:

[pep8] ignore = E226,E302,E41 max-line-length = 160

At the project level, a setup.cfg file or a tox.ini file is read if present (.pep8 file is also supported, but it is deprecated). If none of these files have a [pep8] section, no project specific configuration is loaded.

If the ignore option is not in the configuration and not in the arguments, only the error codes E123/E133, E226 and E241/E242 are ignored (see below).

To ignore ONLY the Multiples of 4 rule Use ignore E111

like image 134
Dan O'Boyle Avatar answered Nov 09 '22 08:11

Dan O'Boyle