mirror of https://github.com/dense-analysis/ale
Improve :ALEDetail for dockerfile_lint
1. The often longish `description` moved away from (supposedly short) statusline `message` into the `detail` section. 2. dockerfile_lint sends `reference_url` pointing to issue explanations. Use that.
This commit is contained in:
parent
70005134e5
commit
5f4103fb35
|
@ -32,14 +32,26 @@ function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
|
|||
let l:line = get(l:object, 'line', -1)
|
||||
let l:message = l:object['message']
|
||||
|
||||
if get(l:object, 'description', 'None') isnot# 'None'
|
||||
let l:message = l:message . '. ' . l:object['description']
|
||||
let l:link = get(l:object, 'reference_url', '')
|
||||
if type(l:link) == type([])
|
||||
" Somehow, reference_url is returned as two-part list.
|
||||
" Anchor markers in that list are sometimes duplicated.
|
||||
" See https://github.com/projectatomic/dockerfile_lint/issues/134
|
||||
let l:link = join(l:link, '')
|
||||
let l:link = substitute(l:link, '##', '#', '')
|
||||
endif
|
||||
|
||||
let l:detail = l:message
|
||||
if get(l:object, 'description', 'None') isnot# 'None'
|
||||
let l:detail .= "\n\n" . l:object['description']
|
||||
endif
|
||||
let l:detail .= "\n\n" . l:link
|
||||
|
||||
call add(l:messages, {
|
||||
\ 'lnum': l:line,
|
||||
\ 'text': l:message,
|
||||
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
|
||||
\ 'detail': l:detail,
|
||||
\})
|
||||
endfor
|
||||
endfor
|
||||
|
|
Loading…
Reference in New Issue