Spyder ignores .pycodestyle

爷,独闯天下 提交于 2020-01-24 11:32:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!