mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 21:42:31 +08:00
Allow passing options to mix_format
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user