Fixed vim and zsh
This commit is contained in:
59
vim/plugins/syntastic/syntax_checkers/c/avrgcc.vim
Normal file
59
vim/plugins/syntastic/syntax_checkers/c/avrgcc.vim
Normal file
@ -0,0 +1,59 @@
|
||||
"============================================================================
|
||||
"File: avrgcc.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: Karel <karelishere at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_avrgcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_avrgcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_avrgcc_config_file')
|
||||
let g:syntastic_avrgcc_config_file = '.syntastic_avrgcc_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:opt_x = { 'c': 'c', 'cpp': 'c++' }
|
||||
|
||||
function! SyntaxCheckers_c_avrgcc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': syntastic#c#ReadConfig(g:syntastic_avrgcc_config_file),
|
||||
\ 'args_after': '-x ' . get(s:opt_x, self.getFiletype(), '') . ' -fsyntax-only' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
|
||||
\ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
|
||||
\ '%-GIn file included%.%#,' .
|
||||
\ '%-G %#from %f:%l\,,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'avrgcc',
|
||||
\ 'exec': 'avr-gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
60
vim/plugins/syntastic/syntax_checkers/c/checkpatch.vim
Normal file
60
vim/plugins/syntastic/syntax_checkers/c/checkpatch.vim
Normal file
@ -0,0 +1,60 @@
|
||||
"============================================================================
|
||||
"File: checkpatch.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_checkpatch_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_checkpatch_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
|
||||
call syntastic#log#deprecationWarn('c_checker_checkpatch_location', 'c_checkpatch_exec')
|
||||
|
||||
if !exists('g:syntastic_c_checkpatch_exec') && !executable(self.getExec())
|
||||
if executable('checkpatch')
|
||||
let g:syntastic_c_checkpatch_exec = 'checkpatch'
|
||||
elseif executable('./scripts/checkpatch.pl')
|
||||
let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch.pl', ':p')
|
||||
elseif executable('./scripts/checkpatch')
|
||||
let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch', ':p')
|
||||
endif
|
||||
endif
|
||||
|
||||
call self.log('exec =', self.getExec())
|
||||
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '--no-summary --no-tree --terse --file' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l: %tARNING: %m,' .
|
||||
\ '%f:%l: %tRROR: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1],
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'checkpatch',
|
||||
\ 'exec': 'checkpatch.pl'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
64
vim/plugins/syntastic/syntax_checkers/c/clang_check.vim
Normal file
64
vim/plugins/syntastic/syntax_checkers/c/clang_check.vim
Normal file
@ -0,0 +1,64 @@
|
||||
"============================================================================
|
||||
"File: clang_check.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_clang_check_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_check_checker = 1
|
||||
|
||||
if !exists('g:syntastic_clang_check_config_file')
|
||||
let g:syntastic_clang_check_config_file = '.syntastic_clang_check_config'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_clang_check_sort')
|
||||
let g:syntastic_c_clang_check_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_clang_check_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args':
|
||||
\ '-- ' .
|
||||
\ syntastic#c#ReadConfig(g:syntastic_clang_check_config_file) . ' ' .
|
||||
\ '-fshow-column ' .
|
||||
\ '-fshow-source-location ' .
|
||||
\ '-fno-caret-diagnostics ' .
|
||||
\ '-fno-color-diagnostics ' .
|
||||
\ '-fdiagnostics-format=clang' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
|
||||
\ '%E%m'
|
||||
|
||||
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
64
vim/plugins/syntastic/syntax_checkers/c/clang_tidy.vim
Normal file
64
vim/plugins/syntastic/syntax_checkers/c/clang_tidy.vim
Normal file
@ -0,0 +1,64 @@
|
||||
"============================================================================
|
||||
"File: clang_tidy.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_clang_tidy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_tidy_checker = 1
|
||||
|
||||
if !exists('g:syntastic_clang_tidy_config_file')
|
||||
let g:syntastic_clang_tidy_config_file = '.syntastic_clang_tidy_config'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_clang_tidy_sort')
|
||||
let g:syntastic_c_clang_tidy_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_clang_tidy_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args':
|
||||
\ '-- ' .
|
||||
\ syntastic#c#ReadConfig(g:syntastic_clang_tidy_config_file) . ' ' .
|
||||
\ '-fshow-column ' .
|
||||
\ '-fshow-source-location ' .
|
||||
\ '-fno-caret-diagnostics ' .
|
||||
\ '-fno-color-diagnostics ' .
|
||||
\ '-fdiagnostics-format=clang' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
|
||||
\ '%E%m'
|
||||
|
||||
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
62
vim/plugins/syntastic/syntax_checkers/c/cppcheck.vim
Normal file
62
vim/plugins/syntastic/syntax_checkers/c/cppcheck.vim
Normal file
@ -0,0 +1,62 @@
|
||||
"============================================================================
|
||||
"File: cppcheck.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using cppcheck.pl
|
||||
"Maintainer: LCD 47 <lcd047 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_cppcheck_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_cppcheck_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cppcheck_config_file')
|
||||
let g:syntastic_cppcheck_config_file = '.syntastic_cppcheck_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_cppcheck_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_cppcheck_config_file),
|
||||
\ 'args_after': '-q --enable=style' })
|
||||
|
||||
let errorformat =
|
||||
\ '[%f:%l]: (%trror) %m,' .
|
||||
\ '[%f:%l]: (%tarning) %m,' .
|
||||
\ '[%f:%l]: (%ttyle) %m,' .
|
||||
\ '[%f:%l]: (%terformance) %m,' .
|
||||
\ '[%f:%l]: (%tortability) %m,' .
|
||||
\ '[%f:%l]: (%tnformation) %m,' .
|
||||
\ '[%f:%l]: (%tnconclusive) %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'cppcheck',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] =~? '\m^[SPI]'
|
||||
let e['type'] = 'w'
|
||||
let e['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'cppcheck'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
40
vim/plugins/syntastic/syntax_checkers/c/cppclean.vim
Normal file
40
vim/plugins/syntastic/syntax_checkers/c/cppclean.vim
Normal file
@ -0,0 +1,40 @@
|
||||
"============================================================================
|
||||
"File: cppclean.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_cppclean_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_cppclean_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_cppclean_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'cppclean' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
61
vim/plugins/syntastic/syntax_checkers/c/flawfinder.vim
Normal file
61
vim/plugins/syntastic/syntax_checkers/c/flawfinder.vim
Normal file
@ -0,0 +1,61 @@
|
||||
"============================================================================
|
||||
"File: flawfinder.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_flawfinder_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_flawfinder_checker = 1
|
||||
|
||||
if !exists('g:syntastic_c_flawfinder_sort')
|
||||
let g:syntastic_c_flawfinder_sort = 1
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_flawfinder_thres')
|
||||
let g:syntastic_c_flawfinder_thres = 3
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_flawfinder_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m^(\S\+)\s\+\zs\S\+\ze:')
|
||||
return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_flawfinder_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '--columns --dataonly --singleline --quiet' })
|
||||
|
||||
let errorformat = '%f:%l:%c: [%n] %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
let e['type'] = e['nr'] < g:syntastic_{self.getFiletype()}_flawfinder_thres ? 'W' : 'E'
|
||||
let e['nr'] = 0
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'flawfinder' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
59
vim/plugins/syntastic/syntax_checkers/c/gcc.vim
Normal file
59
vim/plugins/syntastic/syntax_checkers/c/gcc.vim
Normal file
@ -0,0 +1,59 @@
|
||||
"============================================================================
|
||||
"File: c.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_c_compiler_options')
|
||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable() dict
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
|
||||
endif
|
||||
call self.log('g:syntastic_c_compiler =', g:syntastic_c_compiler)
|
||||
return executable(expand(g:syntastic_c_compiler, 1))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_gcc_GetLocList() dict
|
||||
return syntastic#c#GetLocList('c', 'gcc', {
|
||||
\ 'errorformat':
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
|
||||
\ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
|
||||
\ '%-GIn file included%.%#,' .
|
||||
\ '%-G %#from %f:%l\,,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m',
|
||||
\ 'main_flags': '-x c -fsyntax-only',
|
||||
\ 'header_flags': '-x c',
|
||||
\ 'header_names': '\m\.h$' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'gcc' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
61
vim/plugins/syntastic/syntax_checkers/c/make.vim
Normal file
61
vim/plugins/syntastic/syntax_checkers/c/make.vim
Normal file
@ -0,0 +1,61 @@
|
||||
"============================================================================
|
||||
"File: make.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_make_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_make_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_make_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args': '-sk', 'fname': '' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
|
||||
\ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
|
||||
\ '%-GIn file included%.%#,' .
|
||||
\ '%-G %#from %f:%l\,,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%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': 'make'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
65
vim/plugins/syntastic/syntax_checkers/c/oclint.vim
Normal file
65
vim/plugins/syntastic/syntax_checkers/c/oclint.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_oclint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_oclint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_oclint_config_file')
|
||||
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_oclint_sort')
|
||||
let g:syntastic_c_oclint_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_oclint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%E%f:%l:%c: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'returns': [0, 3, 5] })
|
||||
|
||||
for e in loclist
|
||||
if e['text'] =~# '\v P3( |$)'
|
||||
let e['type'] = 'W'
|
||||
endif
|
||||
|
||||
let e['text'] = substitute(e['text'], '\m\C P[1-3]$', '', '')
|
||||
let e['text'] = substitute(e['text'], '\m\C P[1-3] ', ': ', '')
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'oclint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
67
vim/plugins/syntastic/syntax_checkers/c/pc_lint.vim
Normal file
67
vim/plugins/syntastic/syntax_checkers/c/pc_lint.vim
Normal file
@ -0,0 +1,67 @@
|
||||
"============================================================================
|
||||
"File: pc_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Steve Bragg <steve at empresseffects 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_pc_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_pc_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_pc_lint_config_file')
|
||||
let g:syntastic_pc_lint_config_file = 'options.lnt'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_pc_lint_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, fnamemodify(bufname(buf), ':p:h'))
|
||||
call self.log('config =', config)
|
||||
|
||||
" -hFs1 - show filename, add space after messages, try to make message 1 line
|
||||
" -width(0,0) - make sure there are no line breaks
|
||||
" -t - set tab size
|
||||
" -v - turn off verbosity
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (filereadable(config) ? syntastic#util#shescape(fnamemodify(config, ':p')) : ''),
|
||||
\ 'args_after': ['-hFs1', '-width(0,0)', '-t' . &tabstop, '-format=%f:%l:%C:%t:%n:%m'] })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%v:Error:%n:%m,' .
|
||||
\ '%W%f:%l:%v:Warning:%n:%m,' .
|
||||
\ '%I%f:%l:%v:Info:%n:%m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['cygwinRemoveCR'] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] ==? 'I'
|
||||
let e['type'] = 'W'
|
||||
let e['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
48
vim/plugins/syntastic/syntax_checkers/c/sparse.vim
Normal file
48
vim/plugins/syntastic/syntax_checkers/c/sparse.vim
Normal file
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: sparse.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using sparse.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_sparse_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_sparse_checker = 1
|
||||
|
||||
if !exists('g:syntastic_sparse_config_file')
|
||||
let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_sparse_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
|
||||
\ 'args_after': '-ftabstop=' . &ts })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%v: %trror: %m,' .
|
||||
\ '%f:%l:%v: %tarning: %m,'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'sparse'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
55
vim/plugins/syntastic/syntax_checkers/c/splint.vim
Normal file
55
vim/plugins/syntastic/syntax_checkers/c/splint.vim
Normal file
@ -0,0 +1,55 @@
|
||||
"============================================================================
|
||||
"File: splint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail 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 Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_splint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_splint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_splint_config_file')
|
||||
let g:syntastic_splint_config_file = '.syntastic_splint_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_splint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_splint_config_file),
|
||||
\ 'args_after': '-showfunc -hints +quiet' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%W%f:%l:%v: %m,' .
|
||||
\ '%W%f(%l\,%v): %m,' .
|
||||
\ '%W%f:%l: %m,' .
|
||||
\ '%W%f(%l): %m,' .
|
||||
\ '%-C %\+In file included from %.%#,' .
|
||||
\ '%-C %\+from %.%#,' .
|
||||
\ '%+C %.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'defaults': {'type': 'W'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'splint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
Reference in New Issue
Block a user