feat: support sqlformat. (#2702)

* feat: support sqlformat.
This commit is contained in:
Cluas authored and w0rp committed 2019-09-12 22:48:27 +01:00
1 parent 3e8c8d3ccb
commit a6c59faa0f
7 files changed
+66

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
" Author: Cluas <Cluas@live.cn>
" Description: Fixing files with sqlformat.
call ale#Set('sql_sqlformat_executable', 'sqlformat')
call ale#Set('sql_sqlformat_options', '')
function! ale#fixers#sqlformat#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'sql_sqlformat_executable')
let l:options = ale#Var(a:buffer, 'sql_sqlformat_options')
return {
\ 'command': ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -'
\}
endfunction