在vim中仅显示带有pylint和syntastic的错误

zor*_*mit 12 python vim pylint syntastic

如何在vim中使用synstastic来只显示pylint错误消息?我基本上希望输出pylint -E用作合成的源.我尝试在我的配置中.vimrc使用:

 let g:syntastic_python_checkers = ['python', 'pylint -E']
Run Code Online (Sandbox Code Playgroud)

这没用.另外,我尝试配置pylint只显示没有-E标志的错误,通过我的以下行.pylintrc:

disable=all
enable=E
Run Code Online (Sandbox Code Playgroud)

这似乎只是disable=all.

zor*_*mit 8

它的工作原理是禁用所有其他类别.pylintrc:

disable=C, F, I, R, W
Run Code Online (Sandbox Code Playgroud)

  • 如果要添加此行,只需记住在该行上方添加[MESSAGES CONTROL].(对于那些在谷歌上搜索的人:)) (5认同)

dwa*_*son 5

想要添加一个不同类型的答案,因为我能够让它工作:

添加参数的syntastic工作方式与OP提到的略有不同.相反,我拥有的是,在我的.vimrc:

let g:syntastic_python_checkers = ['pylint']  "" or ['flake8', 'pylint'], etc
let g:syntastic_python_pylint_args = '-E'
"" to show it accepts a string of args, also:
let g:syntastic_python_pylint_args = '--rcfile=/path/to/rc -E'
Run Code Online (Sandbox Code Playgroud)