mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 05:22:31 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user