feat: support sqlformat. (#2702)

* feat: support sqlformat.
This commit is contained in:
Cluas
2019-09-13 05:48:27 +08:00
committed by w0rp
parent 3e8c8d3ccb
commit a6c59faa0f
7 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
Before:
Save g:ale_sql_sqlformat_executable
Save g:ale_sql_sqlformat_options
After:
Restore
Execute(The sqlformat callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape('sqlformat') . ' -'
\ },
\ ale#fixers#sqlformat#Fix(bufnr(''))
Execute(The sqlformat executable and options should be configurable):
let g:ale_sql_sqlformat_executable = '/path/to/sqlformat'
let g:ale_sql_sqlformat_options = '-a'
AssertEqual
\ {
\ 'command': ale#Escape('/path/to/sqlformat')
\ . ' -a -'
\ },
\ ale#fixers#sqlformat#Fix(bufnr(''))