All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 call ale#Set('lua_selene_executable', 'selene')
2 call ale#Set('lua_selene_options', '')
4 function! ale_linters#lua#selene#GetCommand(buffer) abort
5 return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_selene_options'))
6 \ . ' --display-style=json -'
9 function! ale_linters#lua#selene#Handle(buffer, lines) abort
13 " as of version 0.17.0, selene has no way to suppress summary
14 " information when outputting json, so stop processing when we hit it
15 " (PR for this here: https://github.com/Kampfkarren/selene/pull/356)
16 if l:line is# 'Results:'
20 let l:json = json_decode(l:line)
22 \ 'lnum': l:json.primary_label.span.start_line + 1,
23 \ 'end_lnum': l:json.primary_label.span.end_line + 1,
24 \ 'col': l:json.primary_label.span.start_column + 1,
25 \ 'end_col': l:json.primary_label.span.end_column,
26 \ 'text': l:json.message,
27 \ 'code': l:json.code,
28 \ 'type': l:json.severity is# 'Warning' ? 'W' : 'E',
31 if has_key(l:json, 'notes') && len(l:json.notes) > 0
32 let l:lint.detail = l:lint.text . "\n\n" . join(l:json.notes, "\n")
35 call add(l:output, l:lint)
41 call ale#linter#Define('lua', {
43 \ 'executable': {b -> ale#Var(b, 'lua_selene_executable')},
44 \ 'command': function('ale_linters#lua#selene#GetCommand'),
45 \ 'callback': 'ale_linters#lua#selene#Handle',