2016-10-20 11:30:45 +00:00
|
|
|
" Author: Bart Libert <bart.libert@gmail.com>
|
|
|
|
" Description: cppcheck linter for cpp files
|
|
|
|
|
|
|
|
" Set this option to change the cppcheck options
|
2017-02-11 19:40:57 +00:00
|
|
|
let g:ale_cpp_cppcheck_options = get(g:, 'ale_cpp_cppcheck_options', '--enable=style')
|
2016-10-20 11:30:45 +00:00
|
|
|
|
2017-04-16 00:24:08 +00:00
|
|
|
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
|
|
|
return 'cppcheck -q --language=c++ '
|
|
|
|
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
|
|
|
|
2016-10-20 11:30:45 +00:00
|
|
|
call ale#linter#Define('cpp', {
|
|
|
|
\ 'name': 'cppcheck',
|
|
|
|
\ 'output_stream': 'both',
|
|
|
|
\ 'executable': 'cppcheck',
|
2017-04-16 00:24:08 +00:00
|
|
|
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
2016-10-20 11:30:45 +00:00
|
|
|
\ 'callback': 'ale#handlers#HandleCppCheckFormat',
|
|
|
|
\})
|