1 "============================================================================
3 "Description: Syntax checking plugin for syntastic.vim using cppcheck.pl
4 "Maintainer: LCD 47 <lcd047 at gmail dot com>
5 "License: This program is free software. It comes without any warranty,
6 " to the extent permitted by applicable law. You can redistribute
7 " it and/or modify it under the terms of the Do What The Fuck You
8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
10 "============================================================================
12 " The setting 'g:syntastic_cppcheck_config_file' allows you to define a file
13 " that contains additional compiler arguments like include directories or
14 " CFLAGS. The file is expected to contain one option per line. If none is
15 " given the filename defaults to '.syntastic_cppcheck_config':
17 " let g:syntastic_cppcheck_config_file = '.config'
19 if exists("g:loaded_syntastic_c_cppcheck_checker")
22 let g:loaded_syntastic_c_cppcheck_checker = 1
24 if !exists('g:syntastic_cppcheck_config_file')
25 let g:syntastic_cppcheck_config_file = '.syntastic_cppcheck_config'
31 function! SyntaxCheckers_c_cppcheck_GetLocList() dict
32 let makeprg = self.makeprgBuild({
33 \ 'args': syntastic#c#ReadConfig(g:syntastic_cppcheck_config_file),
34 \ 'args_after': '-q --enable=style' })
37 \ '[%f:%l]: (%trror) %m,' .
38 \ '[%f:%l]: (%tarning) %m,' .
39 \ '[%f:%l]: (%ttyle) %m,' .
40 \ '[%f:%l]: (%terformance) %m,' .
41 \ '[%f:%l]: (%tortability) %m,' .
42 \ '[%f:%l]: (%tnformation) %m,' .
43 \ '[%f:%l]: (%tnconclusive) %m,' .
46 let loclist = SyntasticMake({
48 \ 'errorformat': errorformat,
49 \ 'preprocess': 'cppcheck',
53 if e['type'] =~? '\m^[SPI]'
55 let e['subtype'] = 'Style'
62 call g:SyntasticRegistry.CreateAndRegisterChecker({
64 \ 'name': 'cppcheck'})
69 " vim: set et sts=4 sw=4: