summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorCarl Smedstad <carl.smedstad@protonmail.com>2022-11-23 11:58:49 +0100
committerGitHub <noreply@github.com>2022-11-23 19:58:49 +0900
commit590352304e49874c9598fd49b0ae5ff7ddbc854c (patch)
tree21723d560ccfd7ce1f11298a5fe393da5eac9766 /ale_linters
parent0b25d712b7978c3b6a3bd968645183377d9f1761 (diff)
downloadale-590352304e49874c9598fd49b0ae5ff7ddbc854c.zip
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
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/sql/sqlfluff.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/sql/sqlfluff.vim b/ale_linters/sql/sqlfluff.vim
index 91a39908..0ec062bd 100644
--- a/ale_linters/sql/sqlfluff.vim
+++ b/ale_linters/sql/sqlfluff.vim
@@ -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'))