如何在Syntastic for Vim中将Python最大允许行长度设置为120? [英] How can I set the Python max allowed line length to 120 in Syntastic for Vim?

查看:162
本文介绍了如何在Syntastic for Vim中将Python最大允许行长度设置为120?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Vim上使用 python-mode ,我更希望有120个字符行而不是纯文本行PEP8标准中定义的80.

I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard.

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

In python-mode, this is easy. I just add the following to my ~/.vimrc:

" Pylint configuration file
let g:pymode_lint_config = '$HOME/.pylint.rc'
let g:pymode_options_max_line_length=120

这很好用,但是随后,我也想使用出色的 Syntastic 插件来检查其他各种语法(Chef例如食品评论家的食谱.)

This works great, but then, I also wanted to use the superb Syntastic plugin for checking syntax of various other kinds (Chef recipes for foodcritic, for example.)

不幸的是,Syntastic还进行了Python linting,因此它现在开始抱怨我的120个字符行.我也可以做些类似的事情来使它停止抱怨我的线条稍长吗?

Unfortunately, Syntastic also does Python linting, and as such it has now started complaining about my 120 character lines. Is there something similar I can do to it as well to make it stop complaining about my slightly longer lines?

推荐答案

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

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

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

这篇关于如何在Syntastic for Vim中将Python最大允许行长度设置为120?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆