mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-31 08:34:30 +08:00
Split up the flake8 and ansible-lint handlers
This commit is contained in:
@@ -9,6 +9,26 @@ let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [
|
||||
\ 'virtualenv',
|
||||
\])
|
||||
|
||||
" Given a buffer number and a command name, find the path to the executable.
|
||||
" First search on a virtualenv for Python, if nothing is found, try the global
|
||||
" command. Returns an empty string if cannot find the executable
|
||||
function! ale#python#GetExecutable(buffer, cmd_name) abort
|
||||
let l:virtualenv = ale#python#FindVirtualenv(a:buffer)
|
||||
|
||||
if !empty(l:virtualenv)
|
||||
let l:ve_executable = l:virtualenv . '/bin/' . a:cmd_name
|
||||
|
||||
if executable(l:ve_executable)
|
||||
return l:ve_executable
|
||||
endif
|
||||
endif
|
||||
|
||||
if executable(a:cmd_name)
|
||||
return a:cmd_name
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Given a buffer number, find the project root directory for Python.
|
||||
" The root directory is defined as the first directory found while searching
|
||||
|
||||
Reference in New Issue
Block a user