Merge pull request #1897 from LEI/add-sqlfmt-fixer

Add support for sqlfmt
This commit is contained in:
w0rp authored and GitHub committed 2018-09-09 11:55:42 +01:00
commit 0948dcc435
6 files changed
+73 -2

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
call ale#Set('sql_sqlfmt_executable', 'sqlfmt')
call ale#Set('sql_sqlfmt_options', '')
function! ale#fixers#sqlfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'sql_sqlfmt_executable')
let l:options = ale#Var(a:buffer, 'sql_sqlfmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' -w'
\ . (empty(l:options) ? '' : ' ' . l:options),
\}
endfunction