Implement support for SQL linter sqlfluff (#4361)

This commit is contained in:
Carl Smedstad
2022-11-21 11:50:45 +01:00
committed by GitHub
parent ca355f4cb4
commit 6c4be47437
7 changed files with 154 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
Before:
call ale#assert#SetUpLinterTest('sql', 'sqlfluff')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
AssertLinter 'sqlfluff',
\ ale#Escape('sqlfluff')
\ . ' lint --dialect ansi --format json %t'
Execute(The executable should be configurable):
let g:ale_sql_sqlfluff_executable = 'foobar'
AssertLinter 'foobar',
\ ale#Escape('foobar')
\ . ' lint --dialect ansi --format json %t'
Execute(Overriding options should work):
let g:ale_sql_sqlfluff_executable = 'foobar'
let g:ale_sql_sqlfluff_options = '--whatever'
AssertLinter 'foobar',
\ ale#Escape('foobar')
\ . ' lint --dialect ansi --format json --whatever %t'