Files
ale/test/fixers/test_nickel_format_fixer_callback.vader
Yining 32ee7039d0 add: support for nickel format as Nickel fixer (#4665)
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.
2023-12-07 14:55:14 +00:00

28 lines
788 B
Plaintext

Before:
Save g:ale_nickel_nickel_format_executable
Save g:ale_nickel_nickel_format_options
Save &l:expandtab
Save &l:shiftwidth
Save &l:tabstop
After:
Restore
Execute(The nickel_format callback should return 'nickel format' as default command):
setlocal noexpandtab
Assert
\ ale#fixers#nickel_format#Fix(bufnr('')).command =~# '^' . ale#Escape('nickel') . ' format',
\ "Default command name is expected to be 'nickel format'"
Execute(The nickel executable and options should be configurable):
let g:ale_nickel_nickel_format_executable = 'foobar'
let g:ale_nickel_nickel_format_options = '--some-option'
AssertEqual
\ {
\ 'command': ale#Escape('foobar')
\ . ' format'
\ . ' --some-option',
\ },
\ ale#fixers#nickel_format#Fix(bufnr(''))