Syntastic
并且不忽略配置文件flake8
中提供的错误。vim
flake8
我正在使用inflake8
进行 python 代码检查。我每个文档都有一个忽略错误的配置文件。现在,当我通过键入从命令行运行时Syntastic
vim
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>
的错误窗口在 vim 中运行时,E251
尽管它在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
这是一个已知的错误?我究竟做错了什么?将不胜感激任何帮助。谢谢你。