mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-07 20:54:34 +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
19 lines
545 B
VimL
19 lines
545 B
VimL
" Author: Sam Howie <samhowie@gmail.com>
|
|
" Description: Integration of hackfmt with ALE.
|
|
|
|
call ale#Set('hack_hackfmt_executable', 'hackfmt')
|
|
call ale#Set('hack_hackfmt_options', '')
|
|
|
|
function! ale#fixers#hackfmt#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'hack_hackfmt_executable')
|
|
let l:options = ale#Var(a:buffer, 'hack_hackfmt_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ' -i'
|
|
\ . ale#Pad(l:options)
|
|
\ . ' %t',
|
|
\ 'read_temporary_file': 1,
|
|
\}
|
|
endfunction
|