Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions autoload/flake8.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ endfunction

"" ** internal ** {{{

"" warnings
"" warnings

let s:displayed_warnings = 0
function s:Warnings()
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down