mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-16 04:37:58 +08:00
Fix elm-format fixer name
Support for elm-format as a fixer has existed since Sept 2017, but it's not easy to discover because the fixer was named `format`. This breaks the convention of the other fixers that use the full name in the registry. I've gone ahead and fixed this discrepancy, but I left the existing registry entry in place. We should move people towards using `elm-format` as the fixer name, but I'd hate to break existing setups.
This commit is contained in:
@@ -5,17 +5,17 @@ call ale#Set('elm_format_executable', 'elm-format')
|
||||
call ale#Set('elm_format_use_global', 0)
|
||||
call ale#Set('elm_format_options', '--yes')
|
||||
|
||||
function! ale#fixers#format#GetExecutable(buffer) abort
|
||||
function! ale#fixers#elm_format#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'elm_format', [
|
||||
\ 'node_modules/.bin/elm-format',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#format#Fix(buffer) abort
|
||||
function! ale#fixers#elm_format#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'elm_format_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#format#GetExecutable(a:buffer))
|
||||
\ 'command': ale#Escape(ale#fixers#elm_format#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\ 'read_temporary_file': 1,
|
||||
Reference in New Issue
Block a user