2016-10-20 11:30:45 +00: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 19:40:57 +00:00
|
|
|
let g:ale_c_cppcheck_options = get(g:, 'ale_c_cppcheck_options', '--enable=style')
|
2016-10-20 11:30:45 +00:00
|
|
|
|
2017-04-15 12:35:54 +00:00
|
|
|
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
|
|
|
return 'cppcheck -q --language=c '
|
2017-04-16 00:24:08 +00:00
|
|
|
\ . ale#Var(a:buffer, 'c_cppcheck_options')
|
2017-04-15 12:35:54 +00:00
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
|
|
|
|
2016-10-20 11:30:45 +00:00
|
|
|
call ale#linter#Define('c', {
|
|
|
|
\ 'name': 'cppcheck',
|
|
|
|
\ 'output_stream': 'both',
|
|
|
|
\ 'executable': 'cppcheck',
|
2017-04-15 12:35:54 +00:00
|
|
|
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
2017-04-24 21:27:18 +00:00
|
|
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
2016-10-20 11:30:45 +00:00
|
|
|
\})
|