How can I set the Python max allowed line length to 120 in Syntastic for Vim?

我是研究僧i 提交于 2019-12-03 22:49:40

You can pass additional arguments to each linter. For pylint, you can use:

let g:syntastic_python_pylint_post_args="--max-line-length=120"

This is now configured globally in ~/.config/flake8 in linux and ~/.flake in windows. The file can look like this.

[flake8]
max-line-length = 120

Have a look at their documentation for per project settings: http://flake8.readthedocs.io/en/latest/user/configuration.html#project-configuration

I would just recommend you disable the length checking by adding this line to your .vimrc dot file:

let g:pymode_lint_ignore = "E501,W"

There is a file named - defaults.py inside your virtual environment folder - ......./lib/python3.6/site-packages/flake8

You can change the value of max-line-length in that file.

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