Add hackfmt fixer

This commit is contained in:
Sam Howie authored and Sam Howie committed 2017-10-27 13:42:55 -07:00
1 parent 73b8181ce6
commit 36898436b5
7 files changed
+74 -2

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
" Author: Sam Howie <samhowie@gmail.com>
" Description: Integration of hackfmt with ALE.
call ale#Set('php_hackfmt_executable', 'hackfmt')
call ale#Set('php_hackfmt_options', '')
function! ale#fixers#hackfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'php_hackfmt_executable')
let l:options = ale#Var(a:buffer, 'php_hackfmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' -i'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction