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 " Author: fiatjaf <fiatjaf@alhur.es>
2 " Description: v build for V files
4 call ale#Set('v_v_executable', 'v')
5 call ale#Set('v_v_options', '')
7 function! ale_linters#v#v#Handler(buffer, lines) abort
8 let l:dir = expand('#' . a:buffer . ':p:h')
11 " Matches patterns like the following:
13 " ./const.v:4:3: warning: const names cannot contain uppercase letters, use snake_case instead
16 " 4 | BUTTON_TEXT = 'OK'
19 " ./main.v:4:8: warning: module 'os' is imported but never used
26 " ./main.v:20:10: error: undefined ident: `win_widt`
27 " 18 | mut app := &App{}
28 " 19 | app.window = ui.window({
29 " 20 | width: win_widt
31 " 21 | height: win_height
32 " 22 | title: 'Counter'
36 " matches basic error description
37 let l:match = matchlist(l:line,
38 \ '\([^:]\+\):\([^:]\+\):\([^:]\+\): \([^:]\+\): \(.*\)')
42 \ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
43 \ 'lnum': l:match[2] + 0,
44 \ 'col': l:match[3] + 0,
46 \ 'type': l:match[4] is# 'error' ? 'E' : 'W',
48 call add(l:output, l:current)
52 " try to get information about the ending column
53 let l:tildematch = matchstr(l:line, '\~\+')
55 if !empty(l:tildematch)
56 let l:current['end_col'] = l:current['col'] + len(l:tildematch)
63 call ale#linter#Define('v', {
65 \ 'executable': {b -> ale#Var(b, 'v_v_executable')},
67 \ '%e' . ale#Pad(ale#Var(b, 'v_v_options'))
68 \ . ' . -o /tmp/vim-ale-v'
70 \ 'output_stream': 'stderr',
71 \ 'callback': 'ale_linters#v#v#Handler',