Add nixfmt as a Nix fixer. (#3651)

* Add nixfmt fixer.

* Replace manual options pad with ale#Pad()
This commit is contained in:
David Houston
2021-03-23 20:02:17 -04:00
committed by GitHub
parent eb0ebe6221
commit b1f95dc4fb
7 changed files with 65 additions and 0 deletions

View 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(''))