2018-03-31 10:55:20 -04:00
|
|
|
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
|
|
|
" Description: flawfinder linter for c++ files
|
|
|
|
|
|
|
|
call ale#Set('cpp_flawfinder_executable', 'flawfinder')
|
|
|
|
call ale#Set('cpp_flawfinder_options', '')
|
|
|
|
call ale#Set('cpp_flawfinder_minlevel', 1)
|
2018-06-14 06:31:12 -04:00
|
|
|
call ale#Set('c_flawfinder_error_severity', 6)
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
|
|
|
|
" Set the minimum vulnerability level for flawfinder to bother with
|
|
|
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
|
|
|
|
2018-08-25 12:13:42 -04:00
|
|
|
return '%e -CDQS'
|
2018-03-31 10:55:20 -04:00
|
|
|
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
|
|
|
\ . l:minlevel
|
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('cpp', {
|
|
|
|
\ 'name': 'flawfinder',
|
|
|
|
\ 'output_stream': 'stdout',
|
2018-08-25 12:13:42 -04:00
|
|
|
\ 'executable_callback': ale#VarFunc('cpp_flawfinder_executable'),
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
|
|
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
|
|
|
\})
|