如何在Syntastic for Vim中将Python max允许的行长度设置为120?

feo*_*eoh 17 python vim pylint python-mode syntastic

我正在为Vim 使用python-mode,我更喜欢那里有120个字符行而不是PEP8标准中定义的stark 80.

在python模式下,这很容易.我只是将以下内容添加到〜/ .vimrc中:

" Pylint configuration file
let g:pymode_lint_config = '$HOME/.pylint.rc'
let g:pymode_options_max_line_length=120
Run Code Online (Sandbox Code Playgroud)

这很好用,但是,我还想使用精湛的Syntastic插件来检查各种其他类型的语法(例如,foodcritic的Chef配方).

不幸的是,Syntastic也做了Python linting,因此它现在开始抱怨我的120个字符行.有什么类似的东西,我可以做到这一点,以使它停止抱怨我稍长的线?

zka*_*nda 36

现在~/.config/flake8在linux和~/.flakewindows中全局配置.该文件可能如下所示.

[flake8]
max-line-length = 120
Run Code Online (Sandbox Code Playgroud)

查看每个项目设置的文档:http://flake8.readthedocs.io/en/latest/user/configuration.html#project-configuration


Fed*_*lto 14

您可以将其他参数传递给每个linter.对于pylint,您可以使用:

let g:syntastic_python_pylint_post_args="--max-line-length=120"
Run Code Online (Sandbox Code Playgroud)