Allow all Python linter executables to be set to pipenv.

It appends ` run {linter_name}`, analogously to the Ruby linters when
the executable is set to `bundle`
This commit is contained in:
Eddie Lebow
2018-06-04 22:43:02 -04:00
parent 5addd3abef
commit ca88e67af0
14 changed files with 128 additions and 7 deletions

View File

@@ -10,7 +10,13 @@ function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort
endfunction
function! ale_linters#python#pycodestyle#GetCommand(buffer) abort
return ale#Escape(ale_linters#python#pycodestyle#GetExecutable(a:buffer))
let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
\ ? ' run pycodestyle'
\ : ''
return ale#Escape(l:executable) . l:exec_args
\ . ' '
\ . ale#Var(a:buffer, 'python_pycodestyle_options')
\ . ' -'