Add g:ale_php_cs_fixer_options variable (#1477)

* Add g:ale_php_cs_fixer_options variable

* Fix test
This commit is contained in:
Adriaan Zonnenberg
2018-04-07 23:53:03 +02:00
committed by w0rp
parent bb775e4e22
commit 121e806423
3 changed files with 31 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
call ale#Set('php_cs_fixer_executable', 'php-cs-fixer')
call ale#Set('php_cs_fixer_use_global', 0)
call ale#Set('php_cs_fixer_options', '')
function! ale#fixers#php_cs_fixer#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'php_cs_fixer', [
@@ -14,10 +15,9 @@ endfunction
function! ale#fixers#php_cs_fixer#Fix(buffer) abort
let l:executable = ale#fixers#php_cs_fixer#GetExecutable(a:buffer)
return {
\ 'command': ale#Escape(l:executable) . ' fix %t',
\ 'command': ale#Escape(l:executable)
\ . ' ' . ale#Var(a:buffer, 'php_cs_fixer_options')
\ . ' fix %t',
\ 'read_temporary_file': 1,
\}
endfunction