Add support for cppcheck (#126)

* Add support for cppcheck

* Fix vint error in cppcheck handler

* Add vader test for CppCheck format handler
This commit is contained in:
Bart Libert
2016-10-20 13:30:45 +02:00
committed by w0rp
parent acb209aa11
commit a34fb0a6a7
6 changed files with 129 additions and 5 deletions

View File

@@ -138,5 +138,33 @@ Then (The loclist should be correct):
\ },
\], g:loclist
Execute (Run HandleCppCheckFormat):
let g:loclist = ale#handlers#HandleCppCheckFormat(42, [
\ '[/tmp/test.c:5]: (style) Variable a is assigned a value that is never used.',
\ '[/tmp/test.c:12]: (error) Array a[10] accessed at index 10, which is out of bounds.'
\])
Then (The loclist should be correct):
AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
\ 'nr': -1,
\ 'lnum': 5,
\ 'col': 0,
\ 'type': 'W',
\ 'text': 'Variable a is assigned a value that is never used. (style)',
\ },
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
\ 'nr': -1,
\ 'lnum': 12,
\ 'col': 0,
\ 'type': 'E',
\ 'text': 'Array a[10] accessed at index 10, which is out of bounds. (error)',
\ },
\], g:loclist
After:
unlet g:loclist