mirror of
https://github.com/dense-analysis/ale.git
synced 2026-04-24 16:42:38 +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
481 B
VimL
17 lines
481 B
VimL
" Author: Albert Peschar <albert@peschar.net>
|
|
" Description: Fix files with dune format.
|
|
|
|
call ale#Set('ocaml_dune_executable', 'dune')
|
|
call ale#Set('ocaml_dune_options', '')
|
|
|
|
function! ale#fixers#dune#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'ocaml_dune_executable')
|
|
let l:options = ale#Var(a:buffer, 'ocaml_dune_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ' format'
|
|
\ . ale#Pad(l:options),
|
|
\}
|
|
endfunction
|