Merge pull request #2676 from davidtwco/nixfmt-fixer

Add nixpkgs-fmt fixer.
This commit is contained in:
w0rp authored and GitHub committed 2019-10-07 19:22:01 +01:00
commit d3a3f4011b
7 files changed
+69

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
call ale#Set('nix_nixpkgsfmt_executable', 'nixpkgs-fmt')
call ale#Set('nix_nixpkgsfmt_options', '')
function! ale#fixers#nixpkgsfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'nix_nixpkgsfmt_executable')
let l:options = ale#Var(a:buffer, 'nix_nixpkgsfmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . (empty(l:options) ? '' : ' ' . l:options),
\}
endfunction