1
0
Fork 0
mirror of synced 2024-05-30 14:01:11 -04:00
ultimate-vim/sources_non_forked/ale/autoload/ale/fixers/yapf.vim
Amir Salihefendic 3e3297af67 Updated plugins
2018-06-14 12:31:12 +02:00

27 lines
718 B
VimL

" Author: w0rp <devw0rp@gmail.com>
" Description: Fixing Python files with yapf.
call ale#Set('python_yapf_executable', 'yapf')
call ale#Set('python_yapf_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale#fixers#yapf#Fix(buffer) abort
let l:executable = ale#python#FindExecutable(
\ a:buffer,
\ 'python_yapf',
\ ['yapf'],
\)
if !executable(l:executable)
return 0
endif
let l:config = ale#path#FindNearestFile(a:buffer, '.style.yapf')
let l:config_options = !empty(l:config)
\ ? ' --no-local-style --style ' . ale#Escape(l:config)
\ : ''
return {
\ 'command': ale#Escape(l:executable) . l:config_options,
\}
endfunction