-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoverity.vim
55 lines (46 loc) · 1.85 KB
/
coverity.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"============================================================================
"File: coverity.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Crt Mori <crt at the-mori dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the attached LICENSE
"
"============================================================================
if exists('g:loaded_syntastic_c_coverity_checker')
finish
endif
let g:loaded_syntastic_c_coverity_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_coverity_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '--text-output-style=oneline --whole-program --auth-key-file .coverity_auth_key_file'})
let errorformat =
\ '%E[ERROR] %m,' .
\ '%W[WARNING] %m,' .
\ '%E%f:%l: CID %# %m.,' .
\ '%W%f:%l: integer_signedness_changing_conversion: %m.,' .
\ '%W%f:%l: %# misra_violation: %m.,' .
\ '%W%f:%l: 1. misra_violation: %m.,' .
\ '%I%f:%l: %m'
if exists('g:syntastic_c_errorformat')
let errorformat = g:syntastic_c_errorformat
endif
" process makeprg
let errors = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_c_remove_include_errors') && g:syntastic_c_remove_include_errors != 0
return filter(errors, 'has_key(v:val, "bufnr") && v:val["bufnr"] == ' . bufnr(''))
else
return errors
endif
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'coverity',
\ 'exec': 'cov-run-desktop' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker: