diff options
Diffstat (limited to 'vim/bundle/syntastic/syntax_checkers')
222 files changed, 12012 insertions, 0 deletions
diff --git a/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim b/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim new file mode 100644 index 0000000..1066769 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim @@ -0,0 +1,67 @@ +"============================================================================ +"File: mxmlc.vim +"Description: ActionScript syntax checker - using mxmlc +"Maintainer: Andy Earnshaw <andyearnshaw@gmail.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_actionscript_mxmlc_checker') + finish +endif +let g:loaded_syntastic_actionscript_mxmlc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item) + let term = '' + + if match(a:item['text'], '\mvariable ''') > -1 + let term = matchstr(a:item['text'], '\m''\zs[^'']\+\ze''') + + elseif match(a:item['text'], 'expected a definition keyword') > -1 + let term = matchstr(a:item['text'], '\mnot \zs[^.]\+\ze\.') + + elseif match(a:item['text'], '\mundefined \%(property\|method\)') > -1 + let term = matchstr(a:item['text'], '\mundefined \%(property\|method\) \zs[^. ]\+\ze') + + elseif match(a:item['text'], 'could not be found') > -1 + let term = matchstr(a:item['text'], '\m \zs\S\+\ze could not be found') + + elseif match(a:item['text'], 'Type was not found') > -1 + let term = matchstr(a:item['text'], '\m: \zs[^.]\+\zs\.') + + endif + + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict + call syntastic#log#deprecationWarn('actionscript_mxmlc_conf', 'actionscript_mxmlc_args', + \ "'-load-config+=' . syntastic#util#shexpand(OLD_VAR)") + + let makeprg = self.makeprgBuild({ 'args_after': '-output=' . syntastic#util#DevNull() }) + + let errorformat = + \ '%f(%l): col: %c %trror: %m,' . + \ '%f(%l): col: %c %tarning: %m,' . + \ '%f: %trror: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'actionscript', + \ 'name': 'mxmlc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim b/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim new file mode 100644 index 0000000..6072ae4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: ada.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com> +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. +" +"============================================================================ + +if exists('g:loaded_syntastic_ada_gcc_checker') + finish +endif +let g:loaded_syntastic_ada_gcc_checker = 1 + +if !exists('g:syntastic_ada_compiler_options') + let g:syntastic_ada_compiler_options = '' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ada_gcc_IsAvailable() dict + if !exists('g:syntastic_ada_compiler') + let g:syntastic_ada_compiler = self.getExec() + endif + return executable(expand(g:syntastic_ada_compiler, 1)) +endfunction + +function! SyntaxCheckers_ada_gcc_GetLocList() dict + return syntastic#c#GetLocList('ada', 'gcc', { + \ 'errorformat': + \ '%-G%f:%s:,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %m', + \ 'main_flags': '-c -x ada -gnats -gnatef', + \ 'header_flags': '-x ada -gnats -gnatef', + \ 'header_names': '\.ads$' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ada', + \ 'name': 'gcc' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim b/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim new file mode 100644 index 0000000..fe62581 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim @@ -0,0 +1,54 @@ +"============================================================================ +"File: ansible_lint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Erik Zaadi <erik.zaadi 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_ansible_ansible_lint_checker') + finish +endif +let g:loaded_syntastic_ansible_ansible_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ansible_ansible_lint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 0, 4]) +endfunction + +function! SyntaxCheckers_ansible_ansible_lint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-p' }) + + let errorformat = + \ '%f:%l: [EANSIBLE%n] %m,' . + \ '%f:%l: [ANSIBLE%n] %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'defaults': {'type': 'E'}, + \ 'subtype': 'Style', + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ansible', + \ 'name': 'ansible_lint', + \ 'exec': 'ansible-lint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim b/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim new file mode 100644 index 0000000..e404a4f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: drafter.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_apiblueprint_drafter_checker') + finish +endif +let g:loaded_syntastic_apiblueprint_drafter_checker = 1 + +if !exists('g:syntastic_apiblueprint_drafter_sort') + let g:syntastic_apiblueprint_drafter_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_apiblueprint_drafter_GetLocList() dict + let makeprg = self.makeprgBuild({ 'post_args': '-u -l' }) + + let errorformat = + \ '%trror: (%n) %m,' . + \ '%tarning: (%n) %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 2, 3, 4] }) + + for e in loclist + let matches = matchlist(e['text'], '\v^(.+); line (\d+), column (\d+) - line (\d+), column (\d+)$') + if len(matches) > 5 + let e['lnum'] = str2nr(matches[2]) + let e['col'] = str2nr(matches[3]) + let e['vcol'] = 0 + + if matches[2] == matches[4] + let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . matches[5] . 'c' + endif + + let e['text'] = matches[1] + else + let e['valid'] = 0 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'apiblueprint', + \ 'name': 'drafter'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim b/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim new file mode 100644 index 0000000..406e029 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim @@ -0,0 +1,49 @@ +"============================================================================== +" FileName: applescript.vim +" Desc: Syntax checking plugin for syntastic.vim +" Author: Zhao Cai +" Email: caizhaoff@gmail.com +" Version: 0.2.1 +" Date Created: Thu 09 Sep 2011 10:30:09 AM EST +" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST +" +" History: 0.1.0 - working, but it will run the script everytime to check +" syntax. Should use osacompile but strangely it does not give +" errors. +" +" 0.2.0 - switch to osacompile, it gives less errors compared +" with osascript. +" +" 0.2.1 - remove g:syntastic_applescript_tempfile. use +" tempname() instead. +" +" 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_applescript_osacompile_checker') + finish +endif +let g:loaded_syntastic_applescript_osacompile_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_applescript_osacompile_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-o ' . tempname() . '.scpt' }) + let errorformat = '%f:%l:%m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'applescript', + \ 'name': 'osacompile' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim b/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim new file mode 100644 index 0000000..bc64e6a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: asciidoc.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_asciidoc_asciidoc_checker') + finish +endif +let g:loaded_syntastic_asciidoc_asciidoc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() }) + + let errorformat = + \ '%E%\w%\+: %tRROR: %f: line %l: %m,' . + \ '%E%\w%\+: %tRROR: %f: %m,' . + \ '%E%\w%\+: FAILED: %f: line %l: %m,' . + \ '%E%\w%\+: FAILED: %f: %m,' . + \ '%W%\w%\+: %tARNING: %f: line %l: %m,' . + \ '%W%\w%\+: %tARNING: %f: %m,' . + \ '%W%\w%\+: DEPRECATED: %f: line %l: %m,' . + \ '%W%\w%\+: DEPRECATED: %f: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'asciidoc', + \ 'name': 'asciidoc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim b/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim new file mode 100644 index 0000000..d352eee --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim @@ -0,0 +1,61 @@ +"============================================================================ +"File: gcc.vim +"Description: Syntax checking for at&t and intel assembly files with gcc +"Maintainer: Josh Rahm <joshuarahm@gmail.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_asm_gcc_checker') + finish +endif +let g:loaded_syntastic_asm_gcc_checker = 1 + +if !exists('g:syntastic_asm_compiler_options') + let g:syntastic_asm_compiler_options = '' +endif + +if !exists('g:syntastic_asm_generic') + let g:syntastic_asm_generic = 0 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_asm_gcc_IsAvailable() dict " {{{1 + if !exists('g:syntastic_asm_compiler') + let g:syntastic_asm_compiler = self.getExec() + endif + return executable(expand(g:syntastic_asm_compiler, 1)) +endfunction " }}}1 + +function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1 + return syntastic#c#GetLocList('asm', 'gcc', { + \ 'errorformat': + \ '%-G%f:%s:,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l: %m', + \ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect()) }) +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetDialect() " {{{2 + return syntastic#util#var('asm_dialect', expand('%:e', 1) ==? 'asm' ? 'intel' : 'att') +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'asm', + \ 'name': 'gcc' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim b/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim new file mode 100644 index 0000000..1837067 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim @@ -0,0 +1,35 @@ +"============================================================================ +"File: bemhtmllint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sergej Tatarincev <s.tatarincev at yandex.ua> +"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_bemhtml_bemhtmllint_checker') + finish +endif + +let g:loaded_syntastic_bemhtml_bemhtmllint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function SyntaxCheckers_bemhtml_bemhtmllint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + let errorformat = '%f:%l:%c: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'bemhtml', + \ 'name': 'bemhtmllint', + \ 'exec': 'bemhtml-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/bro/bro.vim b/vim/bundle/syntastic/syntax_checkers/bro/bro.vim new file mode 100644 index 0000000..cea441b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/bro/bro.vim @@ -0,0 +1,58 @@ +"============================================================================ +"File: bro.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Justin Azoff <justin.azoff@gmail.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_bro_bro_checker') + finish +endif +let g:loaded_syntastic_bro_bro_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_bro_bro_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m at or near "\zs[^"]\+\ze"') + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_bro_bro_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + + if syntastic#util#system(self.getExecEscaped() . ' --help') !~# '--parse-only' + call self.log('unknown option "--parse-only"') + return 0 + endif + + return 1 +endfunction + +function! SyntaxCheckers_bro_bro_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' }) + + "example: error in ./foo.bro, line 3: unknown identifier banana, at or near "banana" + let errorformat = '%t:%f:%l:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'bro' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'bro', + \ 'name': 'bro'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim b/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim new file mode 100644 index 0000000..0fbb984 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: avrgcc.vim +"Description: Syntax checking plugin for syntastic.vim +"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 + +function! SyntaxCheckers_c_avrgcc_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': syntastic#c#ReadConfig(g:syntastic_avrgcc_config_file), + \ 'args_after': '-x c -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim b/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim new file mode 100644 index 0000000..43b047c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim b/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim new file mode 100644 index 0000000..4c3677a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim b/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim new file mode 100644 index 0000000..6d8cbfe --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim b/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim new file mode 100644 index 0000000..cd802a8 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/gcc.vim b/vim/bundle/syntastic/syntax_checkers/c/gcc.vim new file mode 100644 index 0000000..4fa9216 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/gcc.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/make.vim b/vim/bundle/syntastic/syntax_checkers/c/make.vim new file mode 100644 index 0000000..e477994 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/make.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/oclint.vim b/vim/bundle/syntastic/syntax_checkers/c/oclint.vim new file mode 100644 index 0000000..f172a11 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/oclint.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim b/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim new file mode 100644 index 0000000..6efd17a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim @@ -0,0 +1,66 @@ +"============================================================================ +"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 config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, expand('%:p:h', 1)) + 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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/sparse.vim b/vim/bundle/syntastic/syntax_checkers/c/sparse.vim new file mode 100644 index 0000000..ca831c0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/sparse.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/c/splint.vim b/vim/bundle/syntastic/syntax_checkers/c/splint.vim new file mode 100644 index 0000000..a4e19f0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/c/splint.vim @@ -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: diff --git a/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim b/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim new file mode 100644 index 0000000..e43aefa --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: cabal.vim +"Description: Haskell package description (.cabal file) linting and syntax +" validation via 'cabal check' +"Maintainer: Ian D. Bollinger <ian.bollinger@gmail.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_cabal_cabal_checker') + finish +endif +let g:loaded_syntastic_cabal_cabal_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item) + let field = matchstr(a:item['text'], "\\vParse of field '\\zs[^']+") + if field !=# '' + return '\v\c^\s*' . field . '\s*:\s*\zs.*$' + endif + let field = matchstr(a:item['text'], "\\v(^|\\s)'\\zs[^']+\\ze'") + if field !=# '' + return '\V\c\<' . escape(field, '\') . '\>' + endif + return '' +endfunction + +function! SyntaxCheckers_cabal_cabal_GetLocList() dict + let makeprg = self.getExecEscaped() . ' check' + + let errorformat = + \ '%Ecabal: %f:%l: %m,' . + \ '%W* %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h', 1), + \ 'preprocess': 'cabal', + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cabal', + \ 'name': 'cabal'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim b/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim new file mode 100644 index 0000000..84d9af1 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: foodcritic.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Doug Ireton <dougireton@gmail.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_chef_foodcritic_checker') + finish +endif +let g:loaded_syntastic_chef_foodcritic_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_chef_foodcritic_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + " FC023: Prefer conditional attributes: ./recipes/config.rb:49 + let errorformat = 'FC%n: %m: %f:%l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'chef', + \ 'name': 'foodcritic'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/co/coco.vim b/vim/bundle/syntastic/syntax_checkers/co/coco.vim new file mode 100644 index 0000000..9be5d7d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/co/coco.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: co.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Andrew Kelley <superjoe30@gmail.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_co_coco_checker') + finish +endif +let g:loaded_syntastic_co_coco_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_co_coco_GetLocList() dict + let tmpdir = syntastic#util#tmpdir() + let makeprg = self.makeprgBuild({ 'args_after': '-c -o ' . tmpdir }) + + let errorformat = + \ '%EFailed at: %f,' . + \ '%ZSyntax%trror: %m on line %l,'. + \ '%EFailed at: %f,'. + \ '%Z%trror: Parse error on line %l: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + call syntastic#util#rmrf(tmpdir) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'co', + \ 'name': 'coco'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim b/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim new file mode 100644 index 0000000..0cff0cc --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: cobc.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_cobol_cobc_checker') + finish +endif +let g:loaded_syntastic_cobol_cobc_checker = 1 + +if !exists('g:syntastic_cobol_compiler_options') + let g:syntastic_cobol_compiler_options = '' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cobol_cobc_IsAvailable() dict + if !exists('g:syntastic_cobol_compiler') + let g:syntastic_cobol_compiler = self.getExec() + endif + call self.log('g:syntastic_cobol_compiler =', g:syntastic_cobol_compiler) + return executable(expand(g:syntastic_cobol_compiler, 1)) +endfunction + +function! SyntaxCheckers_cobol_cobc_GetLocList() dict + return syntastic#c#GetLocList('cobol', 'cobc', { + \ 'errorformat': '%f:%l: %trror: %m', + \ 'main_flags': '-fsyntax-only' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cobol', + \ 'name': 'cobc' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim b/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim new file mode 100644 index 0000000..3b521fc --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim @@ -0,0 +1,58 @@ +"============================================================================ +"File: coffee.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lincoln Stoll <l@lds.li> +"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. +" +"============================================================================ +" +" Note: this script requires CoffeeScript version 1.6.2 or newer. +" + +if exists('g:loaded_syntastic_coffee_coffee_checker') + finish +endif +let g:loaded_syntastic_coffee_coffee_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_coffee_coffee_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + let ver = self.getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull()) + return syntastic#util#versionIsAtLeast(ver, [1, 6, 2]) +endfunction + +function! SyntaxCheckers_coffee_coffee_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-cp' }) + + let errorformat = + \ '%E%f:%l:%c: %trror: %m,' . + \ 'Syntax%trror: In %f\, %m on line %l,' . + \ '%EError: In %f\, Parse error on line %l: %m,' . + \ '%EError: In %f\, %m on line %l,' . + \ '%W%f(%l): lint warning: %m,' . + \ '%W%f(%l): warning: %m,' . + \ '%E%f(%l): SyntaxError: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coffee', + \ 'name': 'coffee'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim b/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim new file mode 100644 index 0000000..befdbc8 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: coffeelint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lincoln Stoll <l@lds.li> +"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_coffee_coffeelint_checker') + finish +endif +let g:loaded_syntastic_coffee_coffeelint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict + if !exists('s:coffeelint_new') + let s:coffeelint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 4]) + endif + let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') }) + + let errorformat = '%f:%l:%t:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1], + \ 'preprocess': 'coffeelint' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coffee', + \ 'name': 'coffeelint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim b/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim new file mode 100644 index 0000000..6385554 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: coqtop.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Matvey Aksenov <matvey.aksenov 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_coq_coqtop_checker') + finish +endif +let g:loaded_syntastic_coq_coqtop_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_coq_coqtop_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-noglob -batch -load-vernac-source' }) + + let errorformat = + \ '%AFile "%f"\, line %l\, characters %c-%.%#\:,'. + \ '%C%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coq', + \ 'name': 'coqtop'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim b/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim new file mode 100644 index 0000000..cf9ec0c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_cpp_clang_check_checker') + finish +endif +let g:loaded_syntastic_cpp_clang_check_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'clang_check', + \ 'redirect': 'c/clang_check'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim b/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim new file mode 100644 index 0000000..770d1f6 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_cpp_clang_tidy_checker') + finish +endif +let g:loaded_syntastic_cpp_clang_tidy_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'clang_tidy', + \ 'redirect': 'c/clang_tidy'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim b/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim new file mode 100644 index 0000000..4e0eb86 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_cpp_cppcheck_checker') + finish +endif +let g:loaded_syntastic_cpp_cppcheck_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'cppcheck', + \ 'redirect': 'c/cppcheck'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim new file mode 100644 index 0000000..54984bb --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: cpplint.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_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] }) + + " change error types according to the prescribed threshold + 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 + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim b/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim new file mode 100644 index 0000000..1243980 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: cpp.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_cpp_gcc_checker') + finish +endif +let g:loaded_syntastic_cpp_gcc_checker = 1 + +if !exists('g:syntastic_cpp_compiler_options') + let g:syntastic_cpp_compiler_options = '' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cpp_gcc_IsAvailable() dict + if !exists('g:syntastic_cpp_compiler') + let g:syntastic_cpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang++' + endif + call self.log('g:syntastic_cpp_compiler =', g:syntastic_cpp_compiler) + return executable(expand(g:syntastic_cpp_compiler, 1)) +endfunction + +function! SyntaxCheckers_cpp_gcc_GetLocList() dict + return syntastic#c#GetLocList('cpp', 'gcc', { + \ 'errorformat': + \ '%-G%f:%s:,' . + \ '%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\|hpp\|hh\)$' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'gcc', + \ 'exec': 'g++' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim new file mode 100644 index 0000000..8217769 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_cpp_oclint_checker') + finish +endif +let g:loaded_syntastic_cpp_oclint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'oclint', + \ 'redirect': 'c/oclint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim new file mode 100644 index 0000000..a7c95e8 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"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_cpp_pc_lint_checker') + finish +endif +let g:loaded_syntastic_cpp_pc_lint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'pc_lint', + \ 'redirect': 'c/pc_lint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim b/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim new file mode 100644 index 0000000..af1fd8c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: verapp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lucas Verney <phyks@phyks.me> +"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. +" +" Tested with Vera++ 1.3.0 +"============================================================================ + +if exists('g:loaded_syntastic_cpp_verapp_checker') + finish +endif +let g:loaded_syntastic_cpp_verapp_checker = 1 + +if !exists('g:syntastic_verapp_config_file') + let g:syntastic_verapp_config_file = '.syntastic_verapp_config' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cpp_verapp_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': syntastic#c#ReadConfig(g:syntastic_verapp_config_file), + \ 'args_after': '--show-rule --no-duplicate -S -c -' }) + + let errorformat = '%f:%t:%l:%c:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'checkstyle', + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'verapp', + \ 'exec': 'vera++'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim b/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim new file mode 100644 index 0000000..4544a93 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: cs.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Daniel Walker <dwalker@fifo99.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_cs_mcs_checker') + finish +endif +let g:loaded_syntastic_cs_mcs_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cs_mcs_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--parse' }) + + let errorformat = '%f(%l\,%c): %trror %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cs', + \ 'name': 'mcs'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/css/csslint.vim b/vim/bundle/syntastic/syntax_checkers/css/csslint.vim new file mode 100644 index 0000000..2d3702b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/csslint.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: css.vim +"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net). +"Maintainer: Ory Band <oryband 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_css_csslint_checker') + finish +endif +let g:loaded_syntastic_css_csslint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_css_csslint_GetLocList() dict + call syntastic#log#deprecationWarn('csslint_options', 'css_csslint_args') + + let makeprg = self.makeprgBuild({ 'args_after': '--format=compact' }) + + " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. + let errorformat = + \ '%-G,' . + \ '%-G%f: lint free!,' . + \ '%f: line %l\, col %c\, %trror - %m,' . + \ '%f: line %l\, col %c\, %tarning - %m,'. + \ '%f: line %l\, col %c\, %m,' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'csslint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim new file mode 100644 index 0000000..a0ce3ba --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim @@ -0,0 +1,22 @@ +"============================================================================ +"File: mixedindentlint.vim +"Description: Mixed indentation linter for vim +"Maintainer: Payton Swick <payton@foolord.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_css_mixedindentlint_checker') + finish +endif +let g:loaded_syntastic_css_mixedindentlint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'mixedindentlint', + \ 'redirect': 'javascript/mixedindentlint'}) + +" vim: set et sts=4 sw=4: diff --git a/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim b/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim new file mode 100644 index 0000000..a065f0e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: phpcs.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_css_phpcs_checker') + finish +endif +let g:loaded_syntastic_css_phpcs_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'phpcs', + \ 'redirect': 'php/phpcs'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim b/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim new file mode 100644 index 0000000..b531f49 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim @@ -0,0 +1,61 @@ +"============================================================================ +"File: prettycss.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_css_prettycss_checker') + finish +endif +let g:loaded_syntastic_css_prettycss_checker = 1 + +if !exists('g:syntastic_css_prettycss_sort') + let g:syntastic_css_prettycss_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m (\zs[^)]\+\ze)$') + if term !=# '' + let term = '\V' . escape(term, '\') + endif + return term +endfunction + +function! SyntaxCheckers_css_prettycss_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. + let errorformat = + \ '%EError: %m\, line %l\, char %c),' . + \ '%WWarning: %m\, line %l\, char %c),' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) + + for e in loclist + let e['text'] .= ')' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'prettycss'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/css/recess.vim b/vim/bundle/syntastic/syntax_checkers/css/recess.vim new file mode 100644 index 0000000..ce6d5ae --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/recess.vim @@ -0,0 +1,24 @@ +"============================================================================ +"File: recess.vim +"Description: Syntax checking plugin for syntastic.vim using `recess` +" (http://twitter.github.io/recess/). +"Maintainer: Tim Carry <tim at pixelastic 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_css_recess_checker') + finish +endif +let g:loaded_syntastic_css_recess_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'recess', + \ 'redirect': 'less/recess'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim b/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim new file mode 100644 index 0000000..58c7dec --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: stylelint.vim +"Description: Syntax checking plugin for syntastic.vim using `stylelint` +" (https://github.com/stylelint/stylelint). +"Maintainer: Tim Carry <tim at pixelastic 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_css_stylelint_checker') + finish +endif +let g:loaded_syntastic_css_stylelint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +let s:args_after = { + \ 'css': '-f json', + \ 'scss': '-f json -s scss' } + +function! SyntaxCheckers_css_stylelint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': get(s:args_after, self.getFiletype(), '') }) + + let errorformat = '%t:%f:%l:%c:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'preprocess': 'stylelint', + \ 'returns': [0, 1, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'stylelint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: + diff --git a/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim b/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim new file mode 100644 index 0000000..8a48690 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: cucumber.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_cucumber_cucumber_checker') + finish +endif +let g:loaded_syntastic_cucumber_cucumber_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cucumber_cucumber_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--dry-run --quiet --strict --format pretty' }) + + let errorformat = + \ '%f:%l:%c:%m,' . + \ '%W %.%# (%m),' . + \ '%-Z%f:%l:%.%#,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cucumber', + \ 'name': 'cucumber'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim b/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim new file mode 100644 index 0000000..3476039 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim @@ -0,0 +1,81 @@ +"============================================================================ +"File: cuda.vim +"Description: Syntax checking plugin for syntastic +"Author: Hannes Schulz <schulz at ais dot uni-bonn dot de> +" +"============================================================================ + +if exists('g:loaded_syntastic_cuda_nvcc_checker') + finish +endif +let g:loaded_syntastic_cuda_nvcc_checker = 1 + +if !exists('g:syntastic_cuda_config_file') + let g:syntastic_cuda_config_file = '.syntastic_cuda_config' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cuda_nvcc_GetLocList() dict + let arch_flag = syntastic#util#var('cuda_arch') + if arch_flag !=# '' + let arch_flag = '-arch=' . arch_flag + call syntastic#log#oneTimeWarn('variable g:syntastic_cuda_arch is deprecated, ' . + \ 'please add ' . string(arch_flag) . ' to g:syntastic_cuda_nvcc_args instead') + endif + + let build_opts = {} + let dummy = '' + if index(['h', 'hpp', 'cuh'], expand('%:e', 1), 0, 1) >= 0 + if syntastic#util#var('cuda_check_header', 0) + let dummy = expand('%:p:h', 1) . syntastic#util#Slash() . '.syntastic_dummy.cu' + let build_opts = { + \ 'exe_before': 'echo > ' . syntastic#util#shescape(dummy) . ' ;', + \ 'fname_before': '.syntastic_dummy.cu -include' } + else + return [] + endif + endif + + call extend(build_opts, { + \ 'args_before': arch_flag . ' --cuda -O0 -I .', + \ 'args': syntastic#c#ReadConfig(g:syntastic_cuda_config_file), + \ 'args_after': '-Xcompiler -fsyntax-only', + \ 'tail_after': syntastic#c#NullOutput() }) + + let makeprg = self.makeprgBuild(build_opts) + + let errorformat = + \ '%*[^"]"%f"%*\D%l: %m,'. + \ '"%f"%*\D%l: %m,'. + \ '%-G%f:%l: (Each undeclared identifier is reported only once,'. + \ '%-G%f:%l: for each function it appears in.),'. + \ '%f:%l:%c:%m,'. + \ '%f(%l):%m,'. + \ '%f:%l:%m,'. + \ '"%f"\, line %l%*\D%c%*[^ ] %m,'. + \ '%D%*\a[%*\d]: Entering directory `%f'','. + \ '%X%*\a[%*\d]: Leaving directory `%f'','. + \ '%D%*\a: Entering directory `%f'','. + \ '%X%*\a: Leaving directory `%f'','. + \ '%DMaking %*\a in %f,'. + \ '%f|%l| %m' + + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + if dummy !=# '' + call delete(dummy) + endif + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cuda', + \ 'name': 'nvcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/d/dmd.vim b/vim/bundle/syntastic/syntax_checkers/d/dmd.vim new file mode 100644 index 0000000..8897995 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/d/dmd.vim @@ -0,0 +1,132 @@ +"============================================================================ +"File: d.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alfredo Di Napoli <alfredo dot dinapoli at gmail dot com> +"License: Based on the original work of Gregor Uhlenheuer and his +" cpp.vim checker so credits are dued. +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +" HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +" OTHER DEALINGS IN THE SOFTWARE. +" +"============================================================================ + +if exists('g:loaded_syntastic_d_dmd_checker') + finish +endif +let g:loaded_syntastic_d_dmd_checker = 1 + +if !exists('g:syntastic_d_compiler_options') + let g:syntastic_d_compiler_options = '' +endif + +if !exists('g:syntastic_d_use_dub') + let g:syntastic_d_use_dub = 1 +endif + +if !exists('g:syntastic_d_dub_exec') + let g:syntastic_d_dub_exec = 'dub' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_d_dmd_IsAvailable() dict " {{{1 + if !exists('g:syntastic_d_compiler') + let g:syntastic_d_compiler = self.getExec() + endif + call self.log('g:syntastic_d_compiler =', g:syntastic_d_compiler) + return executable(expand(g:syntastic_d_compiler, 1)) +endfunction " }}}1 + +function! SyntaxCheckers_d_dmd_GetLocList() dict " {{{1 + if !exists('g:syntastic_d_include_dirs') + let g:syntastic_d_include_dirs = s:GetIncludes(self, expand('%:p:h')) + endif + + return syntastic#c#GetLocList('d', 'dmd', { + \ 'errorformat': + \ '%-G%f:%s:,%f(%l): %m,' . + \ '%f:%l: %m', + \ 'main_flags': '-c -of' . syntastic#util#DevNull(), + \ 'header_names': '\m\.di$' }) +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetIncludes(checker, base) " {{{2 + let includes = [] + + if g:syntastic_d_use_dub && !exists('s:dub_ok') + let s:dub_ok = s:ValidateDub(a:checker) + endif + + if g:syntastic_d_use_dub && s:dub_ok + let where = escape(a:base, ' ') . ';' + + let old_suffixesadd = &suffixesadd + let dirs = syntastic#util#unique(map(filter( + \ findfile('dub.json', where, -1) + + \ findfile('dub.sdl', where, -1) + + \ findfile('package.json', where, -1), + \ 'filereadable(v:val)'), 'fnamemodify(v:val, ":h")')) + let &suffixesadd = old_suffixesadd + call a:checker.log('using dub: looking for includes in', dirs) + + for dir in dirs + try + execute 'silent lcd ' . fnameescape(dir) + let paths = split(syntastic#util#system(syntastic#util#shescape(g:syntastic_d_dub_exec) . ' describe --import-paths'), "\n") + silent lcd - + if v:shell_error == 0 + call extend(includes, paths) + call a:checker.log('using dub: found includes', paths) + endif + catch /\m^Vim\%((\a\+)\)\=:E472/ + " evil directory is evil + endtry + endfor + endif + + if empty(includes) + let includes = filter(glob($HOME . '/.dub/packages/*', 1, 1), 'isdirectory(v:val)') + call map(includes, 'isdirectory(v:val . "/source") ? v:val . "/source" : v:val') + call add(includes, './source') + endif + + return syntastic#util#unique(includes) +endfunction " }}}2 + +function! s:ValidateDub(checker) " {{{2 + let ok = 0 + + if executable(g:syntastic_d_dub_exec) + let command = syntastic#util#shescape(g:syntastic_d_dub_exec) . ' --version' + let version_output = syntastic#util#system(command) + call a:checker.log('getVersion: ' . string(command) . ': ' . + \ string(split(version_output, "\n", 1)) . + \ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') ) + let parsed_ver = syntastic#util#parseVersion(version_output) + call a:checker.log(g:syntastic_d_dub_exec . ' version =', parsed_ver) + if len(parsed_ver) + let ok = syntastic#util#versionIsAtLeast(parsed_ver, [0, 9, 24]) + endif + endif + + return ok +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'd', + \ 'name': 'dmd' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim b/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim new file mode 100644 index 0000000..63b8267 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim @@ -0,0 +1,76 @@ +"============================================================================ +"File: dartanalyzer.vim +"Description: Dart syntax checker - using dartanalyzer +"Maintainer: Maksim Ryzhikov <rv.maksim 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_dart_dartanalyzer_checker') + finish +endif +let g:loaded_syntastic_dart_dartanalyzer_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_dart_dartanalyzer_GetHighlightRegex(error) + if a:error['len'] + let lcol = a:error['col'] - 1 + let rcol = a:error['col'] + a:error['len'] + let ret = '\%>' . lcol . 'c\%<' . rcol . 'c' + else + let ret = '' + endif + + return ret +endfunction + +function! SyntaxCheckers_dart_dartanalyzer_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--machine' }) + + " Machine readable format looks like: + " SEVERITY|TYPE|ERROR_CODE|FILENAME|LINE_NUMBER|COLUMN|LENGTH|MESSAGE + " SEVERITY: (WARNING|ERROR) + " TYPE: (RESOLVER|STATIC_TYPE|...) + " ERROR_CODE: (NO_SUCH_TYPE|...) + " FILENAME: String + " LINE_NUMBER: int + " COLUMN: int + " LENGTH: int + " MESSAGE: String + + " We use %n to grab the error length, for the syntax highlighter + let commonformat = '|%.%#|%.%#|%f|%l|%c|%n|%m' + + let errorformat = + \ '%EERROR' . commonformat . ',' . + \ '%WWARNING' . commonformat + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1, 2, 3] }) + + for e in loclist + let e['text'] = substitute(e['text'], '\m\\\([\\|]\)', '\1', 'g') + + " Undo the %n hack + let e['len'] = e['nr'] + call remove(e, 'nr') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'dart', + \ 'name': 'dartanalyzer' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim b/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim new file mode 100644 index 0000000..5448861 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: igor.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_docbk_igor_checker') + finish +endif +let g:loaded_syntastic_docbk_igor_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_docbk_igor_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'type': 'W' }, + \ 'subtype': 'Style', + \ 'returns': [0] }) + + let buf = bufnr('') + for e in loclist + " XXX: igor strips directories from filenames + let e['bufnr'] = buf + + let e['hl'] = '\V' . escape( substitute(e['text'], '\m[^:]*:', '', ''), '\' ) + let e['hl'] = substitute(e['hl'], '\V[', '\\zs', 'g') + let e['hl'] = substitute(e['hl'], '\V]', '\\ze', 'g') + + " let e['text'] = substitute(e['text'], '\m:.*$', '', '') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'docbk', + \ 'name': 'igor'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim new file mode 100644 index 0000000..30d66d2 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: docbk.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_docbk_xmllint_checker') + finish +endif +let g:loaded_syntastic_docbk_xmllint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'docbk', + \ 'name': 'xmllint', + \ 'redirect': 'xml/xmllint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim b/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim new file mode 100644 index 0000000..3a5b769 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: dockerfile_lint.vim +"Description: Syntax checking plugin for syntastic.vim using dockerfile-lint +" (https://github.com/projectatomic/dockerfile-lint). +"Maintainer: Tim Carry <tim at pixelastic 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_dockerfile_dockerfile_lint_checker') + finish +endif +let g:loaded_syntastic_dockerfile_dockerfile_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_dockerfile_dockerfile_lint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '-j', + \ 'fname_before': '-f' }) + + let errorformat = '%t:%n:%l:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'dockerfile_lint', + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 1] }) + + for e in loclist + if e['nr'] + let e['subtype'] = 'Style' + endif + call remove(e, 'nr') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'dockerfile', + \ 'name': 'dockerfile_lint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim b/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim new file mode 100644 index 0000000..8edf1d5 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: swiffer.vim +"Description: Dust.js syntax checker - using swiffer +"Maintainer: Steven Foote <smfoote 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_dustjs_swiffer_checker') + finish +endif + +let g:loaded_syntastic_dustjs_swiffer_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_dustjs_swiffer_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%E%f - Line %l\, Column %c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + endfunction + +call SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'dustjs', + \ 'name': 'swiffer'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim b/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim new file mode 100644 index 0000000..f2ffe67 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: elixir.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Richard Ramsden <rramsden 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_elixir_elixir_checker') + finish +endif +let g:loaded_syntastic_elixir_elixir_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" TODO: we should probably split this into separate checkers +function! SyntaxCheckers_elixir_elixir_IsAvailable() dict + call self.log( + \ 'executable("elixir") = ' . executable('elixir') . ', ' . + \ 'executable("mix") = ' . executable('mix')) + return executable('elixir') && executable('mix') +endfunction + +function! SyntaxCheckers_elixir_elixir_GetLocList() dict + let make_options = {} + let compile_command = 'elixir' + let mix_file = syntastic#util#findFileInParent('mix.exs', expand('%:p:h', 1)) + + if filereadable(mix_file) + let compile_command = 'mix compile' + let make_options['cwd'] = fnamemodify(mix_file, ':p:h') + endif + + let make_options['makeprg'] = self.makeprgBuild({ 'exe': compile_command }) + + let make_options['errorformat'] = + \ '%E** %*[^\ ] %f:%l: %m,' . + \ '%W%f:%l: warning: %m' + + return SyntasticMake(make_options) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'elixir', + \ 'name': 'elixir', + \ 'enable': 'enable_elixir_checker'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl b/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl new file mode 100755 index 0000000..730e600 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl @@ -0,0 +1,95 @@ +#!/usr/bin/env escript + +main([File]) -> + Dir = get_root(filename:dirname(File)), + Defs = [strong_validation, + warn_export_all, + warn_export_vars, + warn_shadow_vars, + warn_obsolete_guard, + warn_unused_import, + report, + {i, Dir ++ "/include"}], + %% `rebar.config` is looked for, + %% but it is not necessarily the one in the project root. + %% I.e. it may be one deeper in the project file hierarchy. + RebarFile = rebar_file(Dir), + %% `rebar.config` might contain relative paths. + %% They are relative to the file! Not to the project root. + RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile), + code:add_patha(filename:absname("ebin")), + %% `compile:file/2` requires the `{i, Path}` to be relative + %% to CWD - no surprise here. + compile:file(File, Defs ++ translate_paths(Dir, RebarOpts)); + +main(_) -> + io:format("Usage: ~s <file>~n", [escript:script_name()]), + halt(1). + +rebar_file(Dir) -> + DirList = filename:split(Dir), + case lists:last(DirList) of + "test" -> + "rebar.test.config"; + _ -> + "rebar.config" + end. + +rebar_opts(RebarFile) -> + Dir = get_root(filename:dirname(RebarFile)), + case file:consult(RebarFile) of + {ok, Terms} -> + RebarLibDirs = proplists:get_value(lib_dirs, Terms, []), + lists:foreach( + fun(LibDir) -> + code:add_pathsa(filelib:wildcard(LibDir ++ "/*/ebin")) + end, RebarLibDirs), + RebarDepsDir = proplists:get_value(deps_dir, Terms, "deps"), + code:add_pathsa(filelib:wildcard(RebarDepsDir ++ "/*/ebin")), + IncludeDeps = {i, filename:join(Dir, RebarDepsDir)}, + proplists:get_value(erl_opts, Terms, []) ++ [IncludeDeps]; + {error, _} when RebarFile == "rebar.config" -> + fallback_opts(); + {error, _} -> + rebar_opts("rebar.config") + end. + +fallback_opts() -> + code:add_pathsa(filelib:wildcard("deps/*/ebin")), + code:add_pathsa(nested_app_ebins()), + [ + { i, filename:absname("apps") }, { i, filename:absname("deps") } | [ { i, filename:absname(Path) } || Path <- filelib:wildcard("deps/*/apps")] + ]. + +nested_app_ebins() -> + DetectedAppSrcFiles = filelib:wildcard("deps/*/apps/**/*.app.src"), + [apps_dir_from_src(AppSrcFile)||AppSrcFile<-DetectedAppSrcFiles]. + +apps_dir_from_src(SrcFile) -> + SrcDir = filename:dirname(SrcFile), + filename:join(SrcDir, "../../ebin"). + +get_root(Dir) -> + Path = filename:split(filename:absname(Dir)), + filename:join(get_root(lists:reverse(Path), Path)). + +get_root([], Path) -> + Path; +get_root(["src" | Tail], _Path) -> + lists:reverse(Tail); +get_root(["test" | Tail], _Path) -> + lists:reverse(Tail); +get_root([_ | Tail], Path) -> + get_root(Tail, Path). + +translate_paths(Dir, RebarOpts) -> + [ translate_path(Dir, Opt) || Opt <- RebarOpts ]. + +translate_path(Dir, {i, Path}) -> + case Path of + %% absolute + "/" ++ _ -> {i, Path}; + %% relative -> make absolute taking rebar.config location into account + _ -> {i, filename:join([Dir, Path])} + end; +translate_path(_, Other) -> Other. diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim b/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim new file mode 100644 index 0000000..9fd869f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim @@ -0,0 +1,61 @@ +"============================================================================ +"File: erlang.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Pawel Salata <rockplayer.pl 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_erlang_erlang_checker') + finish +endif +let g:loaded_syntastic_erlang_erlang_checker = 1 + +if !exists('g:syntastic_erlc_include_path') + let g:syntastic_erlc_include_path = '' +endif + +let s:check_file = syntastic#util#shescape(expand('<sfile>:p:h', 1) . syntastic#util#Slash() . 'erlang_check_file.erl') + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_erlang_escript_GetLocList() dict + if expand('%:e', 1) ==# 'hrl' + return [] + endif + + let shebang = syntastic#util#parseShebang() + if shebang['exe'] ==# 'escript' + let args = '-s' + let post_args = '' + else + let args = s:check_file + let post_args = g:syntastic_erlc_include_path + endif + let makeprg = self.makeprgBuild({ + \ 'args_after': args, + \ 'fname': syntastic#util#shexpand('%:p'), + \ 'post_args_after': post_args }) + + let errorformat = + \ '%W%f:%l: warning: %m,'. + \ '%E%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'erlang', + \ 'name': 'escript'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim b/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim new file mode 100644 index 0000000..45f4735 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: syntaxerl.vim +"Description: Syntax checking plugin for syntastic. +"Maintainer: locojay +"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_erlang_syntaxerl_checker') + finish +endif + +let g:loaded_syntastic_erlang_syntaxerl_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + + +function! SyntaxCheckers_erlang_syntaxerl_GetLocList() dict + + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%W%f:%l: warning: %m,'. + \ '%E%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'erlang', + \ 'name': 'syntaxerl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim b/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim new file mode 100644 index 0000000..16eed62 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim @@ -0,0 +1,82 @@ +"============================================================================ +"File: ruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_eruby_ruby_checker') + finish +endif +let g:loaded_syntastic_eruby_ruby_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_eruby_ruby_IsAvailable() dict + if !exists('g:syntastic_eruby_ruby_exec') && exists('g:syntastic_ruby_exec') + let g:syntastic_eruby_ruby_exec = g:syntastic_ruby_exec + call self.log('g:syntastic_eruby_ruby_exec =', g:syntastic_eruby_ruby_exec) + endif + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_eruby_ruby_GetLocList() dict + if !exists('s:ruby_new') + let s:ruby_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 9]) + endif + + let fname = "'" . escape(expand('%', 1), "\\'") . "'" + + " TODO: encodings became useful in ruby 1.9 :) + if s:ruby_new + let enc = &fileencoding !=# '' ? &fileencoding : &encoding + let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"' + else + let encoding_spec = '' + endif + + "gsub fixes issue #7, rails has it's own eruby syntax + let makeprg = + \ self.getExecEscaped() . ' -rerb -e ' . + \ syntastic#util#shescape('puts ERB.new(File.read(' . + \ fname . encoding_spec . + \ ').gsub(''<%='',''<%''), nil, ''-'').src') . + \ ' | ' . self.getExecEscaped() . ' -w -c' + + let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of a literal in void context,' + + " filter out lines starting with ... + " long lines are truncated and wrapped in ... %p then returns the wrong + " column offset + let errorformat .= '%-G%\%.%\%.%\%.%.%#,' + + let errorformat .= + \ '%-GSyntax OK,'. + \ '%E-:%l: syntax error\, %m,%Z%p^,'. + \ '%W-:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%-C%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'defaults': { 'bufnr': bufnr(''), 'vcol': 1 } }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'eruby', + \ 'name': 'ruby'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim b/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim new file mode 100644 index 0000000..fffaf30 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim @@ -0,0 +1,99 @@ +"============================================================================ +"File: fortran.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net> +"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_fortran_gfortran_checker') + finish +endif +let g:loaded_syntastic_fortran_gfortran_checker = 1 + +if !exists('g:syntastic_fortran_compiler_options') + let g:syntastic_fortran_compiler_options = '' +endif + +let s:type_map = {} + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict " {{{1 + if !exists('g:syntastic_fortran_compiler') + let g:syntastic_fortran_compiler = self.getExec() + endif + call self.log('g:syntastic_fortran_compiler = ', g:syntastic_fortran_compiler) + return executable(expand(g:syntastic_fortran_compiler, 1)) +endfunction " }}}1 + +" @vimlint(EVL104, 1, l:errorformat) +function! SyntaxCheckers_fortran_gfortran_GetLocList() dict " {{{1 + call s:SetCompilerType(g:syntastic_fortran_compiler) + if !has_key(s:type_map, g:syntastic_fortran_compiler) + call syntastic#log#error("checker fortran/gfortran: can't parse version string (abnormal termination?)") + return [] + endif + + if s:type_map[g:syntastic_fortran_compiler] ==# 'gfortran' + let errorformat = + \ '%-C %#,'. + \ '%-C %#%.%#,'. + \ '%A%f:%l%[.:]%c:,'. + \ '%Z%\m%\%%(Fatal %\)%\?%trror: %m,'. + \ '%Z%tarning: %m,'. + \ '%-G%.%#' + if !exists('g:syntastic_fortran_gfortran_sort') + let g:syntastic_fortran_gfortran_sort = 0 + endif + elseif s:type_map[g:syntastic_fortran_compiler] ==# 'ifort' + let errorformat = + \ '%E%f(%l): error #%n: %m,'. + \ '%W%f(%l): warning #%n: %m,'. + \ '%W%f(%l): remark #%n: %m,'. + \ '%-Z%p^,'. + \ '%-G%.%#' + if !exists('g:syntastic_fortran_gfortran_sort') + let g:syntastic_fortran_gfortran_sort = 1 + endif + endif + + return syntastic#c#GetLocList('fortran', 'gfortran', { + \ 'errorformat': errorformat, + \ 'main_flags': '-fsyntax-only' }) +endfunction " }}}1 +" @vimlint(EVL104, 0, l:errorformat) + +" Utilities {{{1 + +function! s:SetCompilerType(exe) " {{{2 + if !has_key(s:type_map, a:exe) + try + let ver = filter( split(syntastic#util#system(syntastic#util#shescape(a:exe) . ' --version'), '\n'), + \ 'v:val =~# "\\v^%(GNU Fortran|ifort) "' )[0] + if ver =~# '\m^GNU Fortran ' + let s:type_map[a:exe] = 'gfortran' + elseif ver =~# '\m^ifort ' + let s:type_map[a:exe] = 'ifort' + endif + catch /\m^Vim\%((\a\+)\)\=:E684/ + " do nothing + endtry + endif +endfunction " }}}2 + +" }}} + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'fortran', + \ 'name': 'gfortran' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim b/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim new file mode 100644 index 0000000..602399d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim @@ -0,0 +1,81 @@ +"============================================================================ +"File: glsl.vim +"Description: Syntax checker for OpenGL Shading Language +"Maintainer: Joshua Rahm <joshuarahm@gmail.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_glsl_cgc_checker') + finish +endif +let g:loaded_syntastic_glsl_cgc_checker = 1 + +let s:glsl_extensions = { + \ 'glslf': 'gpu_fp', + \ 'glslv': 'gpu_vp', + \ 'frag': 'gpu_fp', + \ 'vert': 'gpu_vp', + \ 'fp': 'gpu_fp', + \ 'vp': 'gpu_vp' + \ } + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_glsl_cgc_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ + \ 'args_before': '-oglsl -profile ' . s:GetProfile(), + \ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') }) + + let errorformat = + \ '%E%f(%l) : error %m,' . + \ '%W%f(%l) : warning %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetProfile() " {{{2 + let save_view = winsaveview() + let old_foldenable = &foldenable + let old_lazyredraw = &lazyredraw + + let &lazyredraw = 1 + let &foldenable = 0 + call cursor(1, 1) + + let magic = '\m\C^// profile:\s*' + let line = search(magic, 'c') + + call winrestview(save_view) + let &foldenable = old_foldenable + let &lazyredraw = old_lazyredraw + + if line + let profile = matchstr(getline(line), magic . '\zs.*') + else + let extensions = exists('g:syntastic_glsl_extensions') ? g:syntastic_glsl_extensions : s:glsl_extensions + let profile = get(extensions, tolower(expand('%:e', 1)), 'gpu_vert') + endif + + return profile +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \'filetype': 'glsl', + \'name': 'cgc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/go.vim b/vim/bundle/syntastic/syntax_checkers/go/go.vim new file mode 100644 index 0000000..f32f505 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/go.vim @@ -0,0 +1,103 @@ +"============================================================================ +"File: go.vim +"Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]' +"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net> +"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. +" +"============================================================================ +" +" This syntax checker does not reformat your source code. +" Use a BufWritePre autocommand to that end: +" autocmd FileType go autocmd BufWritePre <buffer> Fmt + +if exists('g:loaded_syntastic_go_go_checker') + finish +endif +let g:loaded_syntastic_go_go_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_go_IsAvailable() dict + return executable(self.getExec()) && executable('gofmt') +endfunction + +function! SyntaxCheckers_go_go_GetLocList() dict + if !exists('s:go_new') + let s:go_new = syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [1, 5]) + endif + + " Check with gofmt first, since `go build` and `go test` might not report + " syntax errors in the current file if another file with syntax error is + " compiled first. + let makeprg = self.makeprgBuild({ + \ 'exe': 'gofmt', + \ 'args': '-l', + \ 'tail': '> ' . syntastic#util#DevNull() }) + + let errorformat = + \ '%f:%l:%c: %m,' . + \ '%-G%.%#' + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'e'} }) + if !empty(errors) + return errors + endif + + " Test files, i.e. files with a name ending in `_test.go`, are not + " compiled by `go build`, therefore `go test` must be called for those. + if match(expand('%', 1), '\m_test\.go$') == -1 + let cmd = 'build' + let opts = syntastic#util#var('go_go_build_args', s:go_new ? '-buildmode=archive' : '') + let cleanup = 0 + else + let cmd = 'test -c' + let opts = syntastic#util#var('go_go_test_args', s:go_new ? '-buildmode=archive' : '') + let cleanup = 1 + endif + let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts + let makeprg = self.getExecEscaped() . ' ' . cmd . ' ' . opt_str + + " The first pattern is for warnings from C compilers. + let errorformat = + \ '%W%f:%l: warning: %m,' . + \ '%E%f:%l:%c:%m,' . + \ '%E%f:%l:%m,' . + \ '%C%\s%\+%m,' . + \ '%+Ecan''t load package: %m,' . + \ '%+Einternal error: %m,' . + \ '%-G#%.%#' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h', 1), + \ 'env': {'GOGC': 'off'}, + \ 'defaults': {'type': 'e'} }) + + if cleanup + call delete(expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:p:h:t', 1) . '.test') + endif + + return errors +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'go'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim b/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim new file mode 100644 index 0000000..bdb6218 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: gofmt.vim +"Description: Check go syntax using 'gofmt -l' +"Maintainer: Brandon Thomson <bt@brandonthomson.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. +" +"============================================================================ +" +" This syntax checker does not reformat your source code. +" Use a BufWritePre autocommand to that end: +" autocmd FileType go autocmd BufWritePre <buffer> Fmt + +if exists('g:loaded_syntastic_go_gofmt_checker') + finish +endif +let g:loaded_syntastic_go_gofmt_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_gofmt_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '-l', + \ 'tail_after': '> ' . syntastic#util#DevNull() }) + + let errorformat = '%f:%l:%c: %m,%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'e'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'gofmt'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/golint.vim b/vim/bundle/syntastic/syntax_checkers/go/golint.vim new file mode 100644 index 0000000..29eee0c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/golint.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: golint.vim +"Description: Check go syntax using 'golint' +"Maintainer: Hiroshi Ioka <hirochachacha@gmail.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_go_golint_checker') + finish +endif +let g:loaded_syntastic_go_golint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_golint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%f:%l:%c: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'w'}, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'golint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim b/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim new file mode 100644 index 0000000..780f49b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: gometalinter.vim +"Description: Check go syntax using 'gometalint' +"Maintainer: Joshua Rubin <joshua@rubixconsulting.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_go_gometalinter_checker') + finish +endif +let g:loaded_syntastic_go_gometalinter_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_gometalinter_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '-t', + \ 'fname': syntastic#util#shexpand('%:p:h') }) + + let errorformat = + \ '%f:%l:%c:%trror: %m,' . + \ '%f:%l:%c:%tarning: %m,' . + \ '%f:%l::%trror: %m,' . + \ '%f:%l::%tarning: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) + + for e in loclist + if e['text'] =~# '\v\(%(deadcode|gocyclo|golint|defercheck|varcheck|structcheck|errcheck|dupl)\)$' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'gometalinter'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/gotype.vim b/vim/bundle/syntastic/syntax_checkers/go/gotype.vim new file mode 100644 index 0000000..37472ee --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/gotype.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: gotype.vim +"Description: Perform syntactic and semantic checking of Go code using 'gotype' +"Maintainer: luz <ne.tetewi@gmail.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_go_gotype_checker') + finish +endif +let g:loaded_syntastic_go_gotype_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_gotype_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': (expand('%', 1) =~# '\m_test\.go$' ? '-a' : ''), + \ 'fname': '.' }) + + let errorformat = + \ '%f:%l:%c: %m,' . + \ '%-G%.%#' + + " gotype needs the full go package to test types properly. Just cwd to + " the package for the same reasons specified in go.vim ("figuring out + " the import path is fickle"). + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h', 1), + \ 'defaults': {'type': 'e'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'gotype'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/go/govet.vim b/vim/bundle/syntastic/syntax_checkers/go/govet.vim new file mode 100644 index 0000000..6c30631 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/go/govet.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: govet.vim +"Description: Perform static analysis of Go code with the vet tool +"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net> +"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_go_govet_checker') + finish +endif +let g:loaded_syntastic_go_govet_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_govet_GetLocList() dict + let makeprg = self.getExecEscaped() . ' vet' + + let errorformat = + \ '%Evet: %.%\+: %f:%l:%c: %m,' . + \ '%W%f:%l: %m,' . + \ '%-G%.%#' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h', 1), + \ 'defaults': {'type': 'w'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'govet', + \ 'exec': 'go' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haml/haml.vim b/vim/bundle/syntastic/syntax_checkers/haml/haml.vim new file mode 100644 index 0000000..c0c7318 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haml/haml.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: haml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_haml_haml_checker') + finish +endif +let g:loaded_syntastic_haml_haml_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haml_haml_IsAvailable() dict + call syntastic#log#deprecationWarn('haml_interpreter', 'haml_haml_exec') + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_haml_haml_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-c' }) + + let errorformat = + \ 'Haml error on line %l: %m,' . + \ 'Syntax error on line %l: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haml', + \ 'name': 'haml'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim b/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim new file mode 100644 index 0000000..60b3db3 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: haml_lint.vim +"Description: HAML style and syntax checker plugin for Syntastic +"Maintainer: Shane da Silva <shane@dasilva.io> +"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_haml_haml_lint_checker') + finish +endif +let g:loaded_syntastic_haml_haml_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haml_haml_lint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + let errorformat = '%f:%l [%t] %m' + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style'}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haml', + \ 'name': 'haml_lint', + \ 'exec': 'haml-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim b/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim new file mode 100644 index 0000000..f5ae742 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: handlebars.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_handlebars_handlebars_checker') + finish +endif +let g:loaded_syntastic_handlebars_handlebars_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-f ' . syntastic#util#DevNull() }) + + let errorformat = + \ '%EError: %m on line %l:,' . + \ '%EError: %m,' . + \ '%Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'], + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'handlebars', + \ 'name': 'handlebars'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim new file mode 100644 index 0000000..928e5b3 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim @@ -0,0 +1,94 @@ +"============================================================================ +"File: ghc-mod.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis <anthony.carapetis 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_haskell_ghc_mod_checker') + finish +endif +let g:loaded_syntastic_haskell_ghc_mod_checker = 1 + +let s:ghc_mod_new = -1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict " {{{1 + if !executable(self.getExec()) + return 0 + endif + + " ghc-mod 5.0.0 and later needs the "version" command to print the + " version. But the "version" command appeared in 4.1.0. Thus, we need to + " know the version in order to know how to find out the version. :) + + " Try "ghc-mod version". + let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1) + let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''') + if !len(ver) + " That didn't work. Try "ghc-mod" alone. + let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1) + let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''') + endif + let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : [] + + if len(parsed_ver) + " Encouraged by the great success in finding out the version, now we + " need either a Vim that can handle NULs in system() output, or a + " ghc-mod that has the "--boundary" option. + call self.setVersion(parsed_ver) + let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2]) + else + call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output) + call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)") + let s:ghc_mod_new = -1 + endif + + " ghc-mod 5.4.0 wants to run in the root directory of the project; + " syntastic can't cope with the resulting complications + " + " References: + " https://hackage.haskell.org/package/ghc-mod-5.4.0.0/changelog + let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4]) + + return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout +endfunction " }}}1 + +function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ + \ 'exe': self.getExecEscaped() . ' check' . (s:ghc_mod_new ? ' --boundary=""' : '') }) + + let errorformat = + \ '%-G%\s%#,' . + \ '%f:%l:%c:%trror: %m,' . + \ '%f:%l:%c:%tarning: %m,'. + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c:%m,' . + \ '%E%f:%l:%c:,' . + \ '%Z%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'iconv', + \ 'postprocess': ['compressWhitespace'], + \ 'returns': [0] }) +endfunction " }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'ghc_mod', + \ 'exec': 'ghc-mod' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim new file mode 100644 index 0000000..4b0a80f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: hdevtools.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis <anthony.carapetis 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_haskell_hdevtools_checker') + finish +endif +let g:loaded_syntastic_haskell_hdevtools_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict + if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options') + call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' . + \ 'please use g:syntastic_haskell_hdevtools_args instead') + let g:syntastic_haskell_hdevtools_args = g:hdevtools_options + endif + + let makeprg = self.makeprgBuild({ + \ 'exe_after': 'check', + \ 'fname': syntastic#util#shexpand('%:p') }) + + let errorformat = + \ '%-Z %#,'. + \ '%W%f:%l:%v: Warning: %m,'. + \ '%W%f:%l:%v: Warning:,'. + \ '%E%f:%l:%v: %m,'. + \ '%E%>%f:%l:%v:,'. + \ '%+C %#%m,'. + \ '%W%>%f:%l:%v:,'. + \ '%+C %#%tarning: %m,' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'vcol': 1}, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'hdevtools'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim new file mode 100644 index 0000000..c75ea8b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: hlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Nicolas Wu <nicolas.wu at gmail dot com> +"License: BSD +"============================================================================ + +if exists('g:loaded_syntastic_haskell_hlint_checker') + finish +endif +let g:loaded_syntastic_haskell_hlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haskell_hlint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'fname': syntastic#util#shexpand('%:p')}) + + let errorformat = + \ '%E%f:%l:%v: Error while reading hint file\, %m,' . + \ '%E%f:%l:%v: Error: %m,' . + \ '%W%f:%l:%v: Warning: %m,' . + \ '%W%f:%l:%v: Suggestion: %m,' . + \ '%C%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'vcol': 1}, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'hlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim new file mode 100644 index 0000000..7cf7e7b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: scan.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_haskell_scan_checker') + finish +endif +let g:loaded_syntastic_haskell_scan_checker = 1 + +if !exists('g:syntastic_haskell_scan_sort') + let g:syntastic_haskell_scan_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haskell_scan_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l:%v: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'scan'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim b/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim new file mode 100644 index 0000000..789e9f3 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim @@ -0,0 +1,63 @@ +"============================================================================ +"File: haxe.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: David Bernard <david.bernard.31 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_haxe_haxe_checker') + finish +endif +let g:loaded_syntastic_haxe_haxe_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_haxe_haxe_GetLocList() dict + if exists('b:vaxe_hxml') + let hxml = b:vaxe_hxml + elseif exists('g:vaxe_hxml') + let hxml = g:vaxe_hxml + else + let hxml = syntastic#util#findGlobInParent('*.hxml', expand('%:p:h', 1)) + endif + let hxml = fnamemodify(hxml, ':p') + + call self.log('hxml =', hxml) + + if hxml !=# '' + let makeprg = self.makeprgBuild({ + \ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')) }) + + let errorformat = '%E%f:%l: characters %c-%n : %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': fnamemodify(hxml, ':h') }) + + for e in loclist + let e['hl'] = '\%>' . e['col'] . 'c\%<' . (e['nr'] + 1) . 'c' + let e['col'] += 1 + let e['nr'] = 0 + endfor + + return loclist + endif + + return [] +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haxe', + \ 'name': 'haxe'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/hss/hss.vim b/vim/bundle/syntastic/syntax_checkers/hss/hss.vim new file mode 100644 index 0000000..d988615 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/hss/hss.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: hss.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Justin Donaldson (jdonaldson@gmail.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_hss_hss_checker') + finish +endif +let g:loaded_syntastic_hss_hss_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_hss_hss_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after' : '-output ' . syntastic#util#DevNull() }) + + let errorformat = '%E%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'hss', + \ 'name': 'hss'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/eslint.vim b/vim/bundle/syntastic/syntax_checkers/html/eslint.vim new file mode 100644 index 0000000..3e91931 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/eslint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: eslint.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_html_eslint_checker') + finish +endif +let g:loaded_syntastic_html_eslint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'eslint', + \ 'redirect': 'javascript/eslint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim b/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim new file mode 100644 index 0000000..a26e2f3 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: gjslint.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_html_gjslint_checker') + finish +endif +let g:loaded_syntastic_html_gjslint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'gjslint', + \ 'redirect': 'javascript/gjslint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/jshint.vim b/vim/bundle/syntastic/syntax_checkers/html/jshint.vim new file mode 100644 index 0000000..a7af758 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/jshint.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: jshint.vim +"Description: Javascript syntax checker for HTML - using jshint +"Maintainer: LCD 47 <lcd047@gmail.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_html_jshint_checker') + finish +endif +let g:loaded_syntastic_html_jshint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_html_jshint_IsAvailable() dict + call syntastic#log#deprecationWarn('jshint_exec', 'html_jshint_exec') + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4]) +endfunction + +function! SyntaxCheckers_html_jshint_GetLocList() dict + call syntastic#log#deprecationWarn('html_jshint_conf', 'html_jshint_args', + \ "'--config ' . syntastic#util#shexpand(OLD_VAR)") + + let makeprg = self.makeprgBuild({ 'args_after': '--verbose --extract always' }) + + let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'jshint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/textlint.vim b/vim/bundle/syntastic/syntax_checkers/html/textlint.vim new file mode 100644 index 0000000..b95d8be --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/textlint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: textlint.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_html_textlint_checker') + finish +endif +let g:loaded_syntastic_html_textlint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'textlint', + \ 'redirect': 'text/textlint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/tidy.vim b/vim/bundle/syntastic/syntax_checkers/html/tidy.vim new file mode 100644 index 0000000..3075a7d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/tidy.vim @@ -0,0 +1,212 @@ +"============================================================================ +"File: tidy.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_html_tidy_checker') + finish +endif +let g:loaded_syntastic_html_tidy_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" Checker options {{{1 + +if !exists('g:syntastic_html_tidy_ignore_errors') + let g:syntastic_html_tidy_ignore_errors = [] +endif + +if !exists('g:syntastic_html_tidy_blocklevel_tags') + let g:syntastic_html_tidy_blocklevel_tags = [] +endif + +if !exists('g:syntastic_html_tidy_inline_tags') + let g:syntastic_html_tidy_inline_tags = [] +endif + +if !exists('g:syntastic_html_tidy_empty_tags') + let g:syntastic_html_tidy_empty_tags = [] +endif + +" }}}1 + +" Constants {{{1 + +let s:IGNORE_ERRORS = [ + \ "<table> lacks \"summary\" attribute", + \ "not approved by W3C", + \ "<input> proprietary attribute \"placeholder\"", + \ "<meta> proprietary attribute \"charset\"", + \ "<meta> lacks \"content\" attribute", + \ "inserting \"type\" attribute", + \ "proprietary attribute \"data-", + \ "missing <!DOCTYPE> declaration", + \ "inserting implicit <body>", + \ "inserting missing 'title' element", + \ "unescaped & or unknown entity", + \ "<input> attribute \"type\" has invalid value", + \ "proprietary attribute \"role\"", + \ "proprietary attribute \"aria-activedescendant\"", + \ "proprietary attribute \"aria-atomic\"", + \ "proprietary attribute \"aria-autocomplete\"", + \ "proprietary attribute \"aria-busy\"", + \ "proprietary attribute \"aria-checked\"", + \ "proprietary attribute \"aria-controls\"", + \ "proprietary attribute \"aria-describedby\"", + \ "proprietary attribute \"aria-disabled\"", + \ "proprietary attribute \"aria-dropeffect\"", + \ "proprietary attribute \"aria-expanded\"", + \ "proprietary attribute \"aria-flowto\"", + \ "proprietary attribute \"aria-grabbed\"", + \ "proprietary attribute \"aria-haspopup\"", + \ "proprietary attribute \"aria-hidden\"", + \ "proprietary attribute \"aria-invalid\"", + \ "proprietary attribute \"aria-label\"", + \ "proprietary attribute \"aria-labelledby\"", + \ "proprietary attribute \"aria-level\"", + \ "proprietary attribute \"aria-live\"", + \ "proprietary attribute \"aria-multiline\"", + \ "proprietary attribute \"aria-multiselectable\"", + \ "proprietary attribute \"aria-orientation\"", + \ "proprietary attribute \"aria-owns\"", + \ "proprietary attribute \"aria-posinset\"", + \ "proprietary attribute \"aria-pressed\"", + \ "proprietary attribute \"aria-readonly\"", + \ "proprietary attribute \"aria-relevant\"", + \ "proprietary attribute \"aria-relevant\"", + \ "proprietary attribute \"aria-required\"", + \ "proprietary attribute \"aria-selected\"", + \ "proprietary attribute \"aria-setsize\"", + \ "proprietary attribute \"aria-sort\"", + \ "proprietary attribute \"aria-valuemax\"", + \ "proprietary attribute \"aria-valuemin\"", + \ "proprietary attribute \"aria-valuenow\"", + \ "proprietary attribute \"aria-valuetext\"" + \ ] +lockvar! s:IGNORE_ERRORS + +let s:BLOCKLEVEL_TAGS = [ + \ 'main', + \ 'section', + \ 'article', + \ 'aside', + \ 'header', + \ 'footer', + \ 'nav', + \ 'figure', + \ 'figcaption' + \ ] +lockvar! s:BLOCKLEVEL_TAGS + +let s:INLINE_TAGS = [ + \ 'video', + \ 'audio', + \ 'source', + \ 'embed', + \ 'mark', + \ 'progress', + \ 'meter', + \ 'time', + \ 'ruby', + \ 'rt', + \ 'rp', + \ 'canvas', + \ 'command', + \ 'details', + \ 'datalist' + \ ] +lockvar! s:INLINE_TAGS + +let s:EMPTY_TAGS = [ + \ 'wbr', + \ 'keygen' + \ ] +lockvar! s:EMPTY_TAGS + +" }}}1 + +function! SyntaxCheckers_html_tidy_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ 'args_after': s:Args() }) + + let errorformat = + \ '%Wline %l column %v - Warning: %m,' . + \ '%Eline %l column %v - Error: %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 1, 2] }) + + " filter out valid HTML5 from the errors + for e in loclist + if e['valid'] && s:IgnoreError(e['text']) == 1 + let e['valid'] = 0 + endif + endfor + + return loclist +endfunction " }}}1 + +" Utilities {{{1 + +" TODO: join this with xhtml.vim for DRY's sake? +function! s:TidyEncOptByFenc() " {{{2 + let TIDY_OPTS = { + \ 'utf-8': '-utf8', + \ 'ascii': '-ascii', + \ 'latin1': '-latin1', + \ 'iso-2022-jp': '-iso-2022', + \ 'cp1252': '-win1252', + \ 'macroman': '-mac', + \ 'utf-16le': '-utf16le', + \ 'utf-16': '-utf16', + \ 'big5': '-big5', + \ 'cp932': '-shiftjis', + \ 'sjis': '-shiftjis', + \ 'cp850': '-ibm858', + \ } + return get(TIDY_OPTS, &fileencoding, '-utf8') +endfunction " }}}2 + +function! s:IgnoreError(text) " {{{2 + for item in s:IGNORE_ERRORS + g:syntastic_html_tidy_ignore_errors + if stridx(a:text, item) != -1 + return 1 + endif + endfor + return 0 +endfunction " }}}2 + +function! s:NewTags(name) " {{{2 + return syntastic#util#shescape(join( s:{toupper(a:name)} + g:syntastic_html_tidy_{a:name}, ',' )) +endfunction " }}}2 + +function! s:Args() " {{{2 + let args = s:TidyEncOptByFenc() . + \ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') . + \ ' --new-inline-tags ' . s:NewTags('inline_tags') . + \ ' --new-empty-tags ' . s:NewTags('empty_tags') . + \ ' -e' + return args +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'tidy'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/validator.vim b/vim/bundle/syntastic/syntax_checkers/html/validator.vim new file mode 100644 index 0000000..14a4c64 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/validator.vim @@ -0,0 +1,69 @@ +"============================================================================ +"File: validator.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_html_validator_checker') + finish +endif +let g:loaded_syntastic_html_validator_checker=1 + +if !exists('g:syntastic_html_validator_api') + let g:syntastic_html_validator_api = 'https://validator.nu/' +endif + +if !exists('g:syntastic_html_validator_parser') + let g:syntastic_html_validator_parser = '' +endif + +if !exists('g:syntastic_html_validator_nsfilter') + let g:syntastic_html_validator_nsfilter = '' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_html_validator_GetLocList() dict + let fname = syntastic#util#shexpand('%') + let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F out=gnu -F asciiquotes=yes' . + \ (g:syntastic_html_validator_parser !=# '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') . + \ (g:syntastic_html_validator_nsfilter !=# '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') . + \ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api + + let errorformat = + \ '%E"%f":%l: %trror: %m,' . + \ '%E"%f":%l-%\d%\+: %trror: %m,' . + \ '%E"%f":%l%\%.%c: %trror: %m,' . + \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror: %m,' . + \ '%E"%f":%l: %trror fatal: %m,' . + \ '%E"%f":%l-%\d%\+: %trror fatal: %m,' . + \ '%E"%f":%l%\%.%c: %trror fatal: %m,' . + \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror fatal: %m,' . + \ '%W"%f":%l: info %tarning: %m,' . + \ '%W"%f":%l-%\d%\+: info %tarning: %m,' . + \ '%W"%f":%l%\%.%c: info %tarning: %m,' . + \ '%W"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: info %tarning: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'validator', + \ 'returns': [0] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'validator', + \ 'exec': 'curl' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/html/w3.vim b/vim/bundle/syntastic/syntax_checkers/html/w3.vim new file mode 100644 index 0000000..37ff11a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/html/w3.vim @@ -0,0 +1,62 @@ +"============================================================================ +"File: w3.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_html_w3_checker') + finish +endif +let g:loaded_syntastic_html_w3_checker = 1 + +if !exists('g:syntastic_html_w3_api') + let g:syntastic_html_w3_api = 'http://validator.w3.org/check' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_html_w3_GetLocList() dict + let makeprg = self.getExecEscaped() . ' -q -L -s -F output=json ' . + \ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' . + \ g:syntastic_html_w3_api + + let errorformat = + \ '%A %\+{,' . + \ '%C %\+"lastLine": %l\,%\?,' . + \ '%C %\+"lastColumn": %c\,%\?,' . + \ '%C %\+"message": "%m"\,%\?,' . + \ '%C %\+"type": "%trror"\,%\?,' . + \ '%-G %\+"type": "%tnfo"\,%\?,' . + \ '%C %\+"subtype": "%tarning"\,%\?,' . + \ '%Z %\+}\,,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0] }) + + for e in loclist + let e['text'] = substitute(e['text'], '\m\\\([\"]\)', '\1', 'g') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'w3', + \ 'exec': 'curl' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim b/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim new file mode 100644 index 0000000..32cc808 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim @@ -0,0 +1,24 @@ +"============================================================================ +"File: jade_lint.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_jade_jade_lint_checker') + finish +endif +let g:loaded_syntastic_jade_jade_lint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'jade', + \ 'name': 'jade_lint', + \ 'exec': 'jade-lint', + \ 'redirect': 'pug/pug_lint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim b/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim new file mode 100644 index 0000000..f4eee5e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim @@ -0,0 +1,85 @@ +"============================================================================ +"File: checkstyle.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Dmitry Geurkov <d.geurkov 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. +" +" Tested with checkstyle 5.5 +"============================================================================ + +if exists('g:loaded_syntastic_java_checkstyle_checker') + finish +endif +let g:loaded_syntastic_java_checkstyle_checker = 1 + +if !exists('g:syntastic_java_checkstyle_classpath') + let g:syntastic_java_checkstyle_classpath = 'checkstyle-6.10.1-all.jar' +endif + +if !exists('g:syntastic_java_checkstyle_conf_file') + let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_java_checkstyle_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + + let conf_file = expand(g:syntastic_java_checkstyle_conf_file, 1) + call self.log('filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file)) + + return filereadable(conf_file) +endfunction + +function! SyntaxCheckers_java_checkstyle_GetLocList() dict + + " classpath + if !exists('s:sep') + let s:sep = syntastic#util#isRunningWindows() || has('win32unix') ? ';' : ':' + endif + let classpath = join(map( split(g:syntastic_java_checkstyle_classpath, s:sep, 1), 'expand(v:val, 1)' ), s:sep) + call self.log('classpath =', classpath) + + " forced options + let opts = [] + if classpath !=# '' + call extend(opts, ['-cp', classpath]) + endif + call extend(opts, [ + \ 'com.puppycrawl.tools.checkstyle.Main', + \ '-c', expand(g:syntastic_java_checkstyle_conf_file, 1), + \ '-f', 'xml' ]) + + " filename + let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) ) + if has('win32unix') + let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g') + endif + + let makeprg = self.makeprgBuild({ 'args_after': opts, 'fname': fname }) + + let errorformat = '%f:%t:%l:%c:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'checkstyle', + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'java', + \ 'name': 'checkstyle', + \ 'exec': 'java'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/java/javac.vim b/vim/bundle/syntastic/syntax_checkers/java/javac.vim new file mode 100644 index 0000000..948c244 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/java/javac.vim @@ -0,0 +1,427 @@ +"============================================================================ +"File: javac.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jochen Keil <jochen.keil at gmail dot com> +" Dmitry Geurkov <d.geurkov 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_java_javac_checker') + finish +endif +let g:loaded_syntastic_java_javac_checker = 1 +let g:syntastic_java_javac_maven_pom_tags = ['build', 'properties'] +let g:syntastic_java_javac_maven_pom_properties = {} +let s:has_maven = 0 + +let s:save_cpo = &cpo +set cpo&vim + +" Checker options {{{1 + +if !exists('g:syntastic_java_javac_executable') + let g:syntastic_java_javac_executable = 'javac' +endif + +if !exists('g:syntastic_java_maven_executable') + let g:syntastic_java_maven_executable = 'mvn' +endif + +if !exists('g:syntastic_java_javac_options') + let g:syntastic_java_javac_options = '-Xlint' +endif + +if !exists('g:syntastic_java_maven_options') + let g:syntastic_java_maven_options = '' +endif + +if !exists('g:syntastic_java_javac_classpath') + let g:syntastic_java_javac_classpath = '' +endif + +if !exists('g:syntastic_java_javac_delete_output') + let g:syntastic_java_javac_delete_output = 1 +endif + +if !exists('g:syntastic_java_javac_autoload_maven_classpath') + let g:syntastic_java_javac_autoload_maven_classpath = 1 +endif + +if !exists('g:syntastic_java_javac_config_file_enabled') + let g:syntastic_java_javac_config_file_enabled = 0 +endif + +if !exists('g:syntastic_java_javac_config_file') + let g:syntastic_java_javac_config_file = '.syntastic_javac_config' +endif + +if !exists('g:syntastic_java_javac_custom_classpath_command') + let g:syntastic_java_javac_custom_classpath_command = '' +endif + +if !exists('g:syntastic_java_javac_maven_pom_ftime') + let g:syntastic_java_javac_maven_pom_ftime = {} +endif + +if !exists('g:syntastic_java_javac_maven_pom_classpath') + let g:syntastic_java_javac_maven_pom_classpath = {} +endif + +" }}}1 + +" Constants {{{1 + +let s:_FILE_SHORTCUTS = { + \ '%FILE_PATH%': '%:p', + \ '%FILE_NAME%': '%:t', + \ '%FILE_DIR%': '%:p:h', + \ } +lockvar! s:_FILE_SHORTCUTS + +" }}}1 + +" Commands {{{1 + +command! SyntasticJavacEditClasspath call s:EditClasspath() +command! SyntasticJavacEditConfig call s:EditConfig() + +" }}}1 + +function! SyntaxCheckers_java_javac_IsAvailable() dict " {{{1 + let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1)) + return executable(expand(g:syntastic_java_javac_executable, 1)) +endfunction " }}}1 + +function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1 + let javac_opts = g:syntastic_java_javac_options + + let output_dir = '' + if g:syntastic_java_javac_delete_output + let output_dir = syntastic#util#tmpdir() + let javac_opts .= ' -d ' . syntastic#util#shescape(output_dir) + endif + + " load classpath from config file + if g:syntastic_java_javac_config_file_enabled + call s:LoadConfigFile() + endif + + + " add classpathes to javac_classpath {{{2 + let javac_classpath = '' + + for path in split(g:syntastic_java_javac_classpath, s:ClassSep()) + if path !=# '' + try + let ps = glob(path, 1, 1) + catch + let ps = split(glob(path, 1), "\n") + endtry + if type(ps) == type([]) + for p in ps + let javac_classpath = s:AddToClasspath(javac_classpath, p) + endfor + else + let javac_classpath = s:AddToClasspath(javac_classpath, ps) + endif + endif + endfor + + if s:has_maven && g:syntastic_java_javac_autoload_maven_classpath + if !g:syntastic_java_javac_delete_output + let javac_opts .= ' -d ' . syntastic#util#shescape(s:MavenOutputDirectory()) + endif + let javac_classpath = s:AddToClasspath(javac_classpath, s:GetMavenClasspath()) + endif + " }}}2 + + " load custom classpath {{{2 + if g:syntastic_java_javac_custom_classpath_command !=# '' + " Pre-process the classpath command string a little. + let classpath_command = g:syntastic_java_javac_custom_classpath_command + for [key, val] in items(s:_FILE_SHORTCUTS) + let classpath_command = substitute(classpath_command, '\V' . key, syntastic#util#shexpand(val), 'g') + endfor + let lines = syntastic#util#system(classpath_command) + if syntastic#util#isRunningWindows() || has('win32unix') + let lines = substitute(lines, "\r\n", "\n", 'g') + endif + for l in split(lines, "\n") + let javac_classpath = s:AddToClasspath(javac_classpath, l) + endfor + endif + + if javac_classpath !=# '' + let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath) + endif + " }}}2 + + let fname = expand('%:p:h', 1) . syntastic#util#Slash() . expand ('%:t', 1) + + if has('win32unix') + let fname = syntastic#util#CygwinPath(fname) + endif + + let makeprg = self.makeprgBuild({ + \ 'args': javac_opts, + \ 'fname': syntastic#util#shescape(fname) }) + + " unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types + let errorformat = + \ '%E%f:%l: error: %m,'. + \ '%W%f:%l: warning: %m,'. + \ '%E%f:%l: %m,'. + \ '%Z%p^,'. + \ '%-G%.%#' + + if output_dir !=# '' + silent! call mkdir(output_dir, 'p') + endif + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['cygwinRemoveCR'] }) + + if output_dir !=# '' + call syntastic#util#rmrf(output_dir) + endif + return errors + +endfunction " }}}1 + +" Utilities {{{1 + +function! s:RemoveCarriageReturn(line) " {{{2 + return substitute(a:line, "\r", '', 'g') +endfunction " }}}2 + +function! s:ClassSep() " {{{2 + return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':' +endfunction " }}}2 + +function! s:AddToClasspath(classpath, path) " {{{2 + if a:path ==# '' + return a:classpath + endif + return (a:classpath !=# '') ? a:classpath . s:ClassSep() . a:path : a:path +endfunction " }}}2 + +function! s:SplitClasspath(classpath) " {{{2 + return split(a:classpath, s:ClassSep()) +endfunction " }}}2 + +function! s:LoadConfigFile() " {{{2 + if filereadable(expand(g:syntastic_java_javac_config_file, 1)) + execute 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1)) + endif +endfunction " }}}2 + +function! s:SaveClasspath() " {{{2 + " build classpath from lines + let path = '' + let lines = getline(1, line('$')) + for l in lines + let path = s:AddToClasspath(path, l) + endfor + " save classpath to config file + if g:syntastic_java_javac_config_file_enabled + if filereadable(expand(g:syntastic_java_javac_config_file, 1)) + " load lines from config file + let lines = readfile(expand(g:syntastic_java_javac_config_file, 1)) + " strip g:syntastic_java_javac_classpath options from config file lines + let i = 0 + while i < len(lines) + if match(lines[i], 'g:syntastic_java_javac_classpath') != -1 + call remove(lines, i) + else + let i += 1 + endif + endwhile + else + let lines = [] + endif + " add new g:syntastic_java_javac_classpath option to config + call add(lines, 'let g:syntastic_java_javac_classpath = ' . string(path)) + " save config file lines + call writefile(lines, expand(g:syntastic_java_javac_config_file, 1)) + endif + " set new classpath + let g:syntastic_java_javac_classpath = path + let &modified = 0 +endfunction " }}}2 + +function! s:EditClasspath() " {{{2 + let command = 'syntastic javac classpath' + let winnr = bufwinnr('^' . command . '$') + if winnr < 0 + let path = [] + let pathlines = split(g:syntastic_java_javac_classpath, "\n") + for p in pathlines + call extend(path, s:SplitClasspath(p)) + endfor + execute (len(path) + 5) . 'sp ' . fnameescape(command) + + augroup syntastic + autocmd BufWriteCmd <buffer> call s:SaveClasspath() | bwipeout + augroup END + + setlocal buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number + for p in path + call append(line('$') - 1, p) + endfor + let &modified = 0 + else + execute winnr . 'wincmd w' + endif +endfunction " }}}2 + +function! s:SaveConfig() " {{{2 + " get lines + let lines = getline(1, line('$')) + if g:syntastic_java_javac_config_file_enabled + " save config file lines + call writefile(lines, expand(g:syntastic_java_javac_config_file, 1)) + endif + let &modified = 0 +endfunction " }}}2 + +function! s:EditConfig() " {{{2 + if !g:syntastic_java_javac_config_file_enabled + return + endif + + let command = 'syntastic javac config' + let winnr = bufwinnr('^' . command . '$') + if winnr < 0 + let lines = [] + if filereadable(expand(g:syntastic_java_javac_config_file, 1)) + let lines = readfile(expand(g:syntastic_java_javac_config_file, 1)) + endif + execute (len(lines) + 5) . 'sp ' . fnameescape(command) + + augroup syntastic + autocmd BufWriteCmd <buffer> call s:SaveConfig() | bwipeout + augroup END + + setlocal ft=vim buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number + for l in lines + call append(line('$') - 1, l) + endfor + let &modified = 0 + else + execute winnr . 'wincmd w' + endif +endfunction " }}}2 + +function! s:GetMavenProperties() " {{{2 + let mvn_properties = {} + let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1)) + if s:has_maven && filereadable(pom) + if !has_key(g:syntastic_java_javac_maven_pom_properties, pom) + let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . + \ ' -f ' . syntastic#util#shescape(pom) . + \ ' ' . g:syntastic_java_maven_options + let mvn_is_managed_tag = 1 + let mvn_settings_output = split(syntastic#util#system(mvn_cmd . ' help:effective-pom'), "\n") + let current_path = 'project' + for line in mvn_settings_output + let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$') + if mvn_is_managed_tag && !empty(matches) + let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) >= 0 + let current_path .= '.' . matches[1] + else + let matches = matchlist(line, '\m^\s*</\([a-zA-Z0-9\-\.]\+\)>\s*$') + if !empty(matches) + let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) < 0 + let current_path = substitute(current_path, '\m\.' . matches[1] . '$', '', '') + else + let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\(.\+\)</[a-zA-Z0-9\-\.]\+>\s*$') + if mvn_is_managed_tag && !empty(matches) + let mvn_properties[current_path . '.' . matches[1]] = matches[2] + endif + endif + endif + endfor + let g:syntastic_java_javac_maven_pom_properties[pom] = mvn_properties + endif + return g:syntastic_java_javac_maven_pom_properties[pom] + endif + return mvn_properties +endfunction " }}}2 + +function! s:GetMavenClasspath() " {{{2 + let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1)) + if s:has_maven && filereadable(pom) + if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom) + let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . + \ ' -f ' . syntastic#util#shescape(pom) . + \ ' ' . g:syntastic_java_maven_options + let mvn_classpath_output = split(syntastic#util#system(mvn_cmd . ' dependency:build-classpath -DincludeScope=test'), "\n") + let mvn_classpath = '' + let class_path_next = 0 + + for line in mvn_classpath_output + if class_path_next == 1 + let mvn_classpath = s:RemoveCarriageReturn(line) + break + endif + if stridx(line, 'Dependencies classpath:') >= 0 + let class_path_next = 1 + endif + endfor + + let mvn_properties = s:GetMavenProperties() + + let sep = syntastic#util#Slash() + let output_dir = get(mvn_properties, 'project.build.outputDirectory', join(['target', 'classes'], sep)) + let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir) + + let test_output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join(['target', 'test-classes'], sep)) + let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir) + + let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom) + let g:syntastic_java_javac_maven_pom_classpath[pom] = mvn_classpath + endif + return g:syntastic_java_javac_maven_pom_classpath[pom] + endif + return '' +endfunction " }}}2 + +function! s:MavenOutputDirectory() " {{{2 + let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1)) + if s:has_maven && filereadable(pom) + let mvn_properties = s:GetMavenProperties() + let output_dir = get(mvn_properties, 'project.properties.build.dir', getcwd()) + + let sep = syntastic#util#Slash() + let src_main_dir = get(mvn_properties, 'project.build.sourceDirectory', join(['src', 'main', 'java'], sep)) + let src_test_dir = get(mvn_properties, 'project.build.testsourceDirectory', join(['src', 'test', 'java'], sep)) + if stridx(expand('%:p:h', 1), src_main_dir) >= 0 + let output_dir = get(mvn_properties, 'project.build.outputDirectory', join ([output_dir, 'target', 'classes'], sep)) + endif + if stridx(expand('%:p:h', 1), src_test_dir) >= 0 + let output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join([output_dir, 'target', 'test-classes'], sep)) + endif + + if has('win32unix') + let output_dir = syntastic#util#CygwinPath(output_dir) + endif + return output_dir + endif + return '.' +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'java', + \ 'name': 'javac'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim b/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim new file mode 100644 index 0000000..8c4190a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim @@ -0,0 +1,76 @@ +"============================================================================ +"File: closurecompiler.vim +"Description: Javascript syntax checker - using Google Closure Compiler +"Maintainer: Motohiro Takayama <mootoh 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_javascript_closurecompiler_checker') + finish +endif +let g:loaded_syntastic_javascript_closurecompiler_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict + call syntastic#log#deprecationWarn('javascript_closure_compiler_path', 'javascript_closurecompiler_path') + + if !executable(self.getExec()) + return 0 + endif + + let s:has_script = exists('g:syntastic_javascript_closurecompiler_script') + if s:has_script + return 1 + endif + + let cp = get(g:, 'syntastic_javascript_closurecompiler_path', '') + call self.log('g:syntastic_javascript_closurecompiler_path =', cp) + + let jar = expand(cp, 1) + call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar)) + + return filereadable(jar) +endfunction + +function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict + call syntastic#log#deprecationWarn('javascript_closure_compiler_options', 'javascript_closurecompiler_args') + call syntastic#log#deprecationWarn('javascript_closure_compiler_file_list', 'javascript_closurecompiler_file_list') + + let flist = expand(get(g:, 'syntastic_javascript_closurecompiler_file_list', ''), 1) + if filereadable(flist) + let file_list = map( readfile(flist), 'expand(v:var, 1)' ) + else + let file_list = [expand('%', 1)] + endif + + let makeprg = self.makeprgBuild({ + \ 'exe_after': (s:has_script ? [] : ['-jar', expand(g:syntastic_javascript_closurecompiler_path, 1)]), + \ 'args_after': '--js', + \ 'fname': file_list }) + + let errorformat = + \ '%-GOK,'. + \ '%E%f:%l: ERROR - %m,'. + \ '%W%f:%l: WARNING - %m,'. + \ '%Z%p^' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'closurecompiler', + \ 'exec': get(g:, 'syntastic_javascript_closurecompiler_script', 'java')}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim new file mode 100644 index 0000000..437bc55 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim @@ -0,0 +1,78 @@ +"============================================================================ +"File: eslint.vim +"Description: Javascript syntax checker - using eslint +"Maintainer: Maksim Ryzhikov <rv.maksim 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_javascript_eslint_checker') + finish +endif +let g:loaded_syntastic_javascript_eslint_checker = 1 + +if !exists('g:syntastic_javascript_eslint_sort') + let g:syntastic_javascript_eslint_sort = 1 +endif + +if !exists('g:syntastic_javascript_eslint_generic') + let g:syntastic_javascript_eslint_generic = 0 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_eslint_IsAvailable() dict + if g:syntastic_javascript_eslint_generic + call self.log('generic eslint, exec =', self.getExec()) + endif + + if !executable(self.getExec()) + return 0 + endif + return g:syntastic_javascript_eslint_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1]) +endfunction + +function! SyntaxCheckers_javascript_eslint_GetLocList() dict + if !g:syntastic_javascript_eslint_generic + call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args', + \ "'--config ' . syntastic#util#shexpand(OLD_VAR)") + endif + + let makeprg = self.makeprgBuild({ 'args_before': (g:syntastic_javascript_eslint_generic ? '' : '-f compact') }) + + let errorformat = + \ '%E%f: line %l\, col %c\, Error - %m,' . + \ '%W%f: line %l\, col %c\, Warning - %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'] }) + + if !g:syntastic_javascript_eslint_generic + if !exists('s:eslint_new') + let s:eslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1]) + endif + + if !s:eslint_new + for e in loclist + let e['col'] += 1 + endfor + endif + endif + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'eslint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim b/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim new file mode 100644 index 0000000..13ee47a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim @@ -0,0 +1,67 @@ +"============================================================================ +"File: flow.vim +"Description: Javascript syntax checker - using flow +"Maintainer: Michael Robinson <mike@pagesofinterest.net> +"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_javascript_flow_checker') + finish +endif +let g:loaded_syntastic_javascript_flow_checker = 1 + +if !exists('g:syntastic_javascript_flow_sort') + let g:syntastic_javascript_flow_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_flow_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6]) +endfunction + +function! SyntaxCheckers_javascript_flow_GetLocList() dict + if syntastic#util#findFileInParent('.flowconfig', expand('%:p:h', 1)) ==# '' + return [] + endif + + let makeprg = self.makeprgBuild({ + \ 'exe': self.getExecEscaped() . ' check', + \ 'args_after': '--show-all-errors --json' }) + + let errorformat = + \ '%f:%l:%c:%n: %m,' . + \ '%f:%l:%c: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'flow', + \ 'defaults': {'type': 'E'} }) + + for e in loclist + if get(e, 'col', 0) && get(e, 'nr', 0) + let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c' + let e['nr'] = 0 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'flow'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim new file mode 100644 index 0000000..3368905 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: gjslint.vim +"Description: Javascript syntax checker - using gjslint +"Maintainer: Martin Grenfell <martin.grenfell 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_javascript_gjslint_checker') + finish +endif +let g:loaded_syntastic_javascript_gjslint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_gjslint_GetLocList() dict + call syntastic#log#deprecationWarn('javascript_gjslint_conf', 'javascript_gjslint_args') + + let makeprg = self.makeprgBuild({ + \ 'args': '--nodebug_indentation', + \ 'args_after': '--check_html --nosummary --unix_mode --nobeep' }) + + let errorformat = + \ "%f:%l:(New Error -%\\?\%n) %m," . + \ "%f:%l:(-%\\?%n) %m," . + \ "%-G1 files checked," . + \ " no errors found.," . + \ "%-G%.%#" + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'gjslint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim new file mode 100644 index 0000000..d259086 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: jscs.vim +"Description: Javascript syntax checker - using jscs +"Maintainer: LCD 47 <lcd047@gmail.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_javascript_jscs_checker') + finish +endif +let g:loaded_syntastic_javascript_jscs_checker = 1 + +if !exists('g:syntastic_javascript_jscs_sort') + let g:syntastic_javascript_jscs_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_jscs_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 1]) +endfunction + +function! SyntaxCheckers_javascript_jscs_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '--no-colors --max-errors -1 --reporter json' }) + + let errorformat = '%f:%l:%c:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'preprocess': 'jscs', + \ 'defaults': {'type': 'E'}, + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jscs'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim new file mode 100644 index 0000000..492aa69 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim @@ -0,0 +1,60 @@ +"============================================================================ +"File: jshint.vim +"Description: Javascript syntax checker - using jshint +"Maintainer: Martin Grenfell <martin.grenfell 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_javascript_jshint_checker') + finish +endif +let g:loaded_syntastic_javascript_jshint_checker = 1 + +if !exists('g:syntastic_javascript_jshint_sort') + let g:syntastic_javascript_jshint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_jshint_IsAvailable() dict + call syntastic#log#deprecationWarn('jshint_exec', 'javascript_jshint_exec') + if !executable(self.getExec()) + return 0 + endif + + let ver = self.getVersion() + let s:jshint_new = syntastic#util#versionIsAtLeast(ver, [1, 1]) + + return syntastic#util#versionIsAtLeast(ver, [1]) +endfunction + +function! SyntaxCheckers_javascript_jshint_GetLocList() dict + call syntastic#log#deprecationWarn('javascript_jshint_conf', 'javascript_jshint_args', + \ "'--config ' . syntastic#util#shexpand(OLD_VAR)") + + let makeprg = self.makeprgBuild({ 'args_after': (s:jshint_new ? '--verbose ' : '') }) + + let errorformat = s:jshint_new ? + \ '%A%f: line %l\, col %v\, %m \(%t%*\d\)' : + \ '%E%f: line %l\, col %v\, %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jshint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim new file mode 100644 index 0000000..aa9862b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: jsl.vim +"Description: Javascript syntax checker - using jsl +"Maintainer: Martin Grenfell <martin.grenfell 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_javascript_jsl_checker') + finish +endif +let g:loaded_syntastic_javascript_jsl_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_jsl_GetLocList() dict + call syntastic#log#deprecationWarn('javascript_jsl_conf', 'javascript_jsl_args', + \ "'-conf ' . syntastic#util#shexpand(OLD_VAR)") + + let makeprg = self.makeprgBuild({ + \ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' }) + + let errorformat = + \ '%W%f(%l): lint warning: %m,'. + \ '%-Z%p^,'. + \ '%W%f(%l): warning: %m,'. + \ '%-Z%p^,'. + \ '%E%f(%l): SyntaxError: %m,'. + \ '%-Z%p^,'. + \ '%-G' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jsl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim new file mode 100644 index 0000000..e2ce76c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: jslint.vim +"Description: Javascript syntax checker - using jslint +"Maintainer: Martin Grenfell <martin.grenfell 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_javascript_jslint_checker') + finish +endif + +let g:loaded_syntastic_javascript_jslint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_jslint_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\mExpected .* and instead saw ''\zs.*\ze''') + if term !=# '' + let term = '\V\<' . escape(term, '\') . '\>' + endif + return term +endfunction + +function! SyntaxCheckers_javascript_jslint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '--white --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars' }) + + let errorformat = + \ '%E %##%\d%\+ %m,'. + \ '%-Z%.%#Line %l\, Pos %c,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jslint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim new file mode 100644 index 0000000..e29ce06 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: jsxhint.vim +"Description: Javascript syntax checker - using jsxhint +"Maintainer: Thomas Boyt <me@thomasboyt.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_javascript_jsxhint_checker') + finish +endif +let g:loaded_syntastic_javascript_jsxhint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict " {{{1 + if !executable(self.getExec()) + return 0 + endif + + let version_output = syntastic#util#system(self.getExecEscaped() . ' --version') + let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : [] + if len(parsed_ver) + call self.setVersion(parsed_ver) + else + call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1)) + call syntastic#log#error("checker javascript/jsxhint: can't parse version string (abnormal termination?)") + endif + + return syntastic#util#versionIsAtLeast(parsed_ver, [0, 4, 1]) +endfunction " }}}1 + +function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ + \ 'args_after': '--verbose' }) + + let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction " }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jsxhint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim new file mode 100644 index 0000000..2995409 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: mixedindentlint.vim +"Description: Mixed indentation linter for vim +"Maintainer: Payton Swick <payton@foolord.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_javascript_mixedindentlint_checker') + finish +endif +let g:loaded_syntastic_javascript_mixedindentlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_mixedindentlint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = 'Line %l in "%f" %.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'defaults': { 'text': 'Indentation differs from rest of file' }, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'mixedindentlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim b/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim new file mode 100644 index 0000000..e652bd0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: standard.vim +"Description: JavaScript syntax checker - using standard +"Maintainer: LCD 47 <lcd047@gmail.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_javascript_standard_checker') + finish +endif +let g:loaded_syntastic_javascript_standard_checker = 1 + +if !exists('g:syntastic_javascript_standard_generic') + let g:syntastic_javascript_standard_generic = 0 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_standard_IsAvailable() dict + if g:syntastic_javascript_standard_generic + call self.log('generic standard, exec =', self.getExec()) + endif + + if !executable(self.getExec()) + return 0 + endif + return g:syntastic_javascript_standard_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1]) +endfunction + +function! SyntaxCheckers_javascript_standard_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-v' }) + + let errorformat = ' %f:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'defaults': {'type': 'W'}, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'standard'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim new file mode 100644 index 0000000..547942b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: tern_lint.vim +"Description: Syntax checking plugin for syntastic +"Maintainer: LCD 47 <lcd047@gmail.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_javascript_tern_lint_checker') + finish +endif +let g:loaded_syntastic_javascript_tern_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_javascript_tern_lint_IsAvailable() dict + return has('byte_offset') && executable(self.getExec()) +endfunction + +function! SyntaxCheckers_javascript_tern_lint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%t:%l:%c:%n:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'tern_lint', + \ 'returns': [0] }) + + for e in loclist + if get(e, 'col', 0) && get(e, 'nr', 0) + let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c' + endif + let e['nr'] = 0 + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'tern_lint', + \ 'exec': 'tern-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim b/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim new file mode 100644 index 0000000..9a89c78 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: jsonlint.vim +"Description: JSON syntax checker - using jsonlint +"Maintainer: Miller Medeiros <contact at millermedeiros 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_json_jsonlint_checker') + finish +endif +let g:loaded_syntastic_json_jsonlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_json_jsonlint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'post_args_after': '--compact' }) + + let errorformat = + \ '%ELine %l:%c,'. + \ '%Z\\s%#Reason: %m,'. + \ '%C%.%#,'. + \ '%f: line %l\, col %c\, %m,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'json', + \ 'name': 'jsonlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim b/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim new file mode 100644 index 0000000..2a756b6 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: jsonval.vim +"Description: JSON syntax checker - using jsonval +"Maintainer: Miller Medeiros <contact at millermedeiros 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_json_jsonval_checker') + finish +endif +let g:loaded_syntastic_json_jsonval_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_json_jsonval_GetLocList() dict + " based on https://gist.github.com/1196345 + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f: %m at line %l,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'json', + \ 'name': 'jsonval'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee b/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee new file mode 100644 index 0000000..0b05e4a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +fs = require 'fs' +less = require 'less' +args = process.argv.slice(1) +options = {} + +args = args.filter (arg) -> + match = arg.match(/^-I(.+)$/) + if match + options.paths.push(match[1]); + return false + + match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i) + if match + arg = match[1] + else + return arg + + switch arg + when 'strict-imports' then options.strictImports = true + when 'include-path' + options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':') + .map (p) -> + if p + return path.resolve(process.cwd(), p) + when 'O0' then options.optimization = 0 + when 'O1' then options.optimization = 1 + when 'O2' then options.optimization = 2 + +options.filename = args[1] + +parser = new(less.Parser) options + +fs.readFile(options.filename, 'utf-8', (err,data) -> + parser.parse(data, (err, tree) -> + if err + less.writeError err + process.exit(1) + ) +) diff --git a/vim/bundle/syntastic/syntax_checkers/less/less-lint.js b/vim/bundle/syntastic/syntax_checkers/less/less-lint.js new file mode 100644 index 0000000..5abc653 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/less/less-lint.js @@ -0,0 +1,57 @@ +// Generated by CoffeeScript 1.3.3 +(function() { + var args, fs, less, options, parser; + + fs = require('fs'); + + less = require('less'); + + args = process.argv.slice(1); + + options = {}; + + args = args.filter(function(arg) { + var match; + match = arg.match(/^-I(.+)$/); + if (match) { + options.paths.push(match[1]); + return false; + } + match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i); + if (match) { + arg = match[1]; + } else { + return arg; + } + switch (arg) { + case 'strict-imports': + return options.strictImports = true; + case 'include-path': + return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) { + if (p) { + return path.resolve(process.cwd(), p); + } + }); + case 'O0': + return options.optimization = 0; + case 'O1': + return options.optimization = 1; + case 'O2': + return options.optimization = 2; + } + }); + + options.filename = args[1]; + + parser = new less.Parser(options); + + fs.readFile(options.filename, 'utf-8', function(err, data) { + return parser.parse(data, function(err, tree) { + if (err) { + less.writeError(err); + return process.exit(1); + } + }); + }); + +}).call(this); diff --git a/vim/bundle/syntastic/syntax_checkers/less/lessc.vim b/vim/bundle/syntastic/syntax_checkers/less/lessc.vim new file mode 100644 index 0000000..ad4035e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/less/lessc.vim @@ -0,0 +1,59 @@ +"============================================================================ +"File: less.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Julien Blanchard <julien at sideburns dot eu> +"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_less_lessc_checker') + finish +endif +let g:loaded_syntastic_less_lessc_checker = 1 + +if !exists('g:syntastic_less_use_less_lint') + let g:syntastic_less_use_less_lint = 0 +endif + +let s:save_cpo = &cpo +set cpo&vim + +let s:node_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h', 1) . syntastic#util#Slash() . 'less-lint.js') + +function! SyntaxCheckers_less_lessc_IsAvailable() dict + call self.log('g:syntastic_less_use_less_lint =', g:syntastic_less_use_less_lint) + return g:syntastic_less_use_less_lint ? executable('node') : executable(self.getExec()) +endfunction + +function! SyntaxCheckers_less_lessc_GetLocList() dict + call syntastic#log#deprecationWarn('less_options', 'less_lessc_args') + + let makeprg = self.makeprgBuild({ + \ 'exe': (g:syntastic_less_use_less_lint ? s:node_file : self.getExecEscaped()), + \ 'args_after': '--no-color', + \ 'tail': '> ' . syntastic#util#DevNull() }) + + let errorformat = + \ '%m in %f on line %l\, column %c:,' . + \ '%m in %f:%l:%c,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'], + \ 'defaults': {'bufnr': bufnr(''), 'text': 'Syntax error'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'less', + \ 'name': 'lessc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/less/recess.vim b/vim/bundle/syntastic/syntax_checkers/less/recess.vim new file mode 100644 index 0000000..1a8d876 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/less/recess.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: recess.vim +"Description: Syntax checking plugin for syntastic.vim using `recess` +" (http://twitter.github.io/recess/). +"Maintainer: Tim Carry <tim at pixelastic 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_less_recess_checker') + finish +endif +let g:loaded_syntastic_less_recess_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_less_recess_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'post_args_after': '--format=compact --stripColors' }) + + let errorformat = + \ '%E%m in %f,' . + \ '%Z %#%l.%.%#,' . + \ '%f:%l:%m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'less', + \ 'name': 'recess'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/lex/flex.vim b/vim/bundle/syntastic/syntax_checkers/lex/flex.vim new file mode 100644 index 0000000..82cbf10 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/lex/flex.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: lex.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_lex_flex_checker') + finish +endif +let g:loaded_syntastic_lex_flex_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_lex_flex_GetHighlightRegex(item) + let term = matchstr(a:item['text'], + \ '\m^\(unrecognized %option\|bad <start condition>\|bad character\( class expression\)\=\): \zs.*') + if term ==# '' + let term = matchstr(a:item['text'], + \ '\m^\(Definition value for\|undefined definition\) \zs{[^}]\+}\ze') + endif + + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_lex_flex_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': syntastic#c#NullOutput() }) + + let errorformat = '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lex', + \ 'name': 'flex'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim b/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim new file mode 100644 index 0000000..0dfe03c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: limbo.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alex Efros <powerman-asdf@ya.ru> +"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_limbo_limbo_checker') + finish +endif +let g:loaded_syntastic_limbo_limbo_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_limbo_limbo_GetLocList() dict + let include = $INFERNO_HOME !=# '' ? '-I$INFERNO_HOME ' : '' + " don't generate .dis in current dir while checking syntax, + " .dis should be generated by `mk` + let output = filereadable('mkfile') ? (' ' . syntastic#c#NullOutput()) : '' + + let makeprg = self.makeprgBuild({ 'args_before': include . '-w' . output }) + + let errorformat = '%E%f:%l:%m' + if expand('%', 1) =~# '\m\.m$' + let errorformat = '%-G%f:%l: near ` EOF ` : no implementation module,' . errorformat + endif + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'limbo', + \ 'name': 'limbo' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim b/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim new file mode 100644 index 0000000..26de435 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: lisp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net> +"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_lisp_clisp_checker') + finish +endif +let g:loaded_syntastic_lisp_clisp_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_lisp_clisp_GetLocList() dict + let tmpdir = syntastic#util#tmpdir() + let out = tmpdir !=# '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : '' + + let makeprg = self.makeprgBuild({ + \ 'args_after': '-q', + \ 'fname_before': '-c', + \ 'post_args_after': out }) + + let errorformat = + \ '%-G;%.%#,' . + \ '%W%>WARNING:%.%# line %l : %m,' . + \ '%Z %#%m,' . + \ '%W%>WARNING:%.%# lines %l%\%.%\%.%\d%\+ : %m,' . + \ '%Z %#%m,' . + \ '%E%>The following functions were %m,' . + \ '%Z %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) + + call syntastic#util#rmrf(tmpdir) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lisp', + \ 'name': 'clisp'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim b/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim new file mode 100644 index 0000000..7e90314 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: llvm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Andrew Kelley <superjoe30@gmail.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_llvm_llvm_checker') + finish +endif +let g:loaded_syntastic_llvm_llvm_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_llvm_llvm_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() }) + + let errorformat = 'llc: %f:%l:%c: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'llvm', + \ 'name': 'llvm', + \ 'exec': 'llc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/lua/luac.vim b/vim/bundle/syntastic/syntax_checkers/lua/luac.vim new file mode 100644 index 0000000..178f76a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/lua/luac.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: lua.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_lua_luac_checker') + finish +endif +let g:loaded_syntastic_lua_luac_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) + let result = '' + let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''') + if near !=# '' + if near ==# '<eof>' + let p = getpos('$') + let a:pos['lnum'] = p[1] + let a:pos['col'] = p[2] + let result = '\%' . p[2] . 'c' + else + let result = '\V' . escape(near, '\') + endif + + " XXX the following piece of code is evil, and is likely to break + " in future versions of syntastic; enable it at your own risk :) + + "let open = matchstr(a:pos['text'], '\m(to close ''\zs[^'']\+\ze'' at line [0-9]\+)') + "if open != '' + " let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)')) + " let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning' + " call matchadd(group, '\%' . line . 'l\V' . escape(open, '\')) + "endif + endif + return result +endfunction + +function! SyntaxCheckers_lua_luac_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-p' }) + + let errorformat = 'luac: %#%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lua', + \ 'name': 'luac'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim b/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim new file mode 100644 index 0000000..5c8521d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim @@ -0,0 +1,67 @@ +"============================================================================ +"File: luacheck.vim +"Description: Lua static analysis using luacheck +"Maintainer: Thiago Bastos <tbastos@tbastos.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_lua_luacheck_checker') + finish +endif +let g:loaded_syntastic_lua_luacheck_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_lua_luacheck_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m''\zs\S\+\ze''') + if term !=# '' + return '\V\<' . escape(term, '\') . '\>' + endif + + let term = matchstr(a:item['text'], '\m\(accessing undefined\|setting non-standard global\|' . + \ 'setting non-module global\|unused global\) variable \zs\S\+') + if term ==# '' + let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze was previously defined') + endif + if term ==# '' + let term = matchstr(a:item['text'], '\munused \(variable\|argument\|loop variable\) \zs\S\+') + endif + if term ==# '' + let term = matchstr(a:item['text'], '\m\(value assigned to variable\|value of argument\|' . + \ 'value of loop variable\) \zs\S\+') + endif + if term ==# '' + let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze is never set') + endif + + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_lua_luacheck_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--no-color' }) + + let errorformat = + \ '%f:%l:%c: %m,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'defaults': { 'type': 'W' }, + \ 'returns': [0, 1, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lua', + \ 'name': 'luacheck' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim b/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim new file mode 100644 index 0000000..17dc86d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: mdl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Charles Beynon <etothepiipower 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_markdown_mdl_checker') + finish +endif +let g:loaded_syntastic_markdown_mdl_checker = 1 + +if !exists('g:syntastic_markdown_mdl_sort') + let g:syntastic_markdown_mdl_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_markdown_mdl_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '--warnings' }) + + let errorformat = + \ '%E%f:%\s%\=%l: %m,'. + \ '%W%f: Kramdown Warning: %m found on line %l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'markdown', + \ 'name': 'mdl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim b/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim new file mode 100644 index 0000000..3419d4d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: textlint.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_markdown_textlint_checker') + finish +endif +let g:loaded_syntastic_markdown_textlint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'markdown', + \ 'name': 'textlint', + \ 'redirect': 'text/textlint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim b/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim new file mode 100644 index 0000000..6e0b8d1 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: matlab.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jason Graham <jason at the-graham 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_matlab_mlint_checker') + finish +endif +let g:loaded_syntastic_matlab_mlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_matlab_mlint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-id $*' }) + + let errorformat = + \ 'L %l (C %c): %*[a-zA-Z0-9]: %m,'. + \ 'L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'matlab', + \ 'name': 'mlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim b/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim new file mode 100644 index 0000000..75ee654 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim @@ -0,0 +1,49 @@ +"============================================================================ +"File: mercury.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Joshua Rahm (joshuarahm@gmail.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_mercury_mmc_checker') + finish +endif +let g:loaded_syntastic_mercury_mmc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_mercury_mmc_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_before': '-e' }) + + let errorformat = + \ '%C%f:%l: %m,' . + \ '%E%f:%l: %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for e in loclist + if stridx(e['text'], ' warning:') >= 0 + let e['type'] = 'W' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'mercury', + \ 'name': 'mmc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim b/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim new file mode 100644 index 0000000..e309c1f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: nasm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Håvard Pettersson <haavard.pettersson 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_nasm_nasm_checker') + finish +endif +let g:loaded_syntastic_nasm_nasm_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_nasm_nasm_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '-X gnu -f elf' . + \ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . syntastic#util#Slash()) . + \ ' ' . syntastic#c#NullOutput() }) + + let errorformat = '%f:%l: %t%*[^:]: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nasm', + \ 'name': 'nasm'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/nix/nix.vim b/vim/bundle/syntastic/syntax_checkers/nix/nix.vim new file mode 100644 index 0000000..f3c449d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/nix/nix.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: nix.vim +"Description: Check nix syntax using 'nix-instantiate --eval-only' +"Maintainer: Tim Cuthbertson <tim@gfxmonk.net> +"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_nix_nix_checker') + finish +endif +let g:loaded_syntastic_nix_nix_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_nix_nix_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--parse-only' }) + + let errorformat = + \ '%f:%l:%c:%m,' . + \ '%f:%l:%m,' . + \ '%f:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'e'}, + \ 'preprocess': 'nix' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nix', + \ 'name': 'nix', + \ 'exec': 'nix-instantiate' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim b/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim new file mode 100644 index 0000000..dcad8c5 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: igor.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_nroff_igor_checker') + finish +endif +let g:loaded_syntastic_nroff_igor_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nroff', + \ 'name': 'igor', + \ 'redirect': 'docbk/igor'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim b/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim new file mode 100644 index 0000000..8efc4ce --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: mandoc.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_nroff_mandoc_checker') + finish +endif +let g:loaded_syntastic_nroff_mandoc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_nroff_mandoc_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-Tlint' }) + + let errorformat = + \ '%E%f:%l:%c: %tRROR: %m,' . + \ '%W%f:%l:%c: %tARNING: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2, 3, 4] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nroff', + \ 'name': 'mandoc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim b/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim new file mode 100644 index 0000000..73da7f8 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim @@ -0,0 +1,59 @@ +"============================================================================ +"File: objc.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_objc_gcc_checker') + finish +endif +let g:loaded_syntastic_objc_gcc_checker = 1 + +if !exists('g:syntastic_objc_compiler_options') + let g:syntastic_objc_compiler_options = '-std=gnu99' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_objc_gcc_IsAvailable() dict + if !exists('g:syntastic_objc_compiler') + let g:syntastic_objc_compiler = executable(self.getExec()) ? self.getExec() : 'clang' + endif + call self.log('g:syntastic_objc_compiler =', g:syntastic_objc_compiler) + return executable(expand(g:syntastic_objc_compiler, 1)) +endfunction + +function! SyntaxCheckers_objc_gcc_GetLocList() dict + return syntastic#c#GetLocList('objc', '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 objective-c -fsyntax-only', + \ 'header_flags': '-x objective-c-header -lobjc', + \ 'header_names': '\m\.h$' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objc', + \ 'name': 'gcc' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim b/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim new file mode 100644 index 0000000..534d82b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_objc_oclint_checker') + finish +endif +let g:loaded_syntastic_objc_oclint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objc', + \ 'name': 'oclint', + \ 'redirect': 'c/oclint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim b/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim new file mode 100644 index 0000000..6ae7ba5 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim @@ -0,0 +1,59 @@ +"============================================================================ +"File: objcpp.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_objcpp_gcc_checker') + finish +endif +let g:loaded_syntastic_objcpp_gcc_checker = 1 + +if !exists('g:syntastic_objcpp_compiler_options') + let g:syntastic_objcpp_compiler_options = '-std=gnu99' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict + if !exists('g:syntastic_c_compiler') + let g:syntastic_objcpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang' + endif + call self.log('g:syntastic_objcpp_compiler =', g:syntastic_objcpp_compiler) + return executable(expand(g:syntastic_objcpp_compiler, 1)) +endfunction + +function! SyntaxCheckers_objcpp_gcc_GetLocList() dict + return syntastic#c#GetLocList('objcpp', '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 objective-c++ -fsyntax-only', + \ 'header_flags': '-x objective-c++-header -lobjc', + \ 'header_names': '\m\.h$' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objcpp', + \ 'name': 'gcc' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim b/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim new file mode 100644 index 0000000..5528258 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim @@ -0,0 +1,22 @@ +"============================================================================ +"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_objcpp_oclint_checker') + finish +endif +let g:loaded_syntastic_objcpp_oclint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objcpp', + \ 'name': 'oclint', + \ 'redirect': 'c/oclint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim b/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim new file mode 100644 index 0000000..f7f34e7 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim @@ -0,0 +1,130 @@ +"============================================================================ +"File: ocaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Török Edwin <edwintorok 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_ocaml_camlp4o_checker') + finish +endif +let g:loaded_syntastic_ocaml_camlp4o_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" Checker options {{{1 + +if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc') + let g:syntastic_ocaml_use_ocamlc = 0 +endif + +if !exists('g:syntastic_ocaml_use_janestreet_core') + let g:syntastic_ocaml_use_janestreet_core = 0 +endif + +if !exists('g:syntastic_ocaml_janestreet_core_dir') + let g:syntastic_ocaml_janestreet_core_dir = '.' +endif + +if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable('ocamlbuild') + let g:syntastic_ocaml_use_ocamlbuild = 0 +endif + +" }}}1 + +function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " {{{1 + let s:ocamlpp = get(g:, 'syntastic_ocaml_camlp4r', 0) ? 'camlp4r' : 'camlp4o' + return executable(s:ocamlpp) +endfunction " }}}1 + +function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1 + let makeprg = s:GetMakeprg() + if makeprg ==# '' + return [] + endif + + let errorformat = + \ '%WWarning: File "%f"\, line %l\, chars %c-%n:,'. + \ '%WWarning: line %l\, chars %c-%n:,'. + \ '%AFile "%f"\, line %l\, characters %c-%n:,'. + \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'. + \ '%AFile "%f"\, line %l\, character %c:,'. + \ '%AFile "%f"\, line %l\, character %c:%m,'. + \ '%-GPreprocessing error %.%#,'. + \ '%-GCommand exited %.%#,'. + \ '%C%tarning %*\d: %m,'. + \ '%C%m,'. + \ '%-G+%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) + + for e in loclist + if get(e, 'col', 0) && get(e, 'nr', 0) + let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c' + let e['nr'] = 0 + endif + endfor + + return loclist +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetMakeprg() " {{{2 + return + \ g:syntastic_ocaml_use_ocamlc ? g:syntastic_ocaml_use_ocamlc : + \ (g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')) ? s:GetOcamlcMakeprg() : + \ s:GetOtherMakeprg() +endfunction " }}}2 + +function! s:GetOcamlcMakeprg() " {{{2 + let build_cmd = g:syntastic_ocaml_use_janestreet_core ? + \ 'ocamlc -I ' . syntastic#util#shexpand(g:syntastic_ocaml_janestreet_core_dir) : 'ocamlc' + let build_cmd .= ' -c ' . syntastic#util#shexpand('%') + return build_cmd +endfunction " }}}2 + +function! s:GetOcamlBuildMakeprg() " {{{2 + return 'ocamlbuild -quiet -no-log -tag annot,' . s:ocamlpp . ' -no-links -no-hygiene -no-sanitize ' . + \ syntastic#util#shexpand('%:r') . '.cmi' +endfunction " }}}2 + +function! s:GetOtherMakeprg() " {{{2 + "TODO: give this function a better name? + " + "TODO: should use throw/catch instead of returning an empty makeprg + + let extension = expand('%:e', 1) + let makeprg = '' + + if stridx(extension, 'mly') >= 0 && executable('menhir') + " ocamlyacc output can't be redirected, so use menhir + let makeprg = 'menhir --only-preprocess ' . syntastic#util#shexpand('%') . ' >' . syntastic#util#DevNull() + elseif stridx(extension,'mll') >= 0 && executable('ocamllex') + let makeprg = 'ocamllex -q ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%') + else + let makeprg = 'camlp4o ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%') + endif + + return makeprg +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ocaml', + \ 'name': 'camlp4o'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/perl/perl.vim b/vim/bundle/syntastic/syntax_checkers/perl/perl.vim new file mode 100644 index 0000000..e039518 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/perl/perl.vim @@ -0,0 +1,94 @@ +"============================================================================ +"File: perl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>, +" Eric Harmon <http://eharmon.net> +"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. +" +"============================================================================ +" +" Security: +" +" This checker runs 'perl -c' against your file, which in turn executes +" any BEGIN, UNITCHECK, and CHECK blocks, and any use statements in +" your file. This is probably fine if you wrote the file yourself, +" but it can be a problem if you're trying to check third party files. +" If you are 100% willing to let Vim run the code in your file, set +" g:syntastic_enable_perl_checker to 1 in your vimrc to enable this +" checker: +" +" let g:syntastic_enable_perl_checker = 1 +" +" References: +" +" - http://perldoc.perl.org/perlrun.html#*-c* + +if exists('g:loaded_syntastic_perl_perl_checker') + finish +endif +let g:loaded_syntastic_perl_perl_checker = 1 + +if !exists('g:syntastic_perl_lib_path') + let g:syntastic_perl_lib_path = [] +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_perl_perl_IsAvailable() dict " {{{1 + if !exists('g:syntastic_perl_perl_exec') && exists('g:syntastic_perl_interpreter') + let g:syntastic_perl_perl_exec = g:syntastic_perl_interpreter + endif + + " don't call executable() here, to allow things like + " let g:syntastic_perl_interpreter='/usr/bin/env perl' + silent! call syntastic#util#system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)')) + return v:shell_error == 0 +endfunction " }}}1 + +function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1 + if type(g:syntastic_perl_lib_path) == type('') + call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list') + let includes = split(g:syntastic_perl_lib_path, ',') + else + let includes = copy(syntastic#util#var('perl_lib_path')) + endif + let shebang = syntastic#util#parseShebang() + let extra = join(map(includes, '"-I" . v:val')) . + \ (index(shebang['args'], '-T') >= 0 ? ' -T' : '') . + \ (index(shebang['args'], '-t') >= 0 ? ' -t' : '') + let errorformat = '%f:%l:%m' + + let makeprg = self.makeprgBuild({ 'args_before': '-c -X ' . extra }) + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'perl', + \ 'defaults': {'type': 'E'} }) + if !empty(errors) + return errors + endif + + let makeprg = self.makeprgBuild({ 'args_before': '-c -Mwarnings ' . extra }) + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'perl', + \ 'defaults': {'type': 'W'} }) +endfunction " }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'perl', + \ 'enable': 'enable_perl_checker'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim b/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim new file mode 100644 index 0000000..abe9f43 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: perlcritic.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_perl_perlcritic_checker') + finish +endif +let g:loaded_syntastic_perl_perlcritic_checker = 1 + +if !exists('g:syntastic_perl_perlcritic_thres') + let g:syntastic_perl_perlcritic_thres = 5 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_perl_perlcritic_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"' }) + + let errorformat = '%t:%f:%l:%c:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2], + \ 'subtype': 'Style' }) + + " change error types according to the prescribed threshold + for e in loclist + let e['type'] = e['type'] < g:syntastic_perl_perlcritic_thres ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'perlcritic'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim b/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim new file mode 100644 index 0000000..cad39bd --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: podchecker.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_perl_podchecker_checker') + finish +endif +let g:loaded_syntastic_perl_podchecker_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'podchecker', + \ 'redirect': 'pod/podchecker'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/php/php.vim b/vim/bundle/syntastic/syntax_checkers/php/php.vim new file mode 100644 index 0000000..5b118f6 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/php/php.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: php.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_php_php_checker') + finish +endif +let g:loaded_syntastic_php_php_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_php_php_GetHighlightRegex(item) + let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'") + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_php_php_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '-d error_reporting=E_ALL', + \ 'args_after': '-l -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0' }) + + let errorformat = + \ '%-GNo syntax errors detected in%.%#,'. + \ 'Parse error: %#syntax %trror\, %m in %f on line %l,'. + \ 'Parse %trror: %m in %f on line %l,'. + \ 'Fatal %trror: %m in %f on line %l,'. + \ '%-G\s%#,'. + \ '%-GErrors parsing %.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'php'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim b/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim new file mode 100644 index 0000000..1bd8f98 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: phpcs.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_php_phpcs_checker') + finish +endif +let g:loaded_syntastic_php_phpcs_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_php_phpcs_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--report=csv' }) + + let errorformat = + \ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity%.%#,'. + \ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'phpcs' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/php/phplint.vim b/vim/bundle/syntastic/syntax_checkers/php/phplint.vim new file mode 100644 index 0000000..d04f3ba --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/php/phplint.vim @@ -0,0 +1,91 @@ +"============================================================================ +"File: phplint.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_php_phplint_checker') + finish +endif +let g:loaded_syntastic_php_phplint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_php_phplint_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\m\(class\|function\|method\) \zs\S\+\ze was declared as') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\maccess forbidden to \(private\|protected\) \(class\|constant\|method\|variable\|\(private\|protected\) property\) \zs\S\+\ze') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\musing deprecated \(class\|constant\|method\|property\|variable\) \zs\S\+\ze') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze') + if term !=# '' + return '\V' . escape(term, '\') + endif + let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze') + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_php_phplint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': + \ '--print-file-name ' . + \ '--print-line-numbers ' . + \ '--print-column-number ' . + \ '--print-errors ' . + \ '--print-warnings ' . + \ '--no-print-notices ' . + \ '--no-print-context ' . + \ '--no-print-source ' . + \ '--tab-size ' . &tabstop }) + + let errorformat = + \ '%E%f:%l:%v: %tRROR: %m,' . + \ '%W%f:%l:%v: %tarning: %m,' . + \ '%+C%\t%.%#,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'], + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) + + for e in loclist + let e['text'] = substitute(e['text'], '\m \(Hint\|Examples\):.*', '', '') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'phplint', + \ 'exec': 'phpl' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim b/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim new file mode 100644 index 0000000..5207d3d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim @@ -0,0 +1,77 @@ +"============================================================================ +"File: phpmd.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_php_phpmd_checker') + finish +endif +let g:loaded_syntastic_php_phpmd_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)') + if term !=# '' + return '\V'.substitute(term, '\m\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '') + endif + let term = matchstr(a:item['text'], '\m\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.') + if term !=# '' + return '\V'.substitute(term, '\m\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '') + endif + let term = matchstr(a:item['text'], '\m\C^Avoid using short method names like \S\+::\S\+()\.') + if term !=# '' + return '\V'.substitute(term, '\m\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '') + endif + let term = matchstr(a:item['text'], '\m\C^\S\+ accesses the super-global variable ') + if term !=# '' + return '\V'.substitute(term, '\m\C accesses the super-global variable .*$', '', '') + endif + let term = matchstr(a:item['text'], '\m\C^Constant \S\+ should be defined in uppercase') + if term !=# '' + return '\V'.substitute(term, '\m\C^Constant \(\S\+\) should be defined in uppercase', '\1', '') + endif + let term = matchstr(a:item['text'], "\\m\\C^The '\\S\\+()' method which returns ") + if term !=# '' + return '\V'.substitute(term, "\\m\\C^The '\\(\\S\\+\\)()' method which returns.*", '\1', '') + endif + let term = matchstr(a:item['text'], '\m\C variable \S\+ should begin with ') + if term !=# '' + return '\V'.substitute(term, '\m\C.* variable \(\S\+\) should begin with .*', '\1', '') + endif + let term = matchstr(a:item['text'], "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'") + if term !=# '' + return '\V'.substitute(term, "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '') + endif + return '' +endfunction + +function! SyntaxCheckers_php_phpmd_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'post_args_before': 'text', + \ 'post_args': 'codesize,design,unusedcode,naming' }) + + let errorformat = '%E%f:%l%\s%#%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype' : 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'phpmd'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim b/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim new file mode 100644 index 0000000..1d09733 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: msgfmt.vim +"Description: Syntax checking plugin for po files of gettext +"Maintainer: Ryo Okubo <syucream1031@gmail.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_po_msgfmt_checker') + finish +endif +let g:loaded_syntastic_po_msgfmt_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown') + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_po_msgfmt_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-c ' . syntastic#c#NullOutput() }) + + let errorformat = + \ '%W%f:%l: warning: %m,' . + \ '%E%f:%l:%v: %m,' . + \ '%E%f:%l: %m,' . + \ '%+C %.%#,' . + \ '%Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'po', + \ 'name': 'msgfmt'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim b/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim new file mode 100644 index 0000000..9ef5dca --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: podchecker.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_pod_podchecker_checker') + finish +endif +let g:loaded_syntastic_pod_podchecker_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_pod_podchecker_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' . + \ '%W%[%#]%[%#]%[%#] WARNING: %m at line EOF in file %f,' . + \ '%E%[%#]%[%#]%[%#] ERROR: %m at line %l in file %f,' . + \ '%E%[%#]%[%#]%[%#] ERROR: %m at line EOF in file %f' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1, 2] }) + + for e in loclist + if e['valid'] && e['lnum'] == 0 + let e['lnum'] = str2nr(matchstr(e['text'], '\m\<line \zs\d\+\ze')) + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'pod', + \ 'name': 'podchecker'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim b/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim new file mode 100644 index 0000000..880838e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: pug_lint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Ben Parnell <benjaminparnell.94@gmail.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_pug_pug_lint_checker') + finish +endif +let g:loaded_syntastic_pug_pug_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_pug_pug_lint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-r inline' }) + + let errorformat = '%f:%l:%c %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'pug', + \ 'name': 'pug_lint', + \ 'exec': 'pug-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim b/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim new file mode 100644 index 0000000..83077c7 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: puppet.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Eivind Uggedal <eivind at uggedal 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_puppet_puppet_checker') + finish +endif +let g:loaded_syntastic_puppet_puppet_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_puppet_puppet_GetLocList() dict + if !exists('s:puppet_new') + let s:puppet_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 7, 0]) + endif + + let makeprg = self.makeprgBuild({ + \ 'args_before': (s:puppet_new ? 'parser validate --color=false' : '--color=false --parseonly') }) + + let errorformat = + \ '%-Gerr: Try ''puppet help parser validate'' for usage,' . + \ '%-GError: Try ''puppet help parser validate'' for usage,' . + \ '%A%t%*[a-zA-Z]: %m at %f:%l:%c,' . + \ '%A%t%*[a-zA-Z]: %m at %f:%l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'puppet', + \ 'name': 'puppet'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim b/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim new file mode 100644 index 0000000..a492db6 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: puppetlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Eivind Uggedal <eivind at uggedal 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_puppet_puppetlint_checker') + finish +endif +let g:loaded_syntastic_puppet_puppetlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + let s:puppetlint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1]) + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 2]) +endfunction + +function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict + call syntastic#log#deprecationWarn('puppet_lint_arguments', 'puppet_puppetlint_args') + + let makeprg = self.makeprgBuild({ + \ 'args_after': + \ '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:' . + \ (s:puppetlint_new ? '%{line}' : '%{linenumber}') . '"' }) + + let errorformat = '%t%*[a-zA-Z] %m at %f:%l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'puppet', + \ 'name': 'puppetlint', + \ 'exec': 'puppet-lint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/codec.py b/vim/bundle/syntastic/syntax_checkers/python/codec.py new file mode 100755 index 0000000..6e980c7 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/codec.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +from __future__ import print_function +from sys import argv, exit + +import codecs +import re +import os + + +if len(argv) != 2: + exit(1) + +try: + with open(argv[1]) as fle: + text = fle.readlines() + + if text: + match = re.match(r"#\s*coding\s*:\s*(?P<coding>\w+)", text[0]) + if match: + text = codecs.lookup(match.groupdict()["coding"]).incrementaldecoder().decode( + ''.join(text).encode('utf-8')).encode('utf-8') + + if isinstance(text, list): + text = ''.join(text).encode('utf-8') + + compile(text, argv[1], 'exec', 0, 1) +except SyntaxError as err: + print('%s:%s:%s: %s' % (err.filename, err.lineno, err.offset, err.msg)) +except Exception as err: + print('%s:%s:%s: %s' % (os.path.abspath(argv[1]), 1, 0, err)) diff --git a/vim/bundle/syntastic/syntax_checkers/python/compile.py b/vim/bundle/syntastic/syntax_checkers/python/compile.py new file mode 100755 index 0000000..32f1413 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/compile.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +from __future__ import print_function +from sys import argv, exit + + +if len(argv) != 2: + exit(1) + +try: + compile(open(argv[1]).read(), argv[1], 'exec', 0, 1) +except SyntaxError as err: + print('%s:%s:%s: %s' % (err.filename, err.lineno, err.offset, err.msg)) diff --git a/vim/bundle/syntastic/syntax_checkers/python/flake8.vim b/vim/bundle/syntastic/syntax_checkers/python/flake8.vim new file mode 100644 index 0000000..257b69d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/flake8.vim @@ -0,0 +1,72 @@ +"============================================================================ +"File: flake8.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Sylvain Soliman <Sylvain dot Soliman+git at gmail dot com> +" kstep <me@kstep.me> +" +"============================================================================ + +if exists('g:loaded_syntastic_python_flake8_checker') + finish +endif +let g:loaded_syntastic_python_flake8_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_flake8_GetHighlightRegex(item) + return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:item) +endfunction + +function! SyntaxCheckers_python_flake8_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l: could not compile,%-Z%p^,' . + \ '%A%f:%l:%c: %t%n %m,' . + \ '%A%f:%l: %t%n %m,' . + \ '%-G%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) + + for e in loclist + " E*** and W*** are pep8 errors + " F*** are PyFlakes codes + " C*** are McCabe complexity messages + " N*** are naming conventions from pep8-naming + + if has_key(e, 'nr') + let e['text'] .= printf(' [%s%03d]', e['type'], e['nr']) + " E901 are syntax errors + " E902 are I/O errors + if e['type'] ==? 'E' && e['nr'] !~# '\m^9' + let e['subtype'] = 'Style' + endif + call remove(e, 'nr') + endif + + if e['type'] =~? '\m^[CNW]' + let e['subtype'] = 'Style' + endif + + let e['type'] = e['type'] =~? '\m^[EFC]' ? 'E' : 'W' + endfor + + return loclist +endfunction + +runtime! syntax_checkers/python/pyflakes.vim + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'flake8'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/frosted.vim b/vim/bundle/syntastic/syntax_checkers/python/frosted.vim new file mode 100644 index 0000000..d642795 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/frosted.vim @@ -0,0 +1,63 @@ +"============================================================================ +"File: frosted.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_python_frosted_checker') + finish +endif +let g:loaded_syntastic_python_frosted_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_frosted_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-vb' }) + + let errorformat = + \ '%f:%l:%c:%m,' . + \ '%E%f:%l: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'returns': [0, 1] }) + + for e in loclist + let e['col'] += 1 + + let parts = matchlist(e.text, '\v^([EW]\d+):([^:]*):(.+)') + if len(parts) >= 4 + let e['type'] = parts[1][0] + let e['text'] = parts[3] . ' [' . parts[1] . ']' + let e['hl'] = '\V\<' . escape(parts[2], '\') . '\>' + elseif e['text'] =~? '\v^I\d+:' + let e['valid'] = 0 + else + let e['vcol'] = 0 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'frosted' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/mypy.vim b/vim/bundle/syntastic/syntax_checkers/python/mypy.vim new file mode 100644 index 0000000..19ca1fd --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/mypy.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: mypy.vim +"Description: Syntax checking plugin for syntastic.vim +"Author: Russ Hewgill <Russ dot Hewgill at gmail dot com> +" +"============================================================================ + +if exists('g:loaded_syntastic_python_mypy_checker') + finish +endif +let g:loaded_syntastic_python_mypy_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_mypy_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'type': 'E' }, + \ 'returns': [0, 1], + \ 'preprocess': 'mypy' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'mypy'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pep257.vim b/vim/bundle/syntastic/syntax_checkers/python/pep257.vim new file mode 100644 index 0000000..e59166b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pep257.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: pep257.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_python_pep257_checker') + finish +endif +let g:loaded_syntastic_python_pep257_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pep257', + \ 'redirect': 'python/pydocstyle'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pep8.vim b/vim/bundle/syntastic/syntax_checkers/python/pep8.vim new file mode 100644 index 0000000..80ab980 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pep8.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: pep8.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_python_pep8_checker') + finish +endif +let g:loaded_syntastic_python_pep8_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pep8', + \ 'redirect': 'python/pycodestyle'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/prospector.vim b/vim/bundle/syntastic/syntax_checkers/python/prospector.vim new file mode 100644 index 0000000..c5e4735 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/prospector.vim @@ -0,0 +1,73 @@ +"============================================================================ +"File: prospector.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_python_prospector_checker') + finish +endif +let g:loaded_syntastic_python_prospector_checker = 1 + +if !exists('g:syntastic_python_prospector_sort') + let g:syntastic_python_prospector_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_prospector_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 7]) +endfunction + +function! SyntaxCheckers_python_prospector_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '--messages-only --absolute-paths --die-on-tool-error --zero-exit --output-format json' }) + + let errorformat = '%f:%l:%c: %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'preprocess': 'prospector', + \ 'returns': [0] }) + + for e in loclist + if e['text'] =~# '\v\[%(dodgy|mccabe|pep8|pep257|pyroma)\]$' + let e['subtype'] = 'Style' + endif + + if e['text'] =~# '\v\[pylint\]$' + let e['type'] = e['text'] =~? '\m^[CRW]' ? 'W' : 'E' + elseif e['text'] =~# '\v\[%(frosted|pep8)\]$' + let e['type'] = e['text'] =~? '\m^W' ? 'W' : 'E' + elseif e['text'] =~# '\v\[%(dodgy|pyroma|vulture)\]$' + let e['type'] = 'W' + else + let e['type'] = 'E' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'prospector'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim b/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim new file mode 100644 index 0000000..b0e7771 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: py3kwarn.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Liam Curry <liam@curry.name> +" +"============================================================================ + +if exists('g:loaded_syntastic_python_py3kwarn_checker') + finish +endif +let g:loaded_syntastic_python_py3kwarn_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_py3kwarn_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%W%f:%l:%c: %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'py3kwarn'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim b/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim new file mode 100644 index 0000000..3b1e705 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: pycodestyle.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_python_pycodestyle_checker') + finish +endif +let g:loaded_syntastic_python_pycodestyle_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_pycodestyle_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l:%c: %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'subtype': 'Style' }) + + for e in loclist + let e['type'] = e['text'] =~? '^W' ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pycodestyle'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim b/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim new file mode 100644 index 0000000..05ea6b3 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: pydocstyle.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_python_pydocstyle_checker') + finish +endif +let g:loaded_syntastic_python_pydocstyle_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_pydocstyle_GetLocList() dict + if !exists('s:pydocstyle_new') + let s:pydocstyle_new = syntastic#util#versionIsAtLeast(self.getVersion(), [0, 3]) + endif + + let makeprg = self.makeprgBuild({}) + + if s:pydocstyle_new + let errorformat = + \ '%E%f:%l %.%#:,' . + \ '%+C %m' + else + let errorformat = + \ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' . + \ '%E%f:%l:%c: %m,' . + \ '%+C %m' + endif + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'subtype': 'Style', + \ 'preprocess': 'killEmpty', + \ 'postprocess': ['compressWhitespace'] }) + + if s:pydocstyle_new == 0 + " byte offsets rather than column numbers + for e in loclist + let e['col'] = get(e, 'col', 0) + 1 + endfor + endif + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pydocstyle'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim b/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim new file mode 100644 index 0000000..d403135 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim @@ -0,0 +1,74 @@ +"============================================================================ +"File: pyflakes.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Martin Grenfell <martin.grenfell@gmail.com> +" kstep <me@kstep.me> +" Parantapa Bhattacharya <parantapa@gmail.com> +" +"============================================================================ + +if exists('g:loaded_syntastic_python_pyflakes_checker') + finish +endif +let g:loaded_syntastic_python_pyflakes_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i) + if stridx(a:i['text'], 'is assigned to but never used') >= 0 + \ || stridx(a:i['text'], 'imported but unused') >= 0 + \ || stridx(a:i['text'], 'undefined name') >= 0 + \ || stridx(a:i['text'], 'redefinition of') >= 0 + \ || stridx(a:i['text'], 'referenced before assignment') >= 0 + \ || stridx(a:i['text'], 'duplicate argument') >= 0 + \ || stridx(a:i['text'], 'after other statements') >= 0 + \ || stridx(a:i['text'], 'shadowed by loop variable') >= 0 + + " fun with Python's %r: try "..." first, then '...' + let term = matchstr(a:i['text'], '\m^.\{-}"\zs.\{-1,}\ze"') + if term !=# '' + return '\V\<' . escape(term, '\') . '\>' + endif + + let term = matchstr(a:i['text'], '\m^.\{-}''\zs.\{-1,}\ze''') + if term !=# '' + return '\V\<' . escape(term, '\') . '\>' + endif + endif + return '' +endfunction + +function! SyntaxCheckers_python_pyflakes_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l: could not compile,'. + \ '%-Z%p^,'. + \ '%E%f:%l:%c: %m,'. + \ '%E%f:%l: %m,'. + \ '%-G%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'defaults': {'text': 'Syntax error'} }) + + for e in loclist + let e['vcol'] = 0 + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pyflakes'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pylama.vim b/vim/bundle/syntastic/syntax_checkers/python/pylama.vim new file mode 100644 index 0000000..d4aab0a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pylama.vim @@ -0,0 +1,79 @@ +"============================================================================ +"File: pylama.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_python_pylama_checker') + finish +endif +let g:loaded_syntastic_python_pylama_checker = 1 + +if !exists('g:syntastic_python_pylama_sort') + let g:syntastic_python_pylama_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_python_pylama_GetHighlightRegex(item) + return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:item) +endfunction + +function! SyntaxCheckers_python_pylama_GetLocList() dict + if !exists('s:pylama_new') + let s:pylama_new = syntastic#util#versionIsAtLeast(self.getVersion(), [4]) + endif + + let makeprg = self.makeprgBuild({ + \ 'args_after': '-f pep8' . (s:pylama_new ? ' --force' : '') }) + + " TODO: "WARNING:pylama:..." messages are probably a logging bug + let errorformat = + \ '%-GWARNING:pylama:%.%#,' . + \ '%A%f:%l:%c: %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) + + " adjust for weirdness in each checker + for e in loclist + let e['type'] = e['text'] =~? '\m^[RCW]' ? 'W' : 'E' + if e['text'] =~# '\v\[%(isort|mccabe|pep257|pylint)\]$' + if has_key(e, 'col') + let e['col'] += 1 + endif + endif + if e['text'] =~# '\v\[pylint\]$' + if has_key(e, 'vcol') + let e['vcol'] = 0 + endif + endif + if e['text'] =~# '\v\[%(isort|mccabe|pep257|pep8)\]$' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +runtime! syntax_checkers/python/pyflakes.vim + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pylama' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/pylint.vim b/vim/bundle/syntastic/syntax_checkers/python/pylint.vim new file mode 100644 index 0000000..884d07a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/pylint.vim @@ -0,0 +1,98 @@ +"============================================================================ +"File: pylint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Parantapa Bhattacharya <parantapa at gmail dot com> +" +"============================================================================ + +if exists('g:loaded_syntastic_python_pylint_checker') + finish +endif +let g:loaded_syntastic_python_pylint_checker = 1 + +if !exists('g:syntastic_python_pylint_sort') + let g:syntastic_python_pylint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +let s:pylint_new = -1 + +function! SyntaxCheckers_python_pylint_IsAvailable() dict " {{{1 + if !executable(self.getExec()) + return 0 + endif + + try + " On Windows the version is shown as "pylint-script.py 1.0.0". + " On Gentoo Linux it's "pylint-python2.7 0.28.0". + " On NixOS, that would be ".pylint-wrapped 0.26.0". + " On Arch Linux it's "pylint2 1.1.0". + " On new-ish Fedora it's "python3-pylint 1.2.0". + " Have you guys considered switching to creative writing yet? ;) + + let version_output = syntastic#util#system(self.getExecEscaped() . ' --version') + let pylint_version = filter( split(version_output, '\m, \=\|\n'), 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0] + let parsed_ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', '')) + call self.setVersion(parsed_ver) + + let s:pylint_new = syntastic#util#versionIsAtLeast(parsed_ver, [1]) + catch /\m^Vim\%((\a\+)\)\=:E684/ + call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1)) + call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)") + let s:pylint_new = -1 + endtry + + return s:pylint_new >= 0 +endfunction " }}}1 + +function! SyntaxCheckers_python_pylint_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ + \ 'args_after': (s:pylint_new ? + \ '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' : + \ '-f parseable -r n -i y') }) + + let errorformat = + \ '%A%f:%l:%c:%t: %m,' . + \ '%A%f:%l: %m,' . + \ '%A%f:(%l): %m,' . + \ '%-Z%p^%.%#,' . + \ '%-G%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'returns': range(32) }) + + for e in loclist + if !s:pylint_new + let e['type'] = e['text'][1] + endif + + if e['type'] =~? '\m^[EF]' + let e['type'] = 'E' + elseif e['type'] =~? '\m^[CRW]' + let e['type'] = 'W' + else + let e['valid'] = 0 + endif + + let e['col'] += 1 + let e['vcol'] = 0 + endfor + + return loclist +endfunction " }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pylint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/python/python.vim b/vim/bundle/syntastic/syntax_checkers/python/python.vim new file mode 100644 index 0000000..17ad2c9 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/python/python.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: python.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_python_python_checker') + finish +endif +let g:loaded_syntastic_python_python_checker = 1 + +if !exists('g:syntastic_python_python_use_codec') + let g:syntastic_python_python_use_codec = 0 +endif + +let s:save_cpo = &cpo +set cpo&vim + +let s:base_path = expand('<sfile>:p:h', 1) . syntastic#util#Slash() + +function! SyntaxCheckers_python_python_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6]) +endfunction + +function! SyntaxCheckers_python_python_GetLocList() dict + let compiler = s:base_path . (g:syntastic_python_python_use_codec ? 'codec.py' : 'compile.py') + call self.log('using compiler script', compiler) + let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), compiler] }) + + let errorformat = '%E%f:%l:%c: %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'returns': [0] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'python'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim b/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim new file mode 100644 index 0000000..0aef61c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: qmllint.vim +"Description: Syntax checking plugin for syntastic.vim using qmllint +"Maintainer: Peter Wu <peter@lekensteyn.nl> +"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_qml_qmllint_checker') + finish +endif +let g:loaded_syntastic_qml_qmllint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_qml_qmllint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l : %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'], + \ 'returns': [0, 255] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'qml', + \ 'name': 'qmllint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/r/lint.vim b/vim/bundle/syntastic/syntax_checkers/r/lint.vim new file mode 100644 index 0000000..854c170 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/r/lint.vim @@ -0,0 +1,82 @@ +"============================================================================ +"File: lint.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_r_lint_checker') + finish +endif +let g:loaded_syntastic_r_lint_checker = 1 + +if !exists('g:syntastic_r_lint_styles') + let g:syntastic_r_lint_styles = 'lint.style' +endif + +if !exists('g:syntastic_r_lint_sort') + let g:syntastic_r_lint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_r_lint_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m`\zs[^`]\+\ze`') + if term ==# '' + let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'") + endif + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_r_lint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)')) + return v:shell_error == 0 +endfunction + +function! SyntaxCheckers_r_lint_GetLocList() dict + let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : '' + let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' . + \ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' . + \ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') . + \ ' --args ' . syntastic#util#shexpand('%') + + let errorformat = + \ '%t:%f:%l:%v: %m,' . + \ '%t:%f:%l: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'preprocess': 'rparse', + \ 'returns': [0] }) + + for e in loclist + if e['type'] ==? 'F' + " parse error + let e['type'] = 'E' + call remove(e, 'subtype') + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'r', + \ 'name': 'lint', + \ 'exec': 'R' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/r/lintr.vim b/vim/bundle/syntastic/syntax_checkers/r/lintr.vim new file mode 100644 index 0000000..7c71ec0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/r/lintr.vim @@ -0,0 +1,81 @@ +"============================================================================ +"File: lintr.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jim Hester <james.f.hester 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. +" +"============================================================================ +" +" Security: +" +" This checker runs the code in your file. This is probably fine if you +" wrote the file yourself, but it can be a problem if you're trying to +" check third party files. If you are 100% willing to let Vim run the +" code in your file, set g:syntastic_enable_r_lintr_checker to 1 in +" your vimrc to enable this checker: +" +" let g:syntastic_enable_r_lintr_checker = 1 + +if exists("g:loaded_syntastic_r_lintr_checker") + finish +endif +let g:loaded_syntastic_r_lintr_checker = 1 + +if !exists('g:syntastic_r_lintr_linters') + let g:syntastic_r_lintr_linters = 'default_linters' +endif + +if !exists('g:syntastic_r_lintr_cache') + let g:syntastic_r_lintr_cache = 'FALSE' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_r_lintr_GetHighlightRegex(item) + let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'") + return term != '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_r_lintr_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + call system(self.getExecEscaped() . ' --slave --no-restore --no-save -e ' . syntastic#util#shescape('library(lintr)')) + return v:shell_error == 0 +endfunction + +function! SyntaxCheckers_r_lintr_GetLocList() dict + let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : '' + let makeprg = self.getExecEscaped() . ' --slave --no-restore --no-save' . + \ ' -e ' . syntastic#util#shescape(setwd . 'suppressPackageStartupMessages(library(lintr)); ' . + \ 'lint(cache = ' . g:syntastic_r_lintr_cache . ', commandArgs(TRUE), ' . g:syntastic_r_lintr_linters . ')') . + \ ' --args ' . syntastic#util#shexpand('%') + + let errorformat = + \ '%W%f:%l:%c: style: %m,' . + \ '%W%f:%l:%c: warning: %m,' . + \ '%E%f:%l:%c: error: %m,' + + call self.setWantSort(1) + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'r', + \ 'name': 'lintr', + \ 'exec': 'R', + \ 'enable': 'enable_r_lintr_checker'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/r/svtools.vim b/vim/bundle/syntastic/syntax_checkers/r/svtools.vim new file mode 100644 index 0000000..d2a6a74 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/r/svtools.vim @@ -0,0 +1,74 @@ +"============================================================================ +"File: svtools.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. +" +"============================================================================ +" +" Security: +" +" This checker runs the code in your file. This is probably fine if you +" wrote the file yourself, but it can be a problem if you're trying to +" check third party files. If you are 100% willing to let Vim run the +" code in your file, set g:syntastic_enable_r_svtools_checker to 1 in +" your vimrc to enable this checker: +" +" let g:syntastic_enable_r_svtools_checker = 1 + +if exists('g:loaded_syntastic_r_svtools_checker') + finish +endif +let g:loaded_syntastic_r_svtools_checker = 1 + +if !exists('g:syntastic_r_svtools_styles') + let g:syntastic_r_svtools_styles = 'lint.style' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_r_svtools_GetHighlightRegex(item) + let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'") + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_r_svtools_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)')) + return v:shell_error == 0 +endfunction + +function! SyntaxCheckers_r_svtools_GetLocList() dict + let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : '' + let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' . + \ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' . + \ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') . + \ ' --args ' . syntastic#util#shexpand('%') + + let errorformat = + \ '%trror:%f:%\s%#%l:%\s%#%v:%m,' . + \ '%tarning:%f:%\s%#%l:%\s%#%v:%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'r', + \ 'name': 'svtools', + \ 'exec': 'R', + \ 'enable': 'enable_r_svtools_checker'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim b/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim new file mode 100644 index 0000000..14463c4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim @@ -0,0 +1,62 @@ +"============================================================================ +"File: code-ayatollah.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_racket_code_ayatollah_checker') + finish +endif +let g:loaded_syntastic_racket_code_ayatollah_checker = 1 + +if !exists('g:syntastic_racket_code_ayatollah_script') + let g:syntastic_racket_code_ayatollah_script = 'code-ayatollah.rkt' +endif + +if !exists('g:syntastic_racket_code_ayatollah_sort') + let g:syntastic_racket_code_ayatollah_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_racket_code_ayatollah_IsAvailable() dict + let s:script = expand(g:syntastic_racket_code_ayatollah_script, 1) + return executable(self.getExec()) && filereadable(s:script) +endfunction + +function! SyntaxCheckers_racket_code_ayatollah_GetLocList() dict + let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), s:script] }) + + let errorformat = + \ ' %l:%v: %m,' . + \ '%PErrors in %f:,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) + + for e in loclist + let e['col'] += 1 + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'racket', + \ 'name': 'code_ayatollah', + \ 'exec': 'racket' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/racket/racket.vim b/vim/bundle/syntastic/syntax_checkers/racket/racket.vim new file mode 100644 index 0000000..b563a5b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/racket/racket.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: racket.vim +"Description: Syntax checking plugin for syntastic.vim +"Author: 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_racket_racket_checker') + finish +endif +let g:loaded_syntastic_racket_racket_checker=1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_racket_racket_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + " example of error message + "eval-apply.rkt:460:30: the-empty-environment: unbound identifier in module + " in: the-empty-environment + let errorformat = '%f:%l:%v: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for e in loclist + if has_key(e, 'col') + let e['col'] += 1 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'racket', + \ 'name': 'racket', + \ 'enable': 'enable_racket_racket_checker' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim b/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim new file mode 100644 index 0000000..dcc235f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: lintr.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jim Hester <james.f.hester 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_rmd_lintr_checker') + finish +endif +let g:loaded_syntastic_rmd_lintr_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rmd', + \ 'name': 'lintr', + \ 'redirect': 'r/lintr'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim b/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim new file mode 100644 index 0000000..848d60c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: rnv.vim +"Description: RelaxNG RNV syntax checking plugin for syntastic.vim +"Maintainer: Remko Tronçon <remko at el-tramo dot be> +"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_rnc_rnv_checker') + finish +endif +let g:loaded_syntastic_rnc_rnv_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_rnc_rnv_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-c' }) + + let errorformat = + \ '%f:%l:%c: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rnc', + \ 'name': 'rnv'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim b/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim new file mode 100644 index 0000000..532c75c --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: rst.vim +"Description: Syntax checking plugin for docutils' reStructuredText files +"Maintainer: James Rowe <jnrowe 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. +" +"============================================================================ + +" We use rst2pseudoxml.py, as it is ever so marginally faster than the other +" rst2${x} tools in docutils. + +if exists('g:loaded_syntastic_rst_rst2pseudoxml_checker') + finish +endif +let g:loaded_syntastic_rst_rst2pseudoxml_checker = 1 + +let s:rst2pseudoxml = (executable('rst2pseudoxml.py') && !syntastic#util#isRunningWindows()) ? 'rst2pseudoxml.py' : 'rst2pseudoxml' + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() dict + call self.log('exec =', self.getExec()) + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '--report=2 --exit-status=1', + \ 'tail': syntastic#util#DevNull() }) + + let errorformat = + \ '%f:%l: (%t%\w%\+/%\d%\+) %m,'. + \ '%f:: (%t%\w%\+/%\d%\+) %m,'. + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for e in loclist + if e['type'] ==? 'I' + let e['type'] = 'W' + let e['subtype'] = 'Style' + else + let e['type'] = 'E' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rst', + \ 'name': 'rst2pseudoxml', + \ 'exec': s:rst2pseudoxml }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim b/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim new file mode 100644 index 0000000..3c3b8c4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: rstcheck.vim +"Description: Syntax checking for reStructuredText and embedded code blocks +"Authors: Steven Myint <git@stevenmyint.com> +" +"============================================================================ + +if exists('g:loaded_syntastic_rst_rstcheck_checker') + finish +endif +let g:loaded_syntastic_rst_rstcheck_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_rst_rstcheck_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%f:%l: (%tNFO/1) %m,'. + \ '%f:%l: (%tARNING/2) %m,'. + \ '%f:%l: (%tRROR/3) %m,'. + \ '%f:%l: (%tEVERE/4) %m,'. + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) + + for e in loclist + if e['type'] ==? 'S' + let e['type'] = 'E' + elseif e['type'] ==? 'I' + let e['type'] = 'W' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rst', + \ 'name': 'rstcheck'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim b/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim new file mode 100644 index 0000000..3c211f4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim @@ -0,0 +1,80 @@ +"============================================================================ +"File: sphinx.vim +"Description: Syntax checking plugin for Sphinx reStructuredText files +"Maintainer: Buck Evan <buck dot 2019 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_rst_sphinx_checker") + finish +endif +let g:loaded_syntastic_rst_sphinx_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +let s:sphinx_cache_location = syntastic#util#tmpdir() +lockvar s:sphinx_cache_location + +augroup syntastic + autocmd VimLeave * call syntastic#util#rmrf(s:sphinx_cache_location) +augroup END + +function! SyntaxCheckers_rst_sphinx_GetLocList() dict + + let srcdir = syntastic#util#var('rst_sphinx_source_dir') + call self.log('g:syntastic_rst_sphinx_source_dir =', srcdir) + if srcdir ==# '' + let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1)) + if config ==# '' || !filereadable(config) + call self.log('conf.py file not found') + return [] + endif + let srcdir = fnamemodify(config, ':p:h') + endif + + let confdir = syntastic#util#var('rst_sphinx_config_dir') + call self.log('g:syntastic_rst_sphinx_config_dir =', confdir) + if confdir ==# '' + let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1)) + let confdir = (config !=# '' && filereadable(config)) ? fnamemodify(config, ':p:h') : srcdir + endif + + let makeprg = self.makeprgBuild({ + \ 'args': '-n -E', + \ 'args_after': '-q -N -b pseudoxml -c ' . syntastic#util#shescape(confdir), + \ 'fname': syntastic#util#shescape(srcdir), + \ 'fname_after': syntastic#util#shescape(s:sphinx_cache_location) }) + + let errorformat = + \ '%E%f:%l: SEVER%t: %m,' . + \ '%f:%l: %tRROR: %m,' . + \ '%f:%l: %tARNING: %m,' . + \ '%E%f:: SEVER%t: %m,' . + \ '%f:: %tRROR: %m,' . + \ '%f:: %tARNING: %m,' . + \ '%trror: %m,' . + \ '%+C%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0] }) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rst', + \ 'name': 'sphinx', + \ 'exec': 'sphinx-build' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim b/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim new file mode 100644 index 0000000..127cdbd --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim @@ -0,0 +1,72 @@ +"============================================================================ +"File: flog.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Tim Carry <tim at pixelastic 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_ruby_flog_checker') + finish +endif +let g:loaded_syntastic_ruby_flog_checker = 1 + +if !exists('g:syntastic_ruby_flog_threshold_warning') + let g:syntastic_ruby_flog_threshold_warning = 45 +endif + +if !exists('g:syntastic_ruby_flog_threshold_error') + let g:syntastic_ruby_flog_threshold_error = 90 +endif + +if !exists('g:syntastic_ruby_flog_sort') + let g:syntastic_ruby_flog_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_flog_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-a' }) + + " Example output: + " 93.25: MyClass::my_method my_file:42 + let errorformat = '%\m%\s%#%m: %.%# %f:%l' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) + + let trail_w = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_warning) . ')' + let trail_e = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_error) . ')' + for e in loclist + let score = syntastic#util#str2float(e['text']) + + let e['text'] = 'Complexity is too high (' . syntastic#util#float2str(score) . '/' + if score < g:syntastic_ruby_flog_threshold_warning + let e['valid'] = 0 + elseif score < g:syntastic_ruby_flog_threshold_error + let e['type'] = 'W' + let e['text'] .= trail_w + else + let e['type'] = 'E' + let e['text'] .= trail_e + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'flog'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim b/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim new file mode 100644 index 0000000..d9d2aee --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: jruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Leonid Shevtsov <leonid at shevtsov dot me> +"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_ruby_jruby_checker') + finish +endif +let g:loaded_syntastic_ruby_jruby_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_jruby_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': (syntastic#util#isRunningWindows() ? '-T1 -W1' : '-W1'), + \ 'args_after': '-c' }) + + let errorformat = + \ '%-GSyntax OK for %f,'. + \ '%ESyntaxError in %f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'jruby'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim b/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim new file mode 100644 index 0000000..c51188f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim @@ -0,0 +1,49 @@ +"============================================================================ +"File: macruby.vim +"Description: Syntax checking plugin for syntastic.vim +"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_ruby_macruby_checker') + finish +endif +let g:loaded_syntastic_ruby_macruby_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_macruby_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '-W1', + \ 'args_after': '-c' }) + + let errorformat = + \ '%-GSyntax OK,'. + \ '%E%f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + let env = { 'RUBYOPT': '' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'macruby'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim b/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim new file mode 100644 index 0000000..563ed4f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim @@ -0,0 +1,82 @@ +"============================================================================ +"File: mri.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_ruby_mri_checker') + finish +endif +let g:loaded_syntastic_ruby_mri_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_mri_IsAvailable() dict + if !exists('g:syntastic_ruby_mri_exec') && exists('g:syntastic_ruby_exec') + let g:syntastic_ruby_mri_exec = g:syntastic_ruby_exec + call self.log('g:syntastic_ruby_exec =', g:syntastic_ruby_exec) + endif + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i) + if stridx(a:i['text'], 'assigned but unused variable') >= 0 + let term = split(a:i['text'], ' - ')[1] + return '\V\<' . escape(term, '\') . '\>' + endif + + return '' +endfunction + +function! SyntaxCheckers_ruby_mri_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '-w -T1', + \ 'args_after': '-c' }) + + "this is a hack to filter out a repeated useless warning in rspec files + "containing lines like + " + " foo.should == 'bar' + " + "Which always generate the warning below. Note that ruby >= 1.9.3 includes + "the word "possibly" in the warning + let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of == in void context,' + + " filter out lines starting with ... + " long lines are truncated and wrapped in ... %p then returns the wrong + " column offset + let errorformat .= '%-G%\%.%\%.%\%.%.%#,' + + let errorformat .= + \ '%-GSyntax OK,'. + \ '%E%f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' } + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'mri', + \ 'exec': 'ruby'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim b/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim new file mode 100644 index 0000000..d9a564a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: reek.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Mindaugas Mozūras +"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_ruby_reek_checker') + finish +endif +let g:loaded_syntastic_ruby_reek_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_reek_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 3, 0]) +endfunction + +function! SyntaxCheckers_ruby_reek_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_before': '--no-color --line-number --single-line' }) + + let errorformat = + \ '%E%.%#: Racc::ParseError: %f:%l :: %m,' . + \ '%W%f:%l: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2] }) + + for e in loclist + if e['type'] ==? 'W' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'reek'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim b/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim new file mode 100644 index 0000000..56f54bf --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: rubocop.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Recai Oktaş <roktas@bil.omu.edu.tr> +"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_ruby_rubocop_checker') + finish +endif +let g:loaded_syntastic_ruby_rubocop_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12, 0]) +endfunction + +function! SyntaxCheckers_ruby_rubocop_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '--format emacs' }) + + let errorformat = '%f:%l:%c: %t: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style'}) + + " convert rubocop severities to error types recognized by syntastic + for e in loclist + if e['type'] ==# 'F' + let e['type'] = 'E' + elseif e['type'] !=# 'W' && e['type'] !=# 'E' + let e['type'] = 'W' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'rubocop'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim b/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim new file mode 100644 index 0000000..2e74f87 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: rubylint.vim +"Description: Checks Ruby source code using ruby-lint +"Maintainer: Yorick Peterse <yorickpeterse@gmail.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_ruby_rubylint_checker') + finish +endif + +let g:loaded_syntastic_ruby_rubylint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_ruby_rubylint_GetLocList() dict + if !exists('s:rubylint_new') + let s:rubylint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2]) + endif + let makeprg = self.makeprgBuild({ + \ 'args': (s:rubylint_new ? '' : 'analyze '), + \ 'args_after': '--presenter=syntastic' }) + + let errorformat = '%f:%t:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'rubylint', + \ 'exec': 'ruby-lint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sass.vim b/vim/bundle/syntastic/syntax_checkers/sass/sass.vim new file mode 100644 index 0000000..5f6194f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sass/sass.vim @@ -0,0 +1,84 @@ +"============================================================================ +"File: sass.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_sass_sass_checker') + finish +endif +let g:loaded_syntastic_sass_sass_checker = 1 + +"sass caching for large files drastically speeds up the checking, but store it +"in a temp location otherwise sass puts .sass_cache dirs in the users project +let s:sass_cache_location = syntastic#util#tmpdir() +lockvar s:sass_cache_location + +augroup syntastic + autocmd VimLeave * call syntastic#util#rmrf(s:sass_cache_location) +augroup END + +"By default do not check partials as unknown variables are a syntax error +if !exists('g:syntastic_sass_check_partials') + let g:syntastic_sass_check_partials = 0 +endif + +"use compass imports if available +let s:imports = '' +if executable('compass') + let s:imports = '--compass' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sass_sass_GetLocList() dict + if !g:syntastic_sass_check_partials && expand('%:t', 1)[0] ==# '_' + return [] + endif + + let makeprg = self.makeprgBuild({ + \ 'args_before': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check' }) + + let errorformat = + \ '%E%\m%\%%(Syntax %\)%\?%trror: %m,' . + \ '%+C %.%#,' . + \ '%C on line %l of %f\, %.%#,' . + \ '%C on line %l of %f,' . + \ '%-G %\+from line %.%#,' . + \ '%-G %\+Use --trace for backtrace.,' . + \ '%W%>DEPRECATION WARNING on line %l of %f:,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING: on line %l of %f:,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING on line %l of %f: %m,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING on line %l of %f:,' . + \ '%Z%m,' . + \ '%W%>WARNING: %m,' . + \ '%C on line %l of %f\, %.%#,' . + \ '%C on line %l of %f,' . + \ '%-G %\+from line %.%#,' . + \ 'Syntax %trror on line %l: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sass', + \ 'name': 'sass'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim b/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim new file mode 100644 index 0000000..e87da29 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: sass_lint.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_sass_sass_lint_checker') + finish +endif +let g:loaded_syntastic_sass_sass_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sass_sass_lint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5]) +endfunction + +function! SyntaxCheckers_sass_sass_lint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '-v', + \ 'args_after': '-q -f compact' }) + + let errorformat = + \ '%f: line %l\, col %c\, %trror - %m,' . + \ '%f: line %l\, col %c\, %tarning - %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sass', + \ 'name': 'sass_lint', + \ 'exec': 'sass-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim b/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim new file mode 100644 index 0000000..699e04e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: sassc.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_sass_sassc_checker') + finish +endif +let g:loaded_syntastic_sass_sassc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sass_sassc_GetLocList() dict + let makeprg = self.makeprgBuild({ 'fname_after': syntastic#util#DevNull() }) + + let errorformat = '%f:%l: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sass', + \ 'name': 'sassc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim b/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim new file mode 100644 index 0000000..25d6a4d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: fsc.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_scala_fsc_checker') + finish +endif +let g:loaded_syntastic_scala_fsc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_scala_fsc_GetLocList() dict + call syntastic#log#deprecationWarn('scala_options', 'scala_fsc_args') + + " fsc has some serious problems with the + " working directory changing after being started + " that's why we better pass an absolute path + let makeprg = self.makeprgBuild({ + \ 'args_after': '-Ystop-after:parser', + \ 'fname': syntastic#util#shexpand('%:p') }) + + let errorformat = + \ '%E%f:%l: %trror: %m,' . + \ '%Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scala', + \ 'name': 'fsc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim b/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim new file mode 100644 index 0000000..854876b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: scala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Rickey Visinski <rickeyvisinski 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_scala_scalac_checker') + finish +endif +let g:loaded_syntastic_scala_scalac_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_scala_scalac_GetLocList() dict + call syntastic#log#deprecationWarn('scala_options', 'scala_scalac_args') + + let makeprg = self.makeprgBuild({ 'args_after': '-Ystop-after:parser' }) + + let errorformat = + \ '%E%f:%l: %trror: %m,' . + \ '%Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scala', + \ 'name': 'scalac'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim b/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim new file mode 100644 index 0000000..60d2163 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim @@ -0,0 +1,77 @@ +"============================================================================ +"File: scalastyle.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_scala_scalastyle_checker') + finish +endif +let g:loaded_syntastic_scala_scalastyle_checker = 1 + +if !exists('g:syntastic_scala_scalastyle_jar') + let g:syntastic_scala_scalastyle_jar = 'scalastyle-batch_2.10.jar' +endif + +if !exists('g:syntastic_scala_scalastyle_config_file') + let g:syntastic_scala_scalastyle_config_file = 'scalastyle_config.xml' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_scala_scalastyle_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + + let jar = expand(g:syntastic_scala_scalastyle_jar, 1) + let conf_file = expand(g:syntastic_scala_scalastyle_config_file, 1) + call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar) . ', ' . + \ 'filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file)) + + return filereadable(jar) && filereadable(conf_file) +endfunction + +function! SyntaxCheckers_scala_scalastyle_GetLocList() dict + + let makeprg = self.makeprgBuild({ + \ 'exe_after': ['-jar', expand(g:syntastic_scala_scalastyle_jar, 1)], + \ 'args_before': ['-c', expand(g:syntastic_scala_scalastyle_config_file, 1)] }) + + let errorformat = + \ '%trror file=%f message=%m line=%l column=%c,' . + \ '%trror file=%f message=%m line=%l,' . + \ '%tarning file=%f message=%m line=%l column=%c,' . + \ '%tarning file=%f message=%m line=%l' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) + + for e in loclist + if has_key(e, 'col') + let e['col'] += 1 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scala', + \ 'name': 'scalastyle', + \ 'exec': 'java'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim new file mode 100644 index 0000000..04a1fec --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim @@ -0,0 +1,22 @@ +"============================================================================ +"File: mixedindentlint.vim +"Description: Mixed indentation linter for vim +"Maintainer: Payton Swick <payton@foolord.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_scss_mixedindentlint_checker') + finish +endif +let g:loaded_syntastic_scss_mixedindentlint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'mixedindentlint', + \ 'redirect': 'javascript/mixedindentlint'}) + +" vim: set et sts=4 sw=4: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sass.vim b/vim/bundle/syntastic/syntax_checkers/scss/sass.vim new file mode 100644 index 0000000..3df8c80 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/sass.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: scss.vim +"Description: scss syntax checking plugin for syntastic +"Maintainer: Martin Grenfell <martin.grenfell 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_scss_sass_checker') + finish +endif +let g:loaded_syntastic_scss_sass_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'sass', + \ 'redirect': 'sass/sass'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim b/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim new file mode 100644 index 0000000..c50dac4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: sass_lint.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_scss_sass_lint_checker') + finish +endif +let g:loaded_syntastic_scss_sass_lint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'sass_lint', + \ 'redirect': 'sass/sass_lint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim b/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim new file mode 100644 index 0000000..f1b2372 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: sassc.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_scss_sassc_checker') + finish +endif +let g:loaded_syntastic_scss_sassc_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'sassc', + \ 'redirect': 'sass/sassc'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim b/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim new file mode 100644 index 0000000..c0f921a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim @@ -0,0 +1,64 @@ +"============================================================================ +"File: scss_lint.vim +"Description: SCSS style and syntax checker plugin for Syntastic +"Maintainer: Shane da Silva <shane@dasilva.io> +"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_scss_scss_lint_checker') + finish +endif +let g:loaded_syntastic_scss_scss_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 29]) +endfunction + +function! SyntaxCheckers_scss_scss_lint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-f JSON' }) + + let errorformat = '%f:%t:%l:%c:%n:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'scss_lint', + \ 'postprocess': ['guards'], + \ 'returns': [0, 1, 2, 65, 66] }) + + let cutoff = strlen('Syntax Error: ') + for e in loclist + if e['nr'] > 1 + let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['col'] + e['nr']) . 'c' + endif + let e['nr'] = 0 + + if e['text'][: cutoff-1] ==# 'Syntax Error: ' + let e['text'] = e['text'][cutoff :] + else + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'scss_lint', + \ 'exec': 'scss-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim b/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim new file mode 100644 index 0000000..1962916 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: stylelint.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_scss_stylelint_checker') + finish +endif +let g:loaded_syntastic_scss_stylelint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'stylelint', + \ 'redirect': 'css/stylelint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim b/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim new file mode 100644 index 0000000..c7888ad --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: bashate.vim +"Description: Bash script style checking plugin for syntastic.vim +"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_sh_bashate_checker') + finish +endif +let g:loaded_syntastic_sh_bashate_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sh_bashate_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%EE%n: %m,' . + \ '%Z - %f%\s%\+: L%l,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) + + for e in loclist + let e['text'] = substitute(e['text'], "\\m: '.*", '', '') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'bashate' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim b/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim new file mode 100644 index 0000000..2ed0717 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: checkbashisms.vim +"Description: Shell script syntax/style checking plugin for syntastic.vim +"Notes: checkbashisms.pl can be downloaded from +" http://debian.inode.at/debian/pool/main/d/devscripts/ +" as part of the devscripts package. +"============================================================================ + +if exists('g:loaded_syntastic_sh_checkbashisms_checker') + finish +endif +let g:loaded_syntastic_sh_checkbashisms_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sh_checkbashisms_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-fx' }) + + let errorformat = + \ '%-Gscript %f is already a bash script; skipping,' . + \ '%Eerror: %f: %m\, opened in line %l,' . + \ '%Eerror: %f: %m,' . + \ '%Ecannot open script %f for reading: %m,' . + \ '%Wscript %f %m,%C%.# lines,' . + \ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'checkbashisms' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sh/sh.vim b/vim/bundle/syntastic/syntax_checkers/sh/sh.vim new file mode 100644 index 0000000..395b81b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sh/sh.vim @@ -0,0 +1,93 @@ +"============================================================================ +"File: sh.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_sh_sh_checker') + finish +endif +let g:loaded_syntastic_sh_sh_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sh_sh_IsAvailable() dict " {{{1 + call self.log('shell =', s:GetShell()) + return s:IsShellValid() +endfunction " }}}1 + +function! SyntaxCheckers_sh_sh_GetLocList() dict " {{{1 + if s:GetShell() ==# 'zsh' + return s:ForwardToZshChecker() + endif + + if !s:IsShellValid() + return [] + endif + + let makeprg = self.makeprgBuild({ + \ 'exe': s:GetShell(), + \ 'args_after': '-n' }) + + let errorformat = '%f: line %l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetShell() " {{{2 + if !exists('b:shell') || b:shell ==# '' + let b:shell = '' + let shebang = syntastic#util#parseShebang()['exe'] + if shebang !=# '' + if shebang[-strlen('bash'):-1] ==# 'bash' + let b:shell = 'bash' + elseif shebang[-strlen('zsh'):-1] ==# 'zsh' + let b:shell = 'zsh' + elseif shebang[-strlen('sh'):-1] ==# 'sh' + let b:shell = 'sh' + endif + endif + " try to use env variable in case no shebang could be found + if b:shell ==# '' + let b:shell = fnamemodify($SHELL, ':t') + endif + endif + return b:shell +endfunction " }}}2 + +function! s:IsShellValid() " {{{2 + let shell = s:GetShell() + return shell !=# '' && executable(shell) +endfunction " }}}2 + +function! s:ForwardToZshChecker() " {{{2 + let registry = g:SyntasticRegistry.Instance() + let zsh_checkers = registry.getCheckersAvailable('zsh', ['zsh']) + if !empty(zsh_checkers) + return zsh_checkers[0].getLocListRaw() + else + return [] + endif +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'sh' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim b/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim new file mode 100644 index 0000000..5189e19 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: shellcheck.vim +"Description: Shell script syntax/style checking plugin for syntastic.vim +"============================================================================ + +if exists('g:loaded_syntastic_sh_shellcheck_checker') + finish +endif +let g:loaded_syntastic_sh_shellcheck_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sh_shellcheck_GetLocList() dict " {{{1 + let makeprg = self.makeprgBuild({ + \ 'args': s:GetShell(), + \ 'args_after': '-f gcc' }) + + let errorformat = + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %tote: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) + + for e in loclist + if e['type'] ==? 'n' + let e['type'] = 'w' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetShell() " {{{2 + let sh = '' + + if syntastic#util#parseShebang()['exe'] ==# '' + if syntastic#util#rawVar('is_kornshell', 0) || syntastic#util#rawVar('is_posix', 0) + let sh = 'ksh' + elseif syntastic#util#rawVar('is_bash', 0) + let sh = 'bash' + elseif syntastic#util#rawVar('is_sh', 0) + let sh = 'sh' + endif + endif + + return sh !=# '' ? '-s ' . sh : '' +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'shellcheck' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim b/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim new file mode 100644 index 0000000..f387971 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: slim_lint.vim +"Description: Slim style and syntax checker plugin for Syntastic +"Maintainer: Vasily Kolesnikov <re.vkolesnikov@gmail.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_slim_slim_lint_checker') + finish +endif +let g:loaded_syntastic_slim_slim_lint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_slim_slim_lint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l [%t] %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style'}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'slim', + \ 'name': 'slim_lint', + \ 'exec': 'slim-lint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim b/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim new file mode 100644 index 0000000..80bac05 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: slim.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_slim_slimrb_checker') + finish +endif +let g:loaded_syntastic_slim_slimrb_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_slim_slimrb_GetLocList() dict + if !exists('s:slimrb_new') + let ver = self.getVersion(self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull()) + let s:slimrb_new = syntastic#util#versionIsAtLeast(ver, [1, 3, 1]) + endif + + let makeprg = self.makeprgBuild({ 'args_after': '-c' }) + + if s:slimrb_new + let errorformat = + \ '%C %#%f\, Line %l\, Column %c,'. + \ '%-G %.%#,'. + \ '%ESlim::Parser::SyntaxError: %m,'. + \ '%+C%.%#' + else + let errorformat = + \ '%C %#%f\, Line %l,'. + \ '%-G %.%#,'. + \ '%ESlim::Parser::SyntaxError: %m,'. + \ '%+C%.%#' + endif + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'slim', + \ 'name': 'slimrb'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim b/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim new file mode 100644 index 0000000..8b29db4 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: smlnj.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_sml_smlnj_checker') + finish +endif +let g:loaded_syntastic_sml_smlnj_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sml_smlnj_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l%\%.%c %trror: %m,' . + \ '%E%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %trror: %m,' . + \ '%W%f:%l%\%.%c %tarning: %m,' . + \ '%W%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %tarning: %m,' . + \ '%C%\s%\+%m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'], + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sml', + \ 'name': 'smlnj', + \ 'exec': 'sml'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim b/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim new file mode 100644 index 0000000..7e9431b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: rpmlint.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_spec_rpmlint_checker') + finish +endif +let g:loaded_syntastic_spec_rpmlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_spec_rpmlint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l: E: %m,' . + \ '%E%f: E: %m,' . + \ '%W%f:%l: W: %m,' . + \ '%W%f: W: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'spec', + \ 'name': 'rpmlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim b/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim new file mode 100644 index 0000000..1e1eea5 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: sqlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Steve Purcell <steve@sanityinc.com> +"License: MIT +"============================================================================ + +if exists('g:loaded_syntastic_sql_sqlint_checker') + finish +endif +let g:loaded_syntastic_sql_sqlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sql_sqlint_GetHighlightRegex(i) + let term = matchstr(a:i['text'], '\m at or near "\zs[^"]\+\ze"') + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_sql_sqlint_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 0, 3]) +endfunction + +function! SyntaxCheckers_sql_sqlint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l:%c:ERROR %m,' . + \ '%W%f:%l:%c:WARNING %m,' . + \ '%C %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sql', + \ 'name': 'sqlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim b/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim new file mode 100644 index 0000000..f489910 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: stylint.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_stylus_stylint_checker') + finish +endif +let g:loaded_syntastic_stylus_stylint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_stylus_stylint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%WWarning: %m,' . + \ '%EError: %m,' . + \ '%CFile: %f,' . + \ '%CLine: %l:%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'stylus', + \ 'name': 'stylint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim b/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim new file mode 100644 index 0000000..adbce63 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: nagelfar.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: James Pickard <james.pickard 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. +" +"============================================================================ +" +"Notes: Requires nagelfar v1.1.12 or later with support for -H option. +" See nagelfar homepage http://nagelfar.berlios.de/. + +if exists('g:loaded_syntastic_tcl_nagelfar_checker') + finish +endif +let g:loaded_syntastic_tcl_nagelfar_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_tcl_nagelfar_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-H' }) + + let errorformat = + \ '%I%f: %l: N %m,'. + \ '%f: %l: %t %m,'. + \ '%-GChecking file %f' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tcl', + \ 'name': 'nagelfar'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim b/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim new file mode 100644 index 0000000..9b35902 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: chktex.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_tex_chktex_checker') + finish +endif +let g:loaded_syntastic_tex_chktex_checker = 1 + +if !exists('g:syntastic_tex_chktex_showmsgs') + let g:syntastic_tex_chktex_showmsgs = 1 +endif + +if !exists('g:syntastic_tex_chktex_sort') + let g:syntastic_tex_chktex_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_tex_chktex_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-q -v1' }) + + let errorformat = + \ '%EError %n in %f line %l: %m,' . + \ '%WWarning %n in %f line %l: %m,' . + \ (g:syntastic_tex_chktex_showmsgs ? '%WMessage %n in %f line %l: %m,' : '') . + \ '%Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tex', + \ 'name': 'chktex'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim b/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim new file mode 100644 index 0000000..f156520 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: tex.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_tex_lacheck_checker') + finish +endif +let g:loaded_syntastic_tex_lacheck_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_tex_lacheck_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%-G** %f:,' . + \ '%E"%f"\, line %l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tex', + \ 'name': 'lacheck'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim b/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim new file mode 100644 index 0000000..a66e787 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: makeinfo.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_texinfo_makeinfo_checker') + finish +endif +let g:loaded_syntastic_texinfo_makeinfo_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_texinfo_makeinfo_GetHighlightRegex(item) + let term = matchstr(a:item['text'], "\\m`\\zs[^']\\+\\ze'") + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_texinfo_makeinfo_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() }) + + let errorformat = + \ '%f:%l: %tarning: %m,' . + \ '%f:%l: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'type': 'e' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'texinfo', + \ 'name': 'makeinfo'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim b/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim new file mode 100644 index 0000000..e43d9dc --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim @@ -0,0 +1,61 @@ +"============================================================================ +"File: atdtool.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_text_atdtool_checker') + finish +endif +let g:loaded_syntastic_text_atdtool_checker = 1 + +if !exists('g:syntastic_text_atdtool_sort') + let g:syntastic_text_atdtool_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)') + if term !=# '' + let col = get(a:item, 'col', 0) + let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . escape(term, '\') + endif + return term +endfunction + +function! SyntaxCheckers_text_atdtool_GetLocList() dict + let makeprg = self.makeprgBuild({ 'tail': '2> ' . syntastic#util#DevNull() }) + + let errorformat = + \ '%W%f:%l:%c: %m,'. + \ '%+C suggestions:%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0], + \ 'subtype': 'Style' }) + + for e in loclist + let e['text'] = substitute(e['text'], '\m\n\s\+', ' | ', 'g') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'text', + \ 'name': 'atdtool'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/text/igor.vim b/vim/bundle/syntastic/syntax_checkers/text/igor.vim new file mode 100644 index 0000000..588cf3b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/text/igor.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: igor.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_text_igor_checker') + finish +endif +let g:loaded_syntastic_text_igor_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'text', + \ 'name': 'igor', + \ 'redirect': 'docbk/igor'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/text/language_check.vim b/vim/bundle/syntastic/syntax_checkers/text/language_check.vim new file mode 100644 index 0000000..e1aa69f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/text/language_check.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: language_check.vim +"Description: Grammar checker (https://github.com/myint/language-check) +"Authors: Steven Myint <git@stevenmyint.com> +" +"============================================================================ + +if exists('g:loaded_syntastic_text_language_check_checker') + finish +endif +let g:loaded_syntastic_text_language_check_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_text_language_check_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%f:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'text', + \ 'name': 'language_check', + \ 'exec': 'language-check'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/text/textlint.vim b/vim/bundle/syntastic/syntax_checkers/text/textlint.vim new file mode 100644 index 0000000..3b51ae7 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/text/textlint.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: textlint.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_text_textlint_checker') + finish +endif +let g:loaded_syntastic_text_textlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_text_textlint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-f compact' }) + + let errorformat = + \ '%f: line %l\, col %c\, %tarning - %m,' . + \ '%f: line %l\, col %c\, %trror - %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'text', + \ 'name': 'textlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim b/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim new file mode 100644 index 0000000..f459cda --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: rapper.vim +"Description: Syntax checking plugin for syntastic +"Maintainer: Sebastian Tramp <mail@sebastian.tramp.name> +"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_trig_rapper_checker') + finish +endif +let g:loaded_syntastic_trig_rapper_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'trig', + \ 'name': 'rapper', + \ 'redirect': 'turtle/rapper'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim b/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim new file mode 100644 index 0000000..4585a07 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: rapper.vim +"Description: Syntax checking plugin for syntastic +"Maintainer: Sebastian Tramp <mail@sebastian.tramp.name> +"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_turtle_rapper_checker') + finish +endif +let g:loaded_syntastic_turtle_rapper_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_turtle_rapper_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\mFailed to convert qname \zs\S\+\ze to URI') + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_turtle_rapper_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-i guess -q --count' }) + + let errorformat = + \ 'rapper: %trror - URI file://%f:%l - %m,' . + \ 'rapper: %tarning - URI file://%f:%l - %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'turtle', + \ 'name': 'rapper'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim b/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim new file mode 100644 index 0000000..c28e354 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: ttl.vim +"Description: turtle syntax checker - using ttl from turtle-validator (npm) +"Maintainer: Antoine Reilles (tonio@NetBSD.org) +"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_turtle_ttl_checker') + finish +endif +let g:loaded_syntastic_turtle_ttl_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_turtle_ttl_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m"\zs[^"]\+\ze"') + return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_turtle_ttl_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%\m[Error: %m %\%%(at%\|on%\) line %l%\%.]' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'turtle', + \ 'name': 'ttl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim b/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim new file mode 100644 index 0000000..547648f --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: twig.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alexander <iam.asm89 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_twig_twiglint_checker') + finish +endif +let g:loaded_syntastic_twig_twiglint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_twig_twiglint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': 'lint', + \ 'args_after': '--format=csv' }) + + let errorformat = '"%f"\,%l\,%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'twig', + \ 'name': 'twiglint', + \ 'exec': 'twig-lint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim b/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim new file mode 100644 index 0000000..41e5276 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: eslint.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_typescript_eslint_checker') + finish +endif +let g:loaded_syntastic_typescript_eslint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'typescript', + \ 'name': 'eslint', + \ 'redirect': 'javascript/eslint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim b/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim new file mode 100644 index 0000000..de9242e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: tsc.vim +"Description: TypeScript syntax checker +"Maintainer: Bill Casarin <bill@casarin.ca> +" +"============================================================================ + +if exists('g:loaded_syntastic_typescript_tsc_checker') + finish +endif +let g:loaded_syntastic_typescript_tsc_checker = 1 + +if !exists('g:syntastic_typescript_tsc_sort') + let g:syntastic_typescript_tsc_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_typescript_tsc_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + + let version_output = split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n', 1) + let ver = filter(copy(version_output), 'v:val =~# ''\m\<Version ''') + let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0], '\v<Version \zs\d+(\.\d+)\ze') : [] + + if len(parsed_ver) + call self.setVersion(parsed_ver) + let s:tsc_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 5]) + else + call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output) + call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)") + let s:tsc_new = -1 + endif + + return s:tsc_new >= 0 +endfunction + +function! SyntaxCheckers_typescript_tsc_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '--module commonjs', + \ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) }) + + let errorformat = + \ '%E%f %#(%l\,%c): error %m,' . + \ '%E%f %#(%l\,%c): %m,' . + \ '%Eerror %m,' . + \ '%C%\s%\+%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['guards'], + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'typescript', + \ 'name': 'tsc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim b/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim new file mode 100644 index 0000000..de224b6 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: typescript/tslint.vim +"Description: TypeScript linter +"Maintainer: Seon-Wook Park <seon.wook@swook.net> +"============================================================================ + +if exists('g:loaded_syntastic_typescript_tslint_checker') + finish +endif +let g:loaded_syntastic_typescript_tslint_checker = 1 + +if !exists('g:syntastic_typescript_tslint_sort') + let g:syntastic_typescript_tslint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_typescript_tslint_GetHighlightRegex(item) + let term = matchstr(a:item['text'], "\\m\\s'\\zs.\\{-}\\ze'\\s") + return term !=# '' ? '\V' . escape(term, '\') : '' +endfunction + +function! SyntaxCheckers_typescript_tslint_GetLocList() dict + if !exists('s:tslint_new') + let s:tslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4]) + endif + + let makeprg = self.makeprgBuild({ + \ 'args_after': '--format verbose', + \ 'fname_before': (s:tslint_new ? '' : '-f') }) + + " (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter + let errorformat = '%f[%l\, %c]: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'tslint', + \ 'subtype': 'Style', + \ 'returns': [0, 2] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'typescript', + \ 'name': 'tslint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/vala/valac.vim b/vim/bundle/syntastic/syntax_checkers/vala/valac.vim new file mode 100644 index 0000000..a60c249 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/vala/valac.vim @@ -0,0 +1,86 @@ +"============================================================================ +"File: vala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Konstantin Stepanov (me@kstep.me) +"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_vala_valac_checker') + finish +endif +let g:loaded_syntastic_vala_valac_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) " {{{1 + let length = strlen(matchstr(a:pos['text'], '\m\^\+$')) + return '\%>' . (a:pos['col'] - 1) . 'c\%<' . (a:pos['col'] + length) . 'c' +endfunction " }}}1 + +function! SyntaxCheckers_vala_valac_GetLocList() dict " {{{1 + let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') + let vala_vapi_args = join(map(s:GetValaVapiDirs(), '"--vapidir ".v:val'), ' ') + let makeprg = self.makeprgBuild({ 'args': '-C ' . vala_pkg_args . ' ' . vala_vapi_args }) + + let errorformat = + \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'. + \ '%C%m,'. + \ '%Z%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction " }}}1 + +" Utilities {{{1 + +function! s:GetValaModules() " {{{2 + if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules') + let modules = syntastic#util#var('vala_modules') + if type(modules) == type('') + return split(modules, '\m\s\+') + elseif type(modules) == type([]) + return copy(modules) + else + echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string' + endif + endif + + let modules_line = search('^// modules: ', 'n') + let modules_str = getline(modules_line) + return split(strpart(modules_str, 12), '\m\s\+') +endfunction " }}}2 + +function! s:GetValaVapiDirs() " {{{2 + if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs') + let vapi_dirs = syntastic#util#var('vala_vapi_dirs') + if type(vapi_dirs) == type('') + return split(vapi_dirs, '\m\s\+') + elseif type(vapi_dirs) == type([]) + return copy(vapi_dirs) + else + echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string' + endif + endif + + let vapi_line = search('^//\s*vapidirs:\s*','n') + let vapi_str = getline(vapi_line) + return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' ) +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vala', + \ 'name': 'valac'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim b/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim new file mode 100644 index 0000000..c34fec1 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: iverilog.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Psidium <psiidium at gmail dot com> +"License: The MIT License +"============================================================================ + +if exists('g:loaded_syntastic_verilog_iverilog_checker') + finish +endif +let g:loaded_syntastic_verilog_iverilog_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_verilog_iverilog_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': '-t null', + \ 'args': '-Wall' }) + + let errorformat = + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,' . + \ '%E%f:%l: : %m,' . + \ '%W%f:%l: : %m,' . + \ '%f:%l: %m' + + return SyntasticMake({'makeprg': makeprg, 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'verilog', + \ 'name': 'iverilog'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim b/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim new file mode 100644 index 0000000..e5cfddc --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: verilator.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Kocha <kocha dot lsifrontend at gmail dot com> +"============================================================================ + +if exists('g:loaded_syntastic_verilog_verilator_checker') + finish +endif +let g:loaded_syntastic_verilog_verilator_checker = 1 + +if !exists('g:syntastic_verilog_compiler_options') + let g:syntastic_verilog_compiler_options = '-Wall' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_verilog_verilator_IsAvailable() dict + if !exists('g:syntastic_verilog_compiler') + let g:syntastic_verilog_compiler = self.getExec() + endif + call self.log('g:syntastic_verilog_compiler =', g:syntastic_verilog_compiler) + return executable(expand(g:syntastic_verilog_compiler, 1)) +endfunction + +function! SyntaxCheckers_verilog_verilator_GetLocList() dict + return syntastic#c#GetLocList('verilog', 'verilator', { + \ 'errorformat': + \ '%%%trror-%\=%\w%#: %f:%l: %m,' . + \ '%%%tarning-%\=%\w%#: %f:%l: %m', + \ 'main_flags': '--lint-only' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'verilog', + \ 'name': 'verilator' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim b/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim new file mode 100644 index 0000000..497152b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: ghdl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jan Wagner <jaydyou at janidom dot de> +"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_vhdl_ghdl_checker') + finish +endif +let g:loaded_syntastic_vhdl_ghdl_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_vhdl_ghdl_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_before': '-s' }) + + let errorformat = '%f:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vhdl', + \ 'name': 'ghdl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim b/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim new file mode 100644 index 0000000..6cdf4fb --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: vcom.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jim Vogel <jim dot e dot vogel 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_vhdl_vcom_checker') + finish +endif +let g:loaded_syntastic_vhdl_vcom_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_vhdl_vcom_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_before': '-lint' }) + + let errorformat = + \ '** %tRROR: %f(%l): %m,' . + \ '** %tRROR: %m,' . + \ '** %tARNING: %f(%l): %m,' . + \ '** %tARNING: %m,' . + \ '** %tOTE: %m,' . + \ '%tRROR: %f(%l): %m,' . + \ '%tARNING[%*[0-9]]: %f(%l): %m,' . + \ '%tRROR: %m,' . + \ '%tARNING[%*[0-9]]: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for e in loclist + if e['type'] !=? 'E' && e['type'] !=? 'W' + let e['type'] = 'W' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vhdl', + \ 'name': 'vcom'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim b/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim new file mode 100644 index 0000000..0e03ed0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim @@ -0,0 +1,108 @@ +"============================================================================ +"File: vimlint.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_vim_vimlint_checker') + finish +endif +let g:loaded_syntastic_vim_vimlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item) " {{{1 + let term = matchstr(a:item['text'], '\m `\zs[^`]\+\ze`') + if term !=# '' + let col = get(a:item, 'col', 0) + + if col && term[0:1] ==# 'l:' + if getline(a:item.lnum)[col-1:col] !=# 'l:' + let term = term[2:] + endif + endif + + return col ? '\%>' . (col - 1) . 'c\%<' . (col + strlen(term)) . 'c' : '\V' . escape(term, '\') + endif + + return '' +endfunction " }}}1 + +function! SyntaxCheckers_vim_vimlint_IsAvailable() dict " {{{1 + let vimlparser = globpath(&runtimepath, 'autoload/vimlparser.vim', 1) + let vimlint = globpath(&runtimepath, 'autoload/vimlint.vim', 1) + call self.log("globpath(&runtimepath, 'autoload/vimlparser.vim', 1) = " . string(vimlparser) . ', ' . + \ "globpath(&runtimepath, 'autoload/vimlint.vim', 1) = " . string(vimlint)) + return vimlparser !=# '' && vimlint !=# '' +endfunction " }}}1 + +function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1 + " EVL102: unused variable v + " EVL103: unused argument v + " EVL104: variable may not be initialized on some execution path: v + " EVL105: global variable v is defined without g: + " EVL106: local variable v is used without l: + " EVL201: unreachable code + " EVL204: constant in conditional context + " EVL205: missing scriptencoding + " value 3: the message is a warning + " + " References: :help vimlint-errorcode and :help vimlint-variables + let param = { + \ 'output': function('s:vimlintOutput'), + \ 'quiet': 1, + \ 'EVL102': 3, + \ 'EVL103': 3, + \ 'EVL104': 3, + \ 'EVL105': 3, + \ 'EVL106': 3, + \ 'EVL201': 3, + \ 'EVL204': 3, + \ 'EVL205': 3 } + + if exists('g:syntastic_vimlint_options') || exists('b:syntastic_vimlint_options') + let opts = syntastic#util#var('vimlint_options') + if type(opts) == type({}) + let options = filter(copy(opts), 'v:key =~# "\\m^EVL"') + call extend(param, options, 'force') + endif + endif + + call self.log('options =', param) + + return vimlint#vimlint(expand('%', 1), param) +endfunction " }}}1 + +" Utilities {{{1 + +" @vimlint(EVL103, 1, a:filename) +function! s:vimlintOutput(filename, pos, ev, eid, mes, obj) " {{{2 + call add(a:obj.error, { + \ 'bufnr': bufnr(''), + \ 'lnum': a:pos.lnum, + \ 'col': a:pos.col, + \ 'vcol': 0, + \ 'type': a:ev[0], + \ 'text': '[' . a:eid . '] ' . a:mes, + \ 'valid': a:pos.lnum > 0 }) +endfunction " }}}2 +" @vimlint(EVL103, 0, a:filename) + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vim', + \ 'name': 'vimlint', + \ 'exec': '' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/vim/vint.vim b/vim/bundle/syntastic/syntax_checkers/vim/vint.vim new file mode 100644 index 0000000..23a041e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/vim/vint.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: vint.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_vim_vint_checker') + finish +endif +let g:loaded_syntastic_vim_vint_checker = 1 + +if !exists('g:syntastic_vim_vint_sort') + let g:syntastic_vim_vint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_vim_vint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'post_args': '--json' }) + + let errorformat = '%f:%l:%c:%t: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'vint', + \ 'returns': [0, 1] }) + + for e in loclist + if e['type'] ==? 's' + let e['type'] = 'w' + let e['subtype'] = 'Style' + elseif e['type'] !=? 'e' && e['type'] !=? 'w' + let e['type'] = 'e' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vim', + \ 'name': 'vint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim b/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim new file mode 100644 index 0000000..f4536e2 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: jshint.vim +"Description: Javascript syntax checker for xHTML - using jshint +"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_xhtml_jshint_checker') + finish +endif +let g:loaded_syntastic_xhtml_jshint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xhtml', + \ 'name': 'jshint', + \ 'redirect': 'html/jshint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim b/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim new file mode 100644 index 0000000..7f76d8b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim @@ -0,0 +1,92 @@ +"============================================================================ +"File: xhtml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_xhtml_tidy_checker') + finish +endif +let g:loaded_syntastic_xhtml_tidy_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_xhtml_tidy_ignore_errors') + let g:syntastic_xhtml_tidy_ignore_errors = [] +endif + +" Constants {{{1 + +" TODO: join this with html.vim DRY's sake? +function! s:TidyEncOptByFenc() + let TIDY_OPTS = { + \ 'utf-8': '-utf8', + \ 'ascii': '-ascii', + \ 'latin1': '-latin1', + \ 'iso-2022-jp': '-iso-2022', + \ 'cp1252': '-win1252', + \ 'macroman': '-mac', + \ 'utf-16le': '-utf16le', + \ 'utf-16': '-utf16', + \ 'big5': '-big5', + \ 'cp932': '-shiftjis', + \ 'sjis': '-shiftjis', + \ 'cp850': '-ibm858', + \ } + return get(TIDY_OPTS, &fileencoding, '-utf8') +endfunction + +" }}}1 + +function! SyntaxCheckers_xhtml_tidy_GetLocList() dict " {{{1 + let encopt = s:TidyEncOptByFenc() + let makeprg = self.makeprgBuild({ 'args_after': encopt . ' -xml -e' }) + + let errorformat= + \ '%Wline %l column %v - Warning: %m,' . + \ '%Eline %l column %v - Error: %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')}, + \ 'returns': [0, 1, 2] }) + + for e in loclist + if e['valid'] && s:IgnoreError(e['text']) == 1 + let e['valid'] = 0 + endif + endfor + + return loclist +endfunction " }}}1 + +" Utilities {{{1 + +function! s:IgnoreError(text) " {{{2 + for item in g:syntastic_xhtml_tidy_ignore_errors + if stridx(a:text, item) != -1 + return 1 + endif + endfor + return 0 +endfunction " }}}2 + +" }}}1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xhtml', + \ 'name': 'tidy'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim b/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim new file mode 100644 index 0000000..8e80dde --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: plutil.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_xml_plutil_checker') + finish +endif +let g:loaded_syntastic_xml_plutil_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_xml_plutil_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': '-lint -s', + \ 'fname_before': '--' }) + + let errorformat = + \ '%E%f: %m at line %l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xml', + \ 'name': 'plutil'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim new file mode 100644 index 0000000..1300437 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim @@ -0,0 +1,54 @@ +"============================================================================ +"File: xml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier <sebastian at kusnier dot net> +"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_xml_xmllint_checker') + finish +endif +let g:loaded_syntastic_xml_xmllint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" You can use a local installation of DTDs to significantly speed up validation +" and allow you to validate XML data without network access, see xmlcatalog(1) +" and http://www.xmlsoft.org/catalog.html for more information. + +function! SyntaxCheckers_xml_xmllint_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args': '--xinclude --postvalid', + \ 'args_after': '--noout' }) + + let errorformat= + \ '%E%f:%l: error : %m,' . + \ '%-G%f:%l: validity error : Validation failed: no DTD found %m,' . + \ '%W%f:%l: warning : %m,' . + \ '%W%f:%l: validity warning : %m,' . + \ '%E%f:%l: validity error : %m,' . + \ '%E%f:%l: parser error : %m,' . + \ '%E%f:%l: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1, 2, 3, 4, 5] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xml', + \ 'name': 'xmllint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim b/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim new file mode 100644 index 0000000..640a191 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: basex.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: James Wright <james dot jw at hotmail 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. +" +"============================================================================ + +if exists('g:loaded_syntastic_xquery_basex_checker') + finish +endif +let g:loaded_syntastic_xquery_basex_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_xquery_basex_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': '-z', + \ 'fname_before': '-q', + \ 'fname': syntastic#util#shescape('inspect:module("' . escape(expand('%:p', 1), '"') . '")') }) + + let errorformat = + \ '%f:%l:%c:%t:%n:%m,' . + \ '%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'preprocess': 'basex' }) + + for e in loclist + if e['type'] !=# 'W' && e['type'] !=# 'E' + let e['type'] = 'E' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xquery', + \ 'name': 'basex'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim new file mode 100644 index 0000000..9ffb548 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: xslt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier <sebastian at kusnier dot net> +"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_xslt_xmllint_checker') + finish +endif +let g:loaded_syntastic_xslt_xmllint_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xslt', + \ 'name': 'xmllint', + \ 'redirect': 'xml/xmllint'}) + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim b/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim new file mode 100644 index 0000000..af8ac91 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: yacc.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_yacc_bison_checker') + finish +endif +let g:loaded_syntastic_yacc_bison_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_yacc_bison_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_after': syntastic#c#NullOutput() }) + + let errorformat = + \ '%E%f:%l%.%v-%.%\{-}: %trror: %m,' . + \ '%E%f:%l%.%v: %trror: %m,' . + \ '%W%f:%l%.%v-%.%\{-}: %tarning: %m,' . + \ '%W%f:%l%.%v: %tarning: %m,' . + \ '%I%f:%l%.%v-%.%\{-}: %\s%\+%m,' . + \ '%I%f:%l%.%v: %\s%\+%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + let last_type = 'E' + for e in loclist + if e['type'] ==? 'I' + let e['type'] = last_type + endif + let last_type = e['type'] + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yacc', + \ 'name': 'bison'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim b/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim new file mode 100644 index 0000000..e8baa7e --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: yaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_yaml_jsyaml_checker') + finish +endif +let g:loaded_syntastic_yaml_jsyaml_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict + if !exists('s:js_yaml_new') + let s:js_yaml_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2]) + endif + + let makeprg = self.makeprgBuild({ 'args_after': (s:js_yaml_new ? '' : '--compact') }) + + let errorformat = + \ 'Error on line %l\, col %c:%m,' . + \ 'JS-YAML: %m at line %l\, column %c:,' . + \ 'YAMLException: %m at line %l\, column %c:,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yaml', + \ 'name': 'jsyaml', + \ 'exec': 'js-yaml'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim b/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim new file mode 100644 index 0000000..130877d --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: yamllint.vim +"Description: YAML files linting for syntastic.vim +"Maintainer: Adrien Vergé +"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_yaml_yamllint_checker') + finish +endif +let g:loaded_syntastic_yaml_yamllint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_yaml_yamllint_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-f parsable' }) + + let errorformat = + \ '%f:%l:%c: [%trror] %m,' . + \ '%f:%l:%c: [%tarning] %m' + + let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' } + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'env': env, + \ 'returns': [0, 1] }) + + for e in loclist + if e['type'] ==? 'W' + let e['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yaml', + \ 'name': 'yamllint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim b/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim new file mode 100644 index 0000000..ace118a --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim @@ -0,0 +1,72 @@ +"============================================================================ +"File: yamlxs.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_yaml_yamlxs_checker') + finish +endif +let g:loaded_syntastic_yaml_yamlxs_checker = 1 + +if !exists('g:syntastic_perl_lib_path') + let g:syntastic_perl_lib_path = [] +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_yaml_yamlxs_IsAvailable() dict + if !exists('g:syntastic_yaml_yamlxs_exec') && exists('g:syntastic_perl_interpreter') + let g:syntastic_yaml_yamlxs_exec = g:syntastic_perl_interpreter + endif + + " don't call executable() here, to allow things like + " let g:syntastic_perl_interpreter='/usr/bin/env perl' + silent! call syntastic#util#system(self.getExecEscaped() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)')) + return v:shell_error == 0 +endfunction + +function! SyntaxCheckers_yaml_yamlxs_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': s:Modules() . ' -e ' . syntastic#util#shescape('YAML::XS::LoadFile($ARGV[0])') }) + + let errorformat = + \ '%EYAML::XS::Load Error: The problem:,' . + \ '%-C,' . + \ '%C %m,' . + \ '%Cwas found at document: %\d%\+\, line: %l\, column: %c,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'], + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +function s:Modules() + if type(g:syntastic_perl_lib_path) == type('') + call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list') + let includes = split(g:syntastic_perl_lib_path, ',') + else + let includes = copy(syntastic#util#var('perl_lib_path')) + endif + return join(map(includes, '"-I" . v:val') + ['-MYAML::XS']) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yaml', + \ 'name': 'yamlxs', + \ 'exec': 'perl' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim b/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim new file mode 100644 index 0000000..f397fa0 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: pyang.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: joshua.downer@gmail.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_yang_pyang_checker') + finish +endif +let g:loaded_syntastic_yang_pyang_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_yang_pyang_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m"\zs[^"]\+\ze"') + return term != '' ? '\V\<' . escape(term, '\') . '\>' : '' +endfunction + +function! SyntaxCheckers_yang_pyang_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['filterForeignErrors'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yang', + \ 'name': 'pyang'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim b/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim new file mode 100644 index 0000000..af61a8b --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: z80syntaxchecker.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Romain Giot <giot.romain 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_z80_z80syntaxchecker_checker') + finish +endif +let g:loaded_syntastic_z80_z80syntaxchecker_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'z80', + \ 'name': 'z80syntaxchecker', + \ 'exec': 'z80_syntax_checker.py'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim b/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim new file mode 100644 index 0000000..31a6093 --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: zpt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: claytron <robots at claytron 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_zpt_zptlint_checker') + finish +endif +let g:loaded_syntastic_zpt_zptlint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_zpt_zptlint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat= + \ '%-P*** Error in: %f,'. + \ '%Z%*\s\, at line %l\, column %c,'. + \ '%E%*\s%m,'. + \ '%-Q' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'zpt', + \ 'name': 'zptlint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim b/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim new file mode 100644 index 0000000..4d458de --- /dev/null +++ b/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: zsh.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell <martin.grenfell 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_zsh_zsh_checker') + finish +endif +let g:loaded_syntastic_zsh_zsh_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_zsh_zsh_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args_after': '-n' }) + + let errorformat = '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'zsh', + \ 'name': 'zsh'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: |