mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Add nixfmt as a Nix fixer. (#3651)
* Add nixfmt fixer. * Replace manual options pad with ale#Pad()
This commit is contained in:
24
test/fixers/test_nixfmt_fixer_callback.vader
Normal file
24
test/fixers/test_nixfmt_fixer_callback.vader
Normal file
@@ -0,0 +1,24 @@
|
||||
Before:
|
||||
Save g:ale_nix_nixfmt_executable
|
||||
Save g:ale_nix_nixfmt_options
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
Execute(The nixfmt callback should return the correct default values):
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('nixfmt')
|
||||
\ },
|
||||
\ ale#fixers#nixfmt#Fix(bufnr(''))
|
||||
|
||||
Execute(The nixfmt executable and options should be configurable):
|
||||
let g:ale_nix_nixfmt_executable = '/path/to/nixfmt'
|
||||
let g:ale_nix_nixfmt_options = '--help'
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('/path/to/nixfmt')
|
||||
\ . ' --help',
|
||||
\ },
|
||||
\ ale#fixers#nixfmt#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user