mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix bug in sqlfluff implementation & implement fixer support (#4365)
* Account for no sqlfluff output Avoid crashes when there isn't any output from sqlfluff. * Add supplort for sqlfluff as a fixer
This commit is contained in:
@@ -37,7 +37,13 @@ endfunction
|
||||
|
||||
function! ale_linters#sql#sqlfluff#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})[0]
|
||||
let l:json_lines = ale#util#FuzzyJSONDecode(a:lines, [])
|
||||
|
||||
if empty(l:json_lines)
|
||||
return l:output
|
||||
endif
|
||||
|
||||
let l:json = l:json_lines[0]
|
||||
|
||||
" if there's no warning, 'result' is `null`.
|
||||
if empty(get(l:json, 'violations'))
|
||||
|
||||
Reference in New Issue
Block a user