summaryrefslogtreecommitdiff
path: root/ale_linters/python
diff options
context:
space:
mode:
authorEddie Lebow <elebow@users.noreply.github.com>2018-06-02 21:49:12 -0400
committerEddie Lebow <elebow@users.noreply.github.com>2018-06-02 21:49:12 -0400
commitdd642b117c2a9fd9bba9a452d147526e9858ec0d (patch)
tree52082801da8565ed2ace329258da768917c6717f /ale_linters/python
parent786fc0a62f2d45b88967aad6d59bb9c483a576ae (diff)
downloadale-dd642b117c2a9fd9bba9a452d147526e9858ec0d.zip
Allow flake8 executable to be set to `pipenv`.
It appends ` run flake8`, analogously to the Ruby tools when the executable is set to `bundle`
Diffstat (limited to 'ale_linters/python')
-rw-r--r--ale_linters/python/flake8.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 7398b1dc..fdc4ac94 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -52,6 +52,10 @@ function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
let l:version = ale#semver#GetVersion(l:executable, a:version_output)
+ let l:exec_args = l:executable =~? 'pipenv$'
+ \ ? ' run flake8'
+ \ : ''
+
" Only include the --stdin-display-name argument if we can parse the
" flake8 version, and it is recent enough to support it.
let l:display_name_args = ale#semver#GTE(l:version, [3, 0, 0])
@@ -61,7 +65,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
let l:options = ale#Var(a:buffer, 'python_flake8_options')
return l:cd_string
- \ . ale#Escape(l:executable)
+ \ . ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --format=default'
\ . l:display_name_args . ' -'