summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorDawid Kurek <dawikur@gmail.com>2017-05-10 19:41:58 +0200
committerDawid Kurek <dawikur@gmail.com>2017-05-16 19:09:59 +0200
commit9185a0d2e5d229a9fdfdc25279ae1b4c701ac4d9 (patch)
tree64d0ee9e358db46d12c6dd86d7eae8baf2105b0f /autoload
parent8712aee5dcddd366ae52a0c57e67fdbc13c030ee (diff)
downloadale-9185a0d2e5d229a9fdfdc25279ae1b4c701ac4d9.zip
Add cpplint linter
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/cpplint.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/autoload/ale/handlers/cpplint.vim b/autoload/ale/handlers/cpplint.vim
new file mode 100644
index 00000000..46078633
--- /dev/null
+++ b/autoload/ale/handlers/cpplint.vim
@@ -0,0 +1,20 @@
+" Author: Dawid Kurek https://github.com/dawikur
+" Description: Handle errors for cpplint.
+
+function! ale#handlers#cpplint#HandleCppLintFormat(buffer, lines) abort
+ " Look for lines like the following.
+ " test.cpp:5: Estra space after ( in function call [whitespace/parents] [4]
+ let l:pattern = '^.\{-}:\(\d\+\): \(.\+\)'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'col': 0,
+ \ 'text': l:match[2],
+ \ 'type': 'W',
+ \})
+ endfor
+
+ return l:output
+endfunction