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