mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-08 05:04:46 +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
523 B
VimL
18 lines
523 B
VimL
" Author: dsifford <dereksifford@gmail.com>
|
|
" Description: Fixer for terraform and .hcl files
|
|
|
|
call ale#Set('terraform_fmt_executable', 'terraform')
|
|
call ale#Set('terraform_fmt_options', '')
|
|
|
|
function! ale#fixers#terraform#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'terraform_fmt_executable')
|
|
let l:options = ale#Var(a:buffer, 'terraform_fmt_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ' fmt'
|
|
\ . ale#Pad(l:options)
|
|
\ . ' -'
|
|
\}
|
|
endfunction
|