ale/ale_linters/make/checkmake.vim

26 lines
711 B
VimL
Raw Normal View History

2017-10-24 12:03:47 +00:00
" Author: aurieh - https://github.com/aurieh
function! ale_linters#make#checkmake#Handle(buffer, lines) abort
let l:pattern = '\v^(\d+):(.+):(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'type': 'E',
2017-11-15 22:58:33 +00:00
\ 'code': l:match[2],
\ 'text': l:match[3],
2017-10-24 12:03:47 +00:00
\})
endfor
2017-10-24 12:03:47 +00:00
return l:output
endfunction
call ale#linter#Define('make', {
\ 'name': 'checkmake',
\ 'executable': 'checkmake',
\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"',
\ 'callback': 'ale_linters#make#checkmake#Handle',
\})