12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- if exists('g:loaded_syntastic_cpp_cpplint_checker')
- finish
- endif
- let g:loaded_syntastic_cpp_cpplint_checker = 1
- if !exists('g:syntastic_cpp_cpplint_thres')
- let g:syntastic_cpp_cpplint_thres = 5
- endif
- let s:save_cpo = &cpo
- set cpo&vim
- function! SyntaxCheckers_cpp_cpplint_GetLocList() dict
- let makeprg = self.makeprgBuild({ 'args': '--verbose=3' })
- let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
- let loclist = SyntasticMake({
- \ 'makeprg': makeprg,
- \ 'errorformat': errorformat,
- \ 'subtype': 'Style',
- \ 'returns': [0, 1] })
-
- for e in loclist
- let e['type'] = e['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E'
- endfor
- return loclist
- endfunction
- call g:SyntasticRegistry.CreateAndRegisterChecker({
- \ 'filetype': 'cpp',
- \ 'name': 'cpplint',
- \ 'exec': 'cpplint.py'})
- let &cpo = s:save_cpo
- unlet s:save_cpo
|