Vim-Syntastic显示忽略的python错误

时间:2019-07-09 17:23:47

标签: vim syntastic flake8 vim-syntastic

Syntastic中的flake8vim不能忽略flake8配置文件中提供的错误。

我正在使用flake8Syntastic中的vim进行python代码插入。每个flake8文档flake8都有一个absolute_path_to_home/.config/flake8配置文件,它忽略错误E251。现在,当我通过输入

从命令行运行flake8
flake8 --config=absolute_path_to_home/.config/flake8 my_python_code_that_is_being_checked.py

然后flake8忽略错误E251。但是,当我在flake8的vim中运行<F7>时,尽管E251配置文件中忽略了它,但vim内的错误窗口仍显示flake8

为确保Syntastic使用正确的参数调用flake8,我在.vimrc中添加了以下内容

let g:syntastic_python_checkers = ['flake8']
let g:syntastic_python_flake8_args='--config=absolute_path_to_home/.config/flake8'
let g:syntastic_debug = 1

我使用Syntastic检查了vim内部的:messages通话,并获得了以下信息

syntastic: 4.483755: CacheErrors: Invoking checker: python/flake8
syntastic: 4.484046: SyntasticMake: called with options: {'errorformat': '%E%f:%l: could not compile,%-Z%p^,%A%f:%l:%c: %m,%A%f:%l: %m,%-G%.%#', 
'makeprg':'flake8 --config=absolute_path_to_home/.config/flake8 my_python_code_that_is_being_checked.py', 'env': {'TERM': 'dumb'}}
syntastic: 4.615727: system: command run in 0.131497s
syntastic: 4.617432: getLocList: checker python/flake8 returned 1
syntastic: 4.618452: getLocList: checker python/flake8 run in 0.134634s

因此,如果可以相信上述消息,那么Syntastic确实是在使用正确的配置文件调用flake8,因此我不确定为什么仍显示E251。以下是我的absolute_path_to_home/.config/flake8文件

[flake8]
ignore = E251

这是一个已知的错误吗?我究竟做错了什么?将不胜感激。谢谢。

0 个答案:

没有答案