Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Spyder's style analysis PEP8 to read from a setup.cfg or increase max. line length?

I am using Spyder 2.3.1 and python(x, y).

In the preferences of Spyder you can activate "Style analysis". This is quite nice, but I want to increase the max. tolerable line length. The standard setting for PEP8 is 79 characters. This can be changed through a setup.cfg with the content:

[pep8]
max-line-length = 99

This can be read here: http://pep8.readthedocs.org/en/latest/intro.html#related-tools

Where do I put a setup.cfg so Spyder/PEP8 will recognize my new limit? Or is there an other way to set this limit or to ignore E501 (line to long)? Just setting "Show vertical line after 99 characters" in Spyder does not help.

like image 359
venti Avatar asked Oct 17 '14 13:10

venti


1 Answers

According to the link cited by @Werner:

http://pep8.readthedocs.org/en/latest/intro.html#configuration

what you need to do is to create a file called ~/.config/pep8 (On Linux/Mac) or ~/.pep8 (on Windows), and add these lines to it:

[pep8]
max-line-length = 99

I tested it in Spyder and it works as expected.

like image 137
Carlos Cordoba Avatar answered Oct 02 '22 13:10

Carlos Cordoba