mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/ale/autoload/ale/fixers/cmakeformat.vim

19 lines
604 B
VimL

" Author: Attila Maczak <attila@maczak.hu>
" Description: Integration of cmakeformat with ALE.
call ale#Set('cmake_cmakeformat_executable', 'cmake-format')
call ale#Set('cmake_cmakeformat_options', '')
function! ale#fixers#cmakeformat#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'cmake_cmakeformat_executable')
let l:options = ale#Var(a:buffer, 'cmake_cmakeformat_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' -i '
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction