summaryrefslogtreecommitdiff
path: root/ale_linters/python
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-06 19:11:43 +0100
committerw0rp <devw0rp@gmail.com>2017-05-06 19:11:43 +0100
commit2e1c9b0fa574aa2e617734470d5dbec61abee928 (patch)
tree9b9b303a8d47f4415fd63bdc70378b6ef464943e /ale_linters/python
parentbf8aae02e8a1a58649c4617008bd38b71b6b602d (diff)
downloadale-2e1c9b0fa574aa2e617734470d5dbec61abee928.zip
#208 Automatically detect pylint in virtualenv directories
Diffstat (limited to 'ale_linters/python')
-rw-r--r--ale_linters/python/pylint.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index 217fcc47..3ee8bb02 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -7,7 +7,21 @@ let g:ale_python_pylint_executable =
let g:ale_python_pylint_options =
\ get(g:, 'ale_python_pylint_options', '')
+let g:ale_python_pylint_use_global = get(g:, 'ale_python_pylint_use_global', 0)
+
function! ale_linters#python#pylint#GetExecutable(buffer) abort
+ if !ale#Var(a:buffer, 'python_pylint_use_global')
+ let l:virtualenv = ale#python#FindVirtualenv(a:buffer)
+
+ if !empty(l:virtualenv)
+ let l:ve_pylint = l:virtualenv . '/bin/pylint'
+
+ if executable(l:ve_pylint)
+ return l:ve_pylint
+ endif
+ endif
+ endif
+
return ale#Var(a:buffer, 'python_pylint_executable')
endfunction