mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-19 02:01:03 +08:00
Nickel(https://nickel-lang.org/) is a configuration language, like Jsonnet, Cue, Dhall. `nickel`(https://github.com/tweag/nickel) is the main command to run, export and also format Nickel code. this commit adds `nickel format` as a Nickel fixer, together with some tests and documentation.
17 lines
555 B
VimL
17 lines
555 B
VimL
" Author: Yining <zhang.yining@gmail.com>
|
|
" Description: nickel format as ALE fixer for Nickel files
|
|
|
|
call ale#Set('nickel_nickel_format_executable', 'nickel')
|
|
call ale#Set('nickel_nickel_format_options', '')
|
|
|
|
function! ale#fixers#nickel_format#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'nickel_nickel_format_executable')
|
|
let l:options = ale#Var(a:buffer, 'nickel_nickel_format_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable) . ' format'
|
|
\ . (empty(l:options) ? '' : ' ' . l:options)
|
|
\}
|
|
endfunction
|
|
|