summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/mix_format.vim13
1 files changed, 10 insertions, 3 deletions
diff --git a/autoload/ale/fixers/mix_format.vim b/autoload/ale/fixers/mix_format.vim
index 04866408..3847d1b6 100644
--- a/autoload/ale/fixers/mix_format.vim
+++ b/autoload/ale/fixers/mix_format.vim
@@ -1,16 +1,23 @@
-" Author: carakan <carakan@gmail.com>
+" Author: carakan <carakan@gmail.com>, Fernando Mendes <fernando@mendes.codes>
" Description: Fixing files with elixir formatter 'mix format'.
call ale#Set('elixir_mix_executable', 'mix')
+call ale#Set('elixir_mix_format_options', '')
function! ale#fixers#mix_format#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'elixir_mix_executable')
endfunction
+function! ale#fixers#mix_format#GetCommand(buffer) abort
+ let l:executable = ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
+ let l:options = ale#Var(a:buffer, 'elixir_mix_format_options')
+
+ return l:executable . ' format ' . l:options . ' %t'
+endfunction
+
function! ale#fixers#mix_format#Fix(buffer) abort
return {
- \ 'command': ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
- \ . ' format %t',
+ \ 'command': ale#fixers#mix_format#GetCommand(a:buffer),
\ 'read_temporary_file': 1,
\}
endfunction