Syntastic
中的flake8
和vim
不能忽略flake8
配置文件中提供的错误。
我正在使用flake8
和Syntastic
中的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
这是一个已知的错误吗?我究竟做错了什么?将不胜感激。谢谢。