mirror of
https://github.com/dense-analysis/ale.git
synced 2026-04-20 22:58:00 +08:00
Standardize option padding by replacing verbose ternary checks with ale#Pad()
Replace patterns like:
(empty(x) ? '' : '' . l:options)
with:
ale#Pad(l:options)
Similar to af5a38c697
17 lines
524 B
VimL
17 lines
524 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)
|
|
\ . ale#Pad(l:options)
|
|
\ . ' -'
|
|
\}
|
|
endfunction
|