0

I'm trying to turn off the ignore max-line-length warnings in Spyder. This question was answered in another post, but I can't seem to get Spyder to read the config.sys file [pep8] max-line-length = 120

I've tried putting it in my current working directory, Python27, Python27/Scripts.

None of those locations turns off the 79 char warning.

I open my .py file by right clicking on it and choose edit in Spyder.

thanks in Advance

Tom Mozdzen
  • 338
  • 4
  • 16

1 Answers1

0

Finally understood the comment from Justin Harris in a previous question. Python: How to tell Spyder's style analysis PEP8 to read from a setup.cfg or increase max. line length?

You should follow these steps:

First, run:

import os; os.path.expanduser('~')

Then, put your .pep8 file in the directory that is displayed by the above command.

The contents of the file to make it ignore lines under 120 characters is:

[pep8]
max-line-length = 120
Alireza Ahmadi
  • 1,541
  • 18
  • 22
Tom Mozdzen
  • 338
  • 4
  • 16
  • 1
    Notice, that this method will disable it userwide. The linked question also provides a solution for projectwide disabling. – C.Fe. Jul 12 '17 at 12:35
  • It still doesn't work for me. Any other suggestions? I'm trying it in the eclilpse environment also. – Tom Mozdzen Aug 14 '22 at 18:35