From 1e541cc076a5b3c5ceeedeb808e4ebc0e9d97a35 Mon Sep 17 00:00:00 2001 From: dusktreader Date: Tue, 13 Dec 2016 13:11:37 -0800 Subject: [PATCH] Issue #64: Added setting for specifiying flake8 config Added the flake8_config_file setting. This allows the user to specify the flake8 config file that should be used when makeing the flak8 command. It uses the --config argument to the flake8 executable --- autoload/flake8.vim | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/autoload/flake8.vim b/autoload/flake8.vim index 06a1b6b..246e0e0 100644 --- a/autoload/flake8.vim +++ b/autoload/flake8.vim @@ -24,7 +24,7 @@ endfunction "" ** internal ** {{{ -"" warnings +"" warnings let s:displayed_warnings = 0 function s:Warnings() @@ -85,6 +85,8 @@ function! s:Setup() " {{{ call s:DeclareOption('flake8_pyflake_marker', '', '"F>"') call s:DeclareOption('flake8_complexity_marker', '', '"C>"') call s:DeclareOption('flake8_naming_marker', '', '"N>"') + " user identified flake8 config file + call s:DeclareOption('flake8_config_file', '', '') "" setup markerdata @@ -137,7 +139,18 @@ function! s:Flake8() " {{{ " perform the grep itself let &grepformat="%f:%l:%c: %m\,%f:%l: %m" - let &grepprg=s:flake8_cmd + + if s:flake8_config_file != '' + if filereadable(s:flake8_config_file) + let &grepprg=s:flake8_cmd . ' --config=' . s:flake8_config_file + else + echoerr "flake8 config file " . s:flake8_config_file . " not found" + return + endif + else + let &grepprg=s:flake8_cmd + endif + silent! grep! "%" " restore grep settings