X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2cf450fb46d67e32d13ad0ff92397c11e8c640cd..fc04a1123eb6b2aa855eddfcee6da7a04ca0408c:/ftplugin/python_flake8.vim?ds=sidebyside diff --git a/ftplugin/python_flake8.vim b/ftplugin/python_flake8.vim index bfc97c7..0b386c7 100644 --- a/ftplugin/python_flake8.vim +++ b/ftplugin/python_flake8.vim @@ -1,7 +1,7 @@ " " Python filetype plugin for running flake8 " Language: Python (ft=python) -" Maintainer: Vincent Driessen +" Maintainer: Vincent Driessen " Version: Vim 7 (may work with lower Vim versions, but not tested) " URL: http://github.com/nvie/vim-flake8 " @@ -11,13 +11,27 @@ if exists("b:loaded_flake8_ftplugin") endif let b:loaded_flake8_ftplugin=1 -let s:flake8_cmd="flake8" +if exists("g:flake8_cmd") + let s:flake8_cmd=g:flake8_cmd +else + let s:flake8_cmd="flake8" +endif let s:flake8_ignores="" if exists("g:flake8_ignore") let s:flake8_ignores=" --ignore=".g:flake8_ignore endif +let s:flake8_max_line_length="" +if exists("g:flake8_max_line_length") + let s:flake8_max_line_length=" --max-line-length=".g:flake8_max_line_length +endif + +let s:flake8_max_complexity="" +if exists("g:flake8_max_complexity") + let s:flake8_max_complexity=" --max-complexity=".g:flake8_max_complexity +endif + if !exists("*Flake8()") function Flake8() if !executable(s:flake8_cmd) @@ -39,7 +53,7 @@ if !exists("*Flake8()") " perform the grep itself let &grepformat="%f:%l:%c: %m\,%f:%l: %m" - let &grepprg=s:flake8_cmd.s:flake8_ignores + let &grepprg=s:flake8_cmd.s:flake8_ignores.s:flake8_max_line_length.s:flake8_max_complexity silent! grep! % " restore grep settings @@ -74,6 +88,5 @@ endif if !exists("no_plugin_maps") && !exists("no_flake8_maps") if !hasmapto('Flake8(') noremap :call Flake8() - noremap! :call Flake8() endif endif