summaryrefslogtreecommitdiff
path: root/ale_linters/python/flake8.vim
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-09-19 19:46:13 +0100
committerGitHub <noreply@github.com>2018-09-19 19:46:13 +0100
commit169a6e26b2ca63ab0f2f5bb3d2176ff0a2f68bc3 (patch)
tree4a561b7ec1d056eb30a4b988625b4a4c3d8d49e1 /ale_linters/python/flake8.vim
parente82bcdb8a6dc888130c03bc80cba492051c5ffbf (diff)
parentdbe93529352880068cb738abb93a1bc009bf73ed (diff)
downloadale-169a6e26b2ca63ab0f2f5bb3d2176ff0a2f68bc3.zip
Merge pull request #1719 from elebow/auto-pipenv-option-for-python-linters
Add python_[linter]_auto_pipenv options for python linters (fixes #1656)
Diffstat (limited to 'ale_linters/python/flake8.vim')
-rw-r--r--ale_linters/python/flake8.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 358f51a4..9dcdacc6 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -5,12 +5,18 @@ call ale#Set('python_flake8_executable', 'flake8')
call ale#Set('python_flake8_options', '')
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_flake8_change_directory', 1)
+call ale#Set('python_flake8_auto_pipenv', 0)
function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
endfunction
function! ale_linters#python#flake8#GetExecutable(buffer) abort
+ if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_flake8_auto_pipenv'))
+ \ && ale#python#PipenvPresent(a:buffer)
+ return 'pipenv'
+ endif
+
if !s:UsingModule(a:buffer)
return ale#python#FindExecutable(a:buffer, 'python_flake8', ['flake8'])
endif