问题
I am using Spyder v.3.2.8 and I'm trying to modify the Real-time code style analysis. For example, I'd like to set the max-line-length to 99.
I exactly followed what was suggested here, i.e. I created a file .pycodestyle
in the directory resulting from import os; os.path.expanduser('~')
. The file looks as follows
[pycodestyle]
ignore = E226,E302,E41,E501,W503
max-line-length = 99
I am aware that ignoring E501 renders max-line-length
virtually ineffective. However, I still get warnings if the code exceeds the default 79 columns. Am I missing something?
EDIT:
The issue is solved now. All of a sudden, the settings are recognized. A reboot might have helped (OS: Windows 10).
回答1:
I had the same problem and I have resolved it by creating a file ~/.config/pycodestyle
(without a dot and inside ~/.config
) instead of ~/.pycodestyle
, according to the official website:
- https://pep8.readthedocs.io/en/latest/intro.html#configuration
来源:https://stackoverflow.com/questions/52297752/spyder-ignores-pycodestyle