summaryrefslogtreecommitdiff
path: root/ale_linters/handlebars
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-27 00:45:25 +0100
committerw0rp <devw0rp@gmail.com>2017-07-27 00:45:25 +0100
commitfa33faad9ed6da220394bd2abec2e1bdcd19edba (patch)
tree288fa6a1f8d2231d3e7b3b8e2915730906d6920e /ale_linters/handlebars
parentdb4d68eae75c071b2a6521fe8587102f5b781efe (diff)
downloadale-fa33faad9ed6da220394bd2abec2e1bdcd19edba.zip
#810 - Handle output which is not JSON in many linters
Diffstat (limited to 'ale_linters/handlebars')
-rw-r--r--ale_linters/handlebars/embertemplatelint.vim10
1 files changed, 2 insertions, 8 deletions
diff --git a/ale_linters/handlebars/embertemplatelint.vim b/ale_linters/handlebars/embertemplatelint.vim
index e7fa149c..963ab568 100644
--- a/ale_linters/handlebars/embertemplatelint.vim
+++ b/ale_linters/handlebars/embertemplatelint.vim
@@ -16,16 +16,10 @@ function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer) abort
endfunction
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
- if len(a:lines) == 0
- return []
- endif
-
let l:output = []
+ let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
- let l:input_json = json_decode(join(a:lines, ''))
- let l:file_errors = values(l:input_json)[0]
-
- for l:error in l:file_errors
+ for l:error in get(values(l:json), 0, [])
if has_key(l:error, 'fatal')
call add(l:output, {
\ 'bufnr': a:buffer,