在 vim 中仅显示 pylint 和 syntastic 的错误
Show only errors with pylint and syntastic in vim
如何在vim中使用synstatic只显示pylint错误信息?我基本上希望 pylint -E
的输出用作 syntastic 的源。我尝试在我的 .vimrc
中配置 syntastic:
let g:syntastic_python_checkers = ['python', 'pylint -E']
这没有用。此外,我尝试通过 .pylintrc
:
中的以下行将 pylint 配置为仅显示没有 -E 标志的错误
disable=all
enable=E
似乎只有 disable=all
.
它通过禁用 .pylintrc
中的所有其他类别来工作:
disable=C, F, I, R, W
来自 https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
let g:syntastic_quiet_messages = {
\ "!level": "errors",
\ "type": "style",
\ "regex": '.*',
\ "file:p": '.*' }
这将忽略所有文件类型中的所有样式警告。
注意!在!水平。您也可以输入 'type':['style', 'syntax'],但通常忽略语法警告并不是一个好主意。
想要添加不同类型的答案,因为我能够让它工作:
向 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'
如何在vim中使用synstatic只显示pylint错误信息?我基本上希望 pylint -E
的输出用作 syntastic 的源。我尝试在我的 .vimrc
中配置 syntastic:
let g:syntastic_python_checkers = ['python', 'pylint -E']
这没有用。此外,我尝试通过 .pylintrc
:
disable=all
enable=E
似乎只有 disable=all
.
它通过禁用 .pylintrc
中的所有其他类别来工作:
disable=C, F, I, R, W
来自 https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
let g:syntastic_quiet_messages = {
\ "!level": "errors",
\ "type": "style",
\ "regex": '.*',
\ "file:p": '.*' }
这将忽略所有文件类型中的所有样式警告。 注意!在!水平。您也可以输入 'type':['style', 'syntax'],但通常忽略语法警告并不是一个好主意。
想要添加不同类型的答案,因为我能够让它工作:
向 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'