]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/handlers/cpplint.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / handlers / cpplint.vim
1 " Author: Dawid Kurek https://github.com/dawikur
2 " Description: Handle errors for cpplint.
3
4 function! ale#handlers#cpplint#HandleCppLintFormat(buffer, lines) abort
5     " Look for lines like the following.
6     " test.cpp:5:  Estra space after ( in function call [whitespace/parents] [4]
7     let l:pattern = '^.\{-}:\(\d\+\): *\(.\+\) *\[\(.*/.*\)\] '
8     let l:output = []
9
10     for l:match in ale#util#GetMatches(a:lines, l:pattern)
11         call add(l:output, {
12         \   'lnum': l:match[1] + 0,
13         \   'col': 0,
14         \   'text': join(split(l:match[2])),
15         \   'code': l:match[3],
16         \   'type': 'W',
17         \})
18     endfor
19
20     return l:output
21 endfunction