2018-02-25 14:11:04 +00:00
|
|
|
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
|
|
|
" Description: flawfinder linter for c files
|
|
|
|
|
|
|
|
call ale#Set('c_flawfinder_executable', 'flawfinder')
|
|
|
|
call ale#Set('c_flawfinder_options', '')
|
|
|
|
call ale#Set('c_flawfinder_minlevel', 1)
|
2018-03-10 10:44:55 +00:00
|
|
|
call ale#Set('c_flawfinder_error_severity', 6)
|
2018-02-25 14:11:04 +00:00
|
|
|
|
|
|
|
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
|
2019-02-06 18:05:13 +00:00
|
|
|
" Set the minimum vulnerability level for flawfinder to bother with
|
|
|
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
2018-02-25 14:11:04 +00:00
|
|
|
|
2019-02-06 18:05:13 +00:00
|
|
|
return '%e -CDQS'
|
|
|
|
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
|
|
|
|
\ . l:minlevel
|
|
|
|
\ . ' %t'
|
2018-02-25 14:11:04 +00:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('c', {
|
|
|
|
\ 'name': 'flawfinder',
|
|
|
|
\ 'output_stream': 'stdout',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'executable': {b -> ale#Var(b, 'c_flawfinder_executable')},
|
|
|
|
\ 'command': function('ale_linters#c#flawfinder#GetCommand'),
|
2018-03-10 10:44:55 +00:00
|
|
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
2018-02-25 14:11:04 +00:00
|
|
|
\})
|