Merge pull request #1719 from elebow/auto-pipenv-option-for-python-linters

Add python_[linter]_auto_pipenv options for python linters (fixes #1656)
This commit is contained in:
w0rp
2018-09-19 19:46:13 +01:00
committed by GitHub
20 changed files with 212 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Functions for integrating with Python linters.
call ale#Set('python_auto_pipenv', '0')
let s:sep = has('win32') ? '\' : '/'
" bin is used for Unix virtualenv directories, and Scripts is for Windows.
let s:bin_dir = has('unix') ? 'bin' : 'Scripts'
@@ -107,3 +109,8 @@ function! ale#python#FindExecutable(buffer, base_var_name, path_list) abort
return ale#Var(a:buffer, a:base_var_name . '_executable')
endfunction
" Detects whether a pipenv environment is present.
function! ale#python#PipenvPresent(buffer) abort
return findfile('Pipfile.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction