Python Vim Flake8忽略项目配置文件

Python Vim Flake8忽略项目配置文件,python,vim,flake8,Python,Vim,Flake8,vim-8似乎忽略了我的项目特定配置文件。如果我从项目根目录中的命令行运行flake8,它会工作,但是当我打开vim并尝试对我的文件运行flake8时,它不会选择该设置。我知道这一点,因为它使用默认的行长度79,而不是我的项目特定的120 我读了这篇文章:,但似乎没有帮助。它在评论中提到了一年前修复的一个bug 在我的项目根目录中,我有一个带有[flake8]部分的.flake8文件 vim-flake8如何确定项目根目录是什么以及在哪里查找配置文件?它只是使用打开Vim的目录吗?在我的OSX上

vim-8似乎忽略了我的项目特定配置文件。如果我从项目根目录中的命令行运行flake8,它会工作,但是当我打开vim并尝试对我的文件运行flake8时,它不会选择该设置。我知道这一点,因为它使用默认的行长度79,而不是我的项目特定的120

我读了这篇文章:,但似乎没有帮助。它在评论中提到了一年前修复的一个bug

在我的项目根目录中,我有一个带有[flake8]部分的.flake8文件


vim-flake8如何确定项目根目录是什么以及在哪里查找配置文件?它只是使用打开Vim的目录吗?

在我的OSX上也有同样的问题,并且部分解决了它。今天发布了最新版本的syntastic git clone和Flake 8 3.0.4。Vim 7.4

flake8从命令行运行良好,并选择了我的全局~/.config/flake8。如果我有配置文件,Vim没有输出任何东西,但是没有flake8配置文件,它工作得很好

我将flake8配置文件不在文件系统中,而是在my.vimrc中,部分解决了这个问题:

let g:syntastic_python_flake8_args='--ignore=E203,E231'
但这不是最好的解决方案,因为配置没有共享

对于启动的开发人员,当我启用调试时

let g:syntastic_debug = 1
我得到这个输出:

syntastic: 4.516990: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2
>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shellslash = 0, &shellte
mp = 1, &shellxquote = '', &shellxescape = ''
syntastic: 4.517587: UpdateErrors (auto): default checkers
syntastic: 4.517927: CacheErrors: default checkers
syntastic: 4.518502: g:syntastic_aggregate_errors = 0
syntastic: 4.518666: getcwd() = '/Volumes/myproject/src'
syntastic: 4.525418: CacheErrors: Invoking checker: python/flake8
syntastic: 4.526113: SyntasticMake: called with options: {'errorformat': '%E%f:%
l: could not compile,%-Z%p^,%A%f:%l:%c: %t%n %m,%A%f:%l: %t%n %m,%-G%.%#', 'make
prg': 'flake8 main.py', 'env': {'TERM': 'dumb'}}
syntastic: 4.727963: system: command run in 0.201426s
syntastic: 4.729751: getLocList: checker python/flake8 returned 1
syntastic: 4.730094: getLocList: checker python/flake8 run in 0.204568s

在我的OSX上也有同样的问题,并且部分解决了。今天发布了最新版本的syntastic git clone和Flake 8 3.0.4。Vim 7.4

flake8从命令行运行良好,并选择了我的全局~/.config/flake8。如果我有配置文件,Vim没有输出任何东西,但是没有flake8配置文件,它工作得很好

我将flake8配置文件不在文件系统中,而是在my.vimrc中,部分解决了这个问题:

let g:syntastic_python_flake8_args='--ignore=E203,E231'
但这不是最好的解决方案,因为配置没有共享

对于启动的开发人员,当我启用调试时

let g:syntastic_debug = 1
我得到这个输出:

syntastic: 4.516990: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2
>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shellslash = 0, &shellte
mp = 1, &shellxquote = '', &shellxescape = ''
syntastic: 4.517587: UpdateErrors (auto): default checkers
syntastic: 4.517927: CacheErrors: default checkers
syntastic: 4.518502: g:syntastic_aggregate_errors = 0
syntastic: 4.518666: getcwd() = '/Volumes/myproject/src'
syntastic: 4.525418: CacheErrors: Invoking checker: python/flake8
syntastic: 4.526113: SyntasticMake: called with options: {'errorformat': '%E%f:%
l: could not compile,%-Z%p^,%A%f:%l:%c: %t%n %m,%A%f:%l: %t%n %m,%-G%.%#', 'make
prg': 'flake8 main.py', 'env': {'TERM': 'dumb'}}
syntastic: 4.727963: system: command run in 0.201426s
syntastic: 4.729751: getLocList: checker python/flake8 returned 1
syntastic: 4.730094: getLocList: checker python/flake8 run in 0.204568s

今天我遇到了一个类似的问题,我通过将以下内容添加到我的~/.vimrc或实际上是我的~/.config/nvim/init.vim文件中解决了这个问题:


这是基于syntastic的官方文档。

我今天遇到了一个类似的问题,我通过将以下内容添加到我的~/.vimrc或实际上是我的~/.config/nvim/init.vim文件中解决了这个问题:


这是基于syntastic的官方文档。

我今天遇到了同样的问题。Flake8在命令行中运行良好,但在vim内部,syntastic似乎忽略了每个配置文件。在vim内部运行flake8时,使用:!flake8获取了配置

根据Tomi的回答,我通过添加

    let g:syntastic_python_flake8_args='--config=setup.cfg'

到我的vim config,如果从项目根目录启动vim,那么它应该可以工作。仍然有点粗糙,但至少flake8配置保持在一个地方。

我今天遇到了同样的问题。Flake8在命令行中运行良好,但在vim内部,syntastic似乎忽略了每个配置文件。在vim内部运行flake8时,使用:!flake8获取了配置

根据Tomi的回答,我通过添加

    let g:syntastic_python_flake8_args='--config=setup.cfg'

到我的vim config,如果从项目根目录启动vim,那么它应该可以工作。仍然有点粗糙,但至少flake8配置保持在一个地方。

您使用的是什么版本的flake8?为了它的价值,我是flake8的维护者,并使用syntastic将其连接到vim中。忽略项目配置没有问题。您是否尝试过设置路径?2.5.5 pep8:1.7.0,pyflakes:1.0.0,Linux上的mccabe:0.4.0 CPython 2.7.6您使用的是什么版本的Flake8?我是Flake8的维护者,并使用syntastic将其连接到vim中。忽略项目配置没有问题。您是否尝试过在Linux上设置路径?2.5.5 pep8:1.7.0,pyflakes:1.0.0,mccabe:0.4.0 CPython 2.7.6对于任何正在寻找答案的人,这对我来说效果很好:只需确保不要同时设置g:syntastic_python_flake8_参数和g:syntastic_python_flake8_config_文件。对于寻找答案的人来说,这对我来说效果很好:只需确保不要同时设置g:syntastic_python_flake8_参数和g:syntastic_python_flake8_config_文件。