mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-08 13:05:16 +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
18 lines
495 B
VimL
18 lines
495 B
VimL
" Author: Zhuoyun Wei <wzyboy@wzyboy.org>
|
|
" Description: Fixer for Packer HCL files
|
|
|
|
call ale#Set('packer_fmt_executable', 'packer')
|
|
call ale#Set('packer_fmt_options', '')
|
|
|
|
function! ale#fixers#packer#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'packer_fmt_executable')
|
|
let l:options = ale#Var(a:buffer, 'packer_fmt_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ' fmt'
|
|
\ . ale#Pad(l:options)
|
|
\ . ' -'
|
|
\}
|
|
endfunction
|