├── .gitignore ├── _assets └── screenshot_1.png ├── LICENCE ├── syntax_checkers ├── python │ ├── py3kwarn.vim │ ├── pylint.vim │ ├── python.vim │ ├── pep8.vim │ ├── flake8.vim │ └── pyflakes.vim ├── typescript │ └── tsc.vim ├── less │ ├── less-lint.coffee │ ├── less-lint.js │ └── lessc.vim ├── c │ ├── ycm.vim │ ├── checkpatch.vim │ ├── sparse.vim │ ├── make.vim │ ├── splint.vim │ └── oclint.vim ├── scss │ └── sass.vim ├── xslt │ └── xmllint.vim ├── erlang │ ├── erlang_check_file.erl │ └── erlang.vim ├── docbk │ └── xmllint.vim ├── cpp │ ├── ycm.vim │ ├── oclint.vim │ └── cpplint.vim ├── perl │ ├── podchecker.vim │ ├── perlcritic.vim │ └── perl.vim ├── objc │ ├── ycm.vim │ └── oclint.vim ├── objcpp │ ├── ycm.vim │ └── oclint.vim ├── css │ ├── phpcs.vim │ ├── csslint.vim │ └── prettycss.vim ├── zsh │ └── zsh.vim ├── vhdl │ └── ghdl.vim ├── go │ ├── golint.vim │ ├── govet.vim │ ├── gofmt.vim │ └── go.vim ├── tex │ ├── lacheck.vim │ └── chktex.vim ├── cs │ └── mcs.vim ├── llvm │ └── llvm.vim ├── nroff │ └── mandoc.vim ├── coffee │ ├── coffeelint.vim │ └── coffee.vim ├── nasm │ └── nasm.vim ├── coq │ └── coqtop.vim ├── pod │ └── podchecker.vim ├── json │ ├── jsonval.vim │ └── jsonlint.vim ├── yaml │ └── jsyaml.vim ├── matlab │ └── mlint.vim ├── ruby │ ├── macruby.vim │ ├── jruby.vim │ ├── rubocop.vim │ └── mri.vim ├── scala │ └── scalac.vim ├── rust │ └── rustc.vim ├── twig │ └── twiglint.vim ├── sh │ ├── checkbashisms.vim │ └── sh.vim ├── co │ └── coco.vim ├── cucumber │ └── cucumber.vim ├── haml │ └── haml.vim ├── php │ ├── phpcs.vim │ ├── php.vim │ └── phpmd.vim ├── tcl │ └── nagelfar.vim ├── elixir │ └── elixir.vim ├── gentoo_metadata │ └── xmllint.vim ├── haskell │ ├── hdevtools.vim │ └── ghc-mod.vim ├── lisp │ └── clisp.vim ├── z80 │ └── z80syntaxchecker.vim ├── javascript │ ├── gjslint.vim │ ├── jsl.vim │ ├── jslint.vim │ ├── jshint.vim │ └── closurecompiler.vim ├── zpt │ └── zptlint.vim ├── rst │ └── rst2pseudoxml.vim ├── xml │ └── xmllint.vim ├── text │ └── atdtool.vim ├── applescript │ └── osacompile.vim ├── slim │ └── slimrb.vim ├── html │ ├── validator_decode.awk │ ├── w3.vim │ └── validator.vim ├── eruby │ └── ruby.vim ├── java │ └── checkstyle.vim ├── lua │ └── luac.vim ├── fortran │ └── gfortran.vim ├── haxe │ └── haxe.vim ├── dart │ └── dart_analyzer.vim ├── cuda │ └── nvcc.vim ├── sass │ └── sass.vim ├── xhtml │ └── tidy.vim └── vala │ └── valac.vim ├── plugin └── syntastic │ ├── autoloclist.vim │ ├── notifiers.vim │ ├── cursor.vim │ ├── balloons.vim │ ├── makeprg_builder.vim │ ├── modemap.vim │ ├── checker.vim │ └── highlighting.vim ├── autoload └── syntastic │ ├── postprocess.vim │ └── makeprg.vim └── CONTRIBUTING.md /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | tags 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /_assets/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gs/syntastic/master/_assets/screenshot_1.png -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /syntax_checkers/python/py3kwarn.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: py3kwarn.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Authors: Liam Curry 5 | " 6 | "============================================================================ 7 | if exists("g:loaded_syntastic_python_py3kwarn_checker") 8 | finish 9 | endif 10 | let g:loaded_syntastic_python_py3kwarn_checker=1 11 | 12 | function! SyntaxCheckers_python_py3kwarn_IsAvailable() 13 | return executable('py3kwarn') 14 | endfunction 15 | 16 | function! SyntaxCheckers_python_py3kwarn_GetLocList() 17 | let makeprg = syntastic#makeprg#build({ 18 | \ 'exe': 'py3kwarn', 19 | \ 'filetype': 'python', 20 | \ 'subchecker': 'py3kwarn' }) 21 | 22 | let errorformat = '%W%f:%l:%c: %m' 23 | 24 | return SyntasticMake({ 25 | \ 'makeprg': makeprg, 26 | \ 'errorformat': errorformat }) 27 | endfunction 28 | 29 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 30 | \ 'filetype': 'python', 31 | \ 'name': 'py3kwarn'}) 32 | -------------------------------------------------------------------------------- /plugin/syntastic/autoloclist.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_notifier_autoloclist") 2 | finish 3 | endif 4 | let g:loaded_syntastic_notifier_autoloclist = 1 5 | 6 | if !exists("g:syntastic_auto_loc_list") 7 | let g:syntastic_auto_loc_list = 2 8 | endif 9 | 10 | let g:SyntasticAutoloclistNotifier = {} 11 | 12 | " Public methods {{{1 13 | " 14 | function! g:SyntasticAutoloclistNotifier.New() 15 | let newObj = copy(self) 16 | return newObj 17 | endfunction 18 | 19 | function! g:SyntasticAutoloclistNotifier.refresh(loclist) 20 | call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist) 21 | endfunction 22 | 23 | function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) 24 | if a:loclist.hasErrorsOrWarningsToDisplay() 25 | if g:syntastic_auto_loc_list == 1 26 | call a:loclist.show() 27 | endif 28 | else 29 | if g:syntastic_auto_loc_list > 0 30 | 31 | "TODO: this will close the loc list window if one was opened by 32 | "something other than syntastic 33 | lclose 34 | endif 35 | endif 36 | endfunction 37 | 38 | " vim: set sw=4 sts=4 et fdm=marker: 39 | -------------------------------------------------------------------------------- /syntax_checkers/typescript/tsc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: typescript.vim 3 | "Description: TypeScript syntax checker. For TypeScript v0.8.0 4 | "Maintainer: Bill Casarin 5 | "============================================================================ 6 | 7 | if exists("g:loaded_syntastic_typescript_tsc_checker") 8 | finish 9 | endif 10 | let g:loaded_syntastic_typescript_tsc_checker=1 11 | 12 | function! SyntaxCheckers_typescript_tsc_IsAvailable() 13 | return executable("tsc") 14 | endfunction 15 | 16 | 17 | function! SyntaxCheckers_typescript_tsc_GetLocList() 18 | let makeprg = syntastic#makeprg#build({ 19 | \ 'exe': 'tsc', 20 | \ 'post_args': '--out ' . syntastic#util#DevNull(), 21 | \ 'filetype': 'typescript', 22 | \ 'subchecker': 'tsc' }) 23 | 24 | let errorformat = '%f %#(%l\,%c): %m' 25 | 26 | return SyntasticMake({ 27 | \ 'makeprg': makeprg, 28 | \ 'errorformat': errorformat }) 29 | endfunction 30 | 31 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 32 | \ 'filetype': 'typescript', 33 | \ 'name': 'tsc'}) 34 | -------------------------------------------------------------------------------- /syntax_checkers/less/less-lint.coffee: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | fs = require 'fs' 4 | less = require 'less' 5 | args = process.argv.slice(1) 6 | options = {} 7 | 8 | args = args.filter (arg) -> 9 | match = arg.match(/^-I(.+)$/) 10 | if match 11 | options.paths.push(match[1]); 12 | return false 13 | 14 | match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i) 15 | if match 16 | arg = match[1] 17 | else 18 | return arg 19 | 20 | switch arg 21 | when 'strict-imports' then options.strictImports = true 22 | when 'include-path' 23 | options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':') 24 | .map (p) -> 25 | if p 26 | return path.resolve(process.cwd(), p) 27 | when 'O0' then options.optimization = 0 28 | when 'O1' then options.optimization = 1 29 | when 'O2' then options.optimization = 2 30 | 31 | options.filename = args[1] 32 | 33 | parser = new(less.Parser) options 34 | 35 | fs.readFile(options.filename, 'utf-8', (err,data) -> 36 | parser.parse(data, (err, tree) -> 37 | if err 38 | less.writeError err 39 | process.exit(1) 40 | ) 41 | ) 42 | -------------------------------------------------------------------------------- /syntax_checkers/c/ycm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ycm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Val Markovic 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_c_ycm_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_c_ycm_checker = 1 17 | 18 | function! SyntaxCheckers_c_ycm_IsAvailable() 19 | return exists('g:loaded_youcompleteme') 20 | endfunction 21 | 22 | if !exists('g:loaded_youcompleteme') 23 | finish 24 | endif 25 | 26 | function! SyntaxCheckers_c_ycm_GetLocList() 27 | return youcompleteme#CurrentFileDiagnostics() 28 | endfunction 29 | 30 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 31 | \ 'filetype': 'c', 32 | \ 'name': 'ycm'}) 33 | -------------------------------------------------------------------------------- /syntax_checkers/scss/sass.vim: -------------------------------------------------------------------------------- 1 | 2 | "============================================================================ 3 | "File: scss.vim 4 | "Description: scss syntax checking plugin for syntastic 5 | "Maintainer: Martin Grenfell 6 | "License: This program is free software. It comes without any warranty, 7 | " to the extent permitted by applicable law. You can redistribute 8 | " it and/or modify it under the terms of the Do What The Fuck You 9 | " Want To Public License, Version 2, as published by Sam Hocevar. 10 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 11 | " 12 | "============================================================================ 13 | 14 | if exists("g:loaded_syntastic_scss_sass_checker") 15 | finish 16 | endif 17 | let g:loaded_syntastic_scss_sass_checker=1 18 | 19 | runtime syntax_checkers/sass/sass.vim 20 | 21 | function! SyntaxCheckers_scss_sass_IsAvailable() 22 | return SyntaxCheckers_sass_sass_IsAvailable() 23 | endfunction 24 | 25 | function! SyntaxCheckers_scss_sass_GetLocList() 26 | return SyntaxCheckers_sass_sass_GetLocList() 27 | endfunction 28 | 29 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 30 | \ 'filetype': 'scss', 31 | \ 'name': 'sass'}) 32 | -------------------------------------------------------------------------------- /syntax_checkers/xslt/xmllint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: xslt.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Sebastian Kusnier 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_xslt_xmllint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_xslt_xmllint_checker=1 17 | 18 | runtime syntax_checkers/xml/xmllint.vim 19 | 20 | function! SyntaxCheckers_xslt_xmllint_IsAvailable() 21 | return SyntaxCheckers_xml_xmllint_IsAvailable() 22 | endfunction 23 | 24 | function! SyntaxCheckers_xslt_xmllint_GetLocList() 25 | return SyntaxCheckers_xml_xmllint_GetLocList() 26 | endfunction 27 | 28 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 29 | \ 'filetype': 'xslt', 30 | \ 'name': 'xmllint'}) 31 | -------------------------------------------------------------------------------- /syntax_checkers/erlang/erlang_check_file.erl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env escript 2 | -export([main/1]). 3 | 4 | main([FileName]) -> 5 | LibDirs = filelib:wildcard("{lib,deps}/*/ebin"), 6 | compile(FileName, LibDirs); 7 | main([FileName | LibDirs]) -> 8 | compile(FileName, LibDirs). 9 | 10 | compile(FileName, LibDirs) -> 11 | Root = get_root(filename:dirname(FileName)), 12 | ok = code:add_pathsa(LibDirs), 13 | compile:file(FileName, [warn_obsolete_guard, 14 | warn_unused_import, 15 | warn_shadow_vars, 16 | warn_export_vars, 17 | strong_validation, 18 | report, 19 | {i, filename:join(Root, "include")}, 20 | {i, filename:join(Root, "deps")}, 21 | {i, filename:join(Root, "apps")}, 22 | {i, filename:join(Root, "lib")} 23 | ]). 24 | 25 | get_root(Dir) -> 26 | Path = filename:split(filename:absname(Dir)), 27 | filename:join(get_root(lists:reverse(Path), Path)). 28 | 29 | get_root([], Path) -> 30 | Path; 31 | get_root(["src" | Tail], _Path) -> 32 | lists:reverse(Tail); 33 | get_root([_ | Tail], Path) -> 34 | get_root(Tail, Path). 35 | -------------------------------------------------------------------------------- /syntax_checkers/docbk/xmllint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: docbk.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_docbk_xmllint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_docbk_xmllint_checker=1 17 | 18 | runtime syntax_checkers/xml/xmllint.vim 19 | 20 | function! SyntaxCheckers_docbk_xmllint_IsAvailable() 21 | return SyntaxCheckers_xml_xmllint_IsAvailable() 22 | endfunction 23 | 24 | function! SyntaxCheckers_docbk_xmllint_GetLocList() 25 | return SyntaxCheckers_xml_xmllint_GetLocList() 26 | endfunction 27 | 28 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 29 | \ 'filetype': 'docbk', 30 | \ 'name': 'xmllint'}) 31 | -------------------------------------------------------------------------------- /syntax_checkers/cpp/ycm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ycm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Val Markovic 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_cpp_ycm_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_cpp_ycm_checker = 1 17 | 18 | runtime syntax_checkers/c/ycm.vim 19 | 20 | function! SyntaxCheckers_cpp_ycm_IsAvailable() 21 | return SyntaxCheckers_c_ycm_IsAvailable() 22 | endfunction 23 | 24 | if !exists('g:loaded_youcompleteme') 25 | finish 26 | endif 27 | 28 | function! SyntaxCheckers_cpp_ycm_GetLocList() 29 | return SyntaxCheckers_c_ycm_GetLocList() 30 | endfunction 31 | 32 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 33 | \ 'filetype': 'cpp', 34 | \ 'name': 'ycm'}) 35 | -------------------------------------------------------------------------------- /syntax_checkers/perl/podchecker.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: podchecker.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_perl_podchecker_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_perl_podchecker_checker=1 17 | 18 | runtime syntax_checkers/pod/podchecker.vim 19 | 20 | function! SyntaxCheckers_perl_podchecker_IsAvailable() 21 | return SyntaxCheckers_pod_podchecker_IsAvailable() 22 | endfunction 23 | 24 | function! SyntaxCheckers_perl_podchecker_GetLocList() 25 | return SyntaxCheckers_pod_podchecker_GetLocList() 26 | endfunction 27 | 28 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 29 | \ 'filetype': 'perl', 30 | \ 'name': 'podchecker'}) 31 | -------------------------------------------------------------------------------- /syntax_checkers/objc/ycm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ycm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Val Markovic 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_objc_ycm_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_objc_ycm_checker = 1 17 | 18 | runtime syntax_checkers/c/ycm.vim 19 | 20 | function! SyntaxCheckers_objc_ycm_IsAvailable() 21 | return SyntaxCheckers_c_ycm_IsAvailable() 22 | endfunction 23 | 24 | if !exists('g:loaded_youcompleteme') 25 | finish 26 | endif 27 | 28 | function! SyntaxCheckers_objc_ycm_GetLocList() 29 | return SyntaxCheckers_c_ycm_GetLocList() 30 | endfunction 31 | 32 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 33 | \ 'filetype': 'objc', 34 | \ 'name': 'ycm'}) 35 | -------------------------------------------------------------------------------- /syntax_checkers/objcpp/ycm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ycm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Val Markovic 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_objcpp_ycm_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_objcpp_ycm_checker = 1 17 | 18 | runtime syntax_checkers/c/ycm.vim 19 | 20 | function! SyntaxCheckers_objcpp_ycm_IsAvailable() 21 | return SyntaxCheckers_c_ycm_IsAvailable() 22 | endfunction 23 | 24 | if !exists('g:loaded_youcompleteme') 25 | finish 26 | endif 27 | 28 | function! SyntaxCheckers_objcpp_ycm_GetLocList() 29 | return SyntaxCheckers_c_ycm_GetLocList() 30 | endfunction 31 | 32 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 33 | \ 'filetype': 'objcpp', 34 | \ 'name': 'ycm'}) 35 | -------------------------------------------------------------------------------- /syntax_checkers/css/phpcs.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: phpcs.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " See here for details of phpcs 14 | " - phpcs (see http://pear.php.net/package/PHP_CodeSniffer) 15 | " 16 | if exists("g:loaded_syntastic_css_phpcs_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_css_phpcs_checker=1 20 | 21 | runtime syntax_checkers/php/phpcs.vim 22 | 23 | function! SyntaxCheckers_css_phpcs_IsAvailable() 24 | return SyntaxCheckers_php_phpcs_IsAvailable() 25 | endfunction 26 | 27 | function! SyntaxCheckers_css_phpcs_GetLocList() 28 | return SyntaxCheckers_php_phpcs_GetLocList() 29 | endfunction 30 | 31 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 32 | \ 'filetype': 'css', 33 | \ 'name': 'phpcs'}) 34 | -------------------------------------------------------------------------------- /syntax_checkers/zsh/zsh.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: zsh.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_zsh_zsh_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_zsh_zsh_checker=1 17 | 18 | function! SyntaxCheckers_zsh_zsh_IsAvailable() 19 | return executable("zsh") 20 | endfunction 21 | 22 | function! SyntaxCheckers_zsh_zsh_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'zsh', 25 | \ 'args': '-n', 26 | \ 'filetype': 'zsh', 27 | \ 'subchecker': 'zsh' }) 28 | 29 | let errorformat = '%f:%l: %m' 30 | 31 | return SyntasticMake({ 32 | \ 'makeprg': makeprg, 33 | \ 'errorformat': errorformat}) 34 | endfunction 35 | 36 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 37 | \ 'filetype': 'zsh', 38 | \ 'name': 'zsh'}) 39 | -------------------------------------------------------------------------------- /syntax_checkers/python/pylint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: pylint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Author: Parantapa Bhattacharya 5 | " 6 | "============================================================================ 7 | if exists("g:loaded_syntastic_python_pylint_checker") 8 | finish 9 | endif 10 | let g:loaded_syntastic_python_pylint_checker=1 11 | 12 | function! SyntaxCheckers_python_pylint_IsAvailable() 13 | return executable('pylint') 14 | endfunction 15 | 16 | function! SyntaxCheckers_python_pylint_GetLocList() 17 | let makeprg = syntastic#makeprg#build({ 18 | \ 'exe': 'pylint', 19 | \ 'args': ' -f parseable -r n -i y', 20 | \ 'filetype': 'python', 21 | \ 'subchecker': 'pylint' }) 22 | 23 | let errorformat = 24 | \ '%A%f:%l:%m,' . 25 | \ '%A%f:(%l):%m,' . 26 | \ '%-Z%p^%.%#,' . 27 | \ '%-G%.%#' 28 | 29 | let loclist=SyntasticMake({ 30 | \ 'makeprg': makeprg, 31 | \ 'errorformat': errorformat, 32 | \ 'postprocess': ['sort'] }) 33 | 34 | for n in range(len(loclist)) 35 | let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][2]) >= 0 ? 'W' : 'E' 36 | endfor 37 | 38 | return loclist 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'python', 43 | \ 'name': 'pylint' }) 44 | -------------------------------------------------------------------------------- /syntax_checkers/vhdl/ghdl.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ghdl.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Jan Wagner 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_vhdl_ghdl_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_vhdl_ghdl_checker = 1 16 | 17 | function! SyntaxCheckers_vhdl_ghdl_IsAvailable() 18 | return executable("ghdl") 19 | endfunction 20 | 21 | function! SyntaxCheckers_vhdl_ghdl_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'ghdl', 24 | \ 'args': '-s', 25 | \ 'filetype': 'vhdl', 26 | \ 'subchecker': 'ghdl' }) 27 | 28 | let errorformat = '%f:%l:%c: %m' 29 | 30 | return SyntasticMake({ 31 | \ 'makeprg': makeprg, 32 | \ 'errorformat': errorformat }) 33 | endfunction 34 | 35 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 36 | \ 'filetype': 'vhdl', 37 | \ 'name': 'ghdl'}) 38 | -------------------------------------------------------------------------------- /syntax_checkers/go/golint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: golint.vim 3 | "Description: Check go syntax using 'golint' 4 | "Maintainer: Hiroshi Ioka 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_go_golint_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_go_golint_checker=1 16 | 17 | function! SyntaxCheckers_go_golint_IsAvailable() 18 | return executable('golint') 19 | endfunction 20 | 21 | function! SyntaxCheckers_go_golint_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'golint', 24 | \ 'filetype': 'go', 25 | \ 'subchecker': 'golint' }) 26 | 27 | let errorformat = '%f:%l:%c: %m,%-G%.%#' 28 | 29 | return SyntasticMake({ 30 | \ 'makeprg': makeprg, 31 | \ 'errorformat': errorformat, 32 | \ 'subtype': 'Style' }) 33 | endfunction 34 | 35 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 36 | \ 'filetype': 'go', 37 | \ 'name': 'golint'}) 38 | -------------------------------------------------------------------------------- /syntax_checkers/tex/lacheck.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: tex.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_tex_lacheck_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_tex_lacheck_checker=1 17 | 18 | function! SyntaxCheckers_tex_lacheck_IsAvailable() 19 | return executable("lacheck") 20 | endfunction 21 | 22 | function! SyntaxCheckers_tex_lacheck_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'lacheck', 25 | \ 'filetype': 'tex', 26 | \ 'subchecker': 'lacheck' }) 27 | 28 | let errorformat = '%-G** %f:,%E"%f"\, line %l: %m' 29 | 30 | return SyntasticMake({ 31 | \ 'makeprg': makeprg, 32 | \ 'errorformat': errorformat }) 33 | endfunction 34 | 35 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 36 | \ 'filetype': 'tex', 37 | \ 'name': 'lacheck'}) 38 | -------------------------------------------------------------------------------- /syntax_checkers/cs/mcs.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: cs.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Daniel Walker 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_cs_mcs_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_cs_mcs_checker=1 17 | 18 | function! SyntaxCheckers_cs_mcs_IsAvailable() 19 | return executable('mcs') 20 | endfunction 21 | 22 | function! SyntaxCheckers_cs_mcs_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'mcs', 25 | \ 'args': '--parse', 26 | \ 'filetype': 'cs', 27 | \ 'subchecker': 'mcs' }) 28 | 29 | let errorformat = '%f(%l\,%c): %trror %m' 30 | 31 | return SyntasticMake({ 32 | \ 'makeprg': makeprg, 33 | \ 'errorformat': errorformat, 34 | \ 'defaults': {'bufnr': bufnr("")} }) 35 | endfunction 36 | 37 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 38 | \ 'filetype': 'cs', 39 | \ 'name': 'mcs'}) 40 | -------------------------------------------------------------------------------- /syntax_checkers/llvm/llvm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: llvm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Andrew Kelley 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_llvm_llvm_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_llvm_llvm_checker=1 16 | 17 | function! SyntaxCheckers_llvm_llvm_IsAvailable() 18 | return executable("llc") 19 | endfunction 20 | 21 | function! SyntaxCheckers_llvm_llvm_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'llc', 24 | \ 'args': syntastic#c#GetNullDevice(), 25 | \ 'filetype': 'llvm', 26 | \ 'subchecker': 'llvm' }) 27 | 28 | let errorformat = 'llc: %f:%l:%c: %trror: %m' 29 | 30 | return SyntasticMake({ 31 | \ 'makeprg': makeprg, 32 | \ 'errorformat': errorformat }) 33 | endfunction 34 | 35 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 36 | \ 'filetype': 'llvm', 37 | \ 'name': 'llvm'}) 38 | 39 | -------------------------------------------------------------------------------- /syntax_checkers/python/python.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: python.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Author: Artem Nezvigin 5 | " 6 | " `errorformat` derived from: 7 | " http://www.vim.org/scripts/download_script.php?src_id=1392 8 | " 9 | "============================================================================ 10 | if exists("g:loaded_syntastic_python_python_checker") 11 | finish 12 | endif 13 | let g:loaded_syntastic_python_python_checker=1 14 | 15 | function! SyntaxCheckers_python_python_IsAvailable() 16 | return executable('python') 17 | endfunction 18 | 19 | function! SyntaxCheckers_python_python_GetLocList() 20 | let fname = "'" . escape(expand('%'), "\\'") . "'" 21 | 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'python', 24 | \ 'args': '-c', 25 | \ 'fname': shellescape("compile(open(" . fname . ").read(), " . fname . ", 'exec')"), 26 | \ 'filetype': 'python', 27 | \ 'subchecker': 'python' }) 28 | 29 | let errorformat = 30 | \ '%E File "%f"\, line %l,' . 31 | \ '%C %p^,' . 32 | \ '%C %.%#,' . 33 | \ '%Z%m,' . 34 | \ '%-G%.%#' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat }) 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'python', 43 | \ 'name': 'python'}) 44 | -------------------------------------------------------------------------------- /syntax_checkers/less/less-lint.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.3.3 2 | (function() { 3 | var args, fs, less, options, parser; 4 | 5 | fs = require('fs'); 6 | 7 | less = require('less'); 8 | 9 | args = process.argv.slice(1); 10 | 11 | options = {}; 12 | 13 | args = args.filter(function(arg) { 14 | var match; 15 | match = arg.match(/^-I(.+)$/); 16 | if (match) { 17 | options.paths.push(match[1]); 18 | return false; 19 | } 20 | match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i); 21 | if (match) { 22 | arg = match[1]; 23 | } else { 24 | return arg; 25 | } 26 | switch (arg) { 27 | case 'strict-imports': 28 | return options.strictImports = true; 29 | case 'include-path': 30 | return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) { 31 | if (p) { 32 | return path.resolve(process.cwd(), p); 33 | } 34 | }); 35 | case 'O0': 36 | return options.optimization = 0; 37 | case 'O1': 38 | return options.optimization = 1; 39 | case 'O2': 40 | return options.optimization = 2; 41 | } 42 | }); 43 | 44 | options.filename = args[1]; 45 | 46 | parser = new less.Parser(options); 47 | 48 | fs.readFile(options.filename, 'utf-8', function(err, data) { 49 | return parser.parse(data, function(err, tree) { 50 | if (err) { 51 | less.writeError(err); 52 | return process.exit(1); 53 | } 54 | }); 55 | }); 56 | 57 | }).call(this); 58 | -------------------------------------------------------------------------------- /syntax_checkers/nroff/mandoc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: mandoc.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_nroff_mandoc_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_nroff_mandoc_checker=1 16 | 17 | function! SyntaxCheckers_nroff_mandoc_IsAvailable() 18 | return executable("mandoc") 19 | endfunction 20 | 21 | function! SyntaxCheckers_nroff_mandoc_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'mandoc', 24 | \ 'args': '-Tlint', 25 | \ 'filetype': 'nroff', 26 | \ 'subchecker': 'mandoc' }) 27 | 28 | let errorformat = 29 | \ '%E%f:%l:%c: %tRROR: %m,' . 30 | \ '%W%f:%l:%c: %tARNING: %m' 31 | 32 | return SyntasticMake({ 33 | \ 'makeprg': makeprg, 34 | \ 'errorformat': errorformat }) 35 | endfunction 36 | 37 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 38 | \ 'filetype': 'nroff', 39 | \ 'name': 'mandoc'}) 40 | 41 | -------------------------------------------------------------------------------- /syntax_checkers/coffee/coffeelint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: coffeelint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Lincoln Stoll 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_coffee_coffeelint_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_coffee_coffeelint_checker=1 16 | 17 | function! SyntaxCheckers_coffee_coffeelint_IsAvailable() 18 | return executable('coffeelint') 19 | endfunction 20 | 21 | function! SyntaxCheckers_coffee_coffeelint_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'coffeelint', 24 | \ 'args': '--csv', 25 | \ 'filetype': 'coffee', 26 | \ 'subchecker': 'coffeelint' }) 27 | 28 | let errorformat = '%f\,%l\,%trror\,%m' 29 | 30 | return SyntasticMake({ 31 | \ 'makeprg': makeprg, 32 | \ 'errorformat': errorformat, 33 | \ 'subtype': 'Style' }) 34 | endfunction 35 | 36 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 37 | \ 'filetype': 'coffee', 38 | \ 'name': 'coffeelint'}) 39 | -------------------------------------------------------------------------------- /syntax_checkers/nasm/nasm.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: nasm.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Håvard Pettersson 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_nasm_nasm_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_nasm_nasm_checker=1 16 | 17 | function! SyntaxCheckers_nasm_nasm_IsAvailable() 18 | return executable("nasm") 19 | endfunction 20 | 21 | function! SyntaxCheckers_nasm_nasm_GetLocList() 22 | let wd = shellescape(expand("%:p:h") . "/") 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'nasm', 25 | \ 'args': '-X gnu -f elf -I ' . wd . ' ' . syntastic#c#GetNullDevice() 26 | \ 'filetype': 'nasm', 27 | \ 'subchecker': 'nasm' }) 28 | 29 | let errorformat = '%f:%l: %t%*[^:]: %m' 30 | 31 | return SyntasticMake({ 32 | \ 'makeprg': makeprg, 33 | \ 'errorformat': errorformat }) 34 | endfunction 35 | 36 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 37 | \ 'filetype': 'nasm', 38 | \ 'name': 'nasm'}) 39 | -------------------------------------------------------------------------------- /syntax_checkers/coq/coqtop.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: coqtop.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Matvey Aksenov 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_coq_coqtop_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_coq_coqtop_checker=1 17 | 18 | function! SyntaxCheckers_coq_coqtop_IsAvailable() 19 | return executable('coqtop') 20 | endfunction 21 | 22 | function! SyntaxCheckers_coq_coqtop_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'coqtop', 25 | \ 'args': '-noglob -batch -load-vernac-source', 26 | \ 'filetype': 'coq', 27 | \ 'subchecker': 'coqtop' }) 28 | 29 | let errorformat = 30 | \ '%AFile \"%f\"\, line %l\, characters %c\-%.%#\:,'. 31 | \ '%C%m' 32 | 33 | return SyntasticMake({ 34 | \ 'makeprg': makeprg, 35 | \ 'errorformat': errorformat }) 36 | endfunction 37 | 38 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 39 | \ 'filetype': 'coq', 40 | \ 'name': 'coqtop'}) 41 | -------------------------------------------------------------------------------- /syntax_checkers/pod/podchecker.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: podchecker.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_pod_podchecker_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_pod_podchecker_checker=1 16 | 17 | function! SyntaxCheckers_pod_podchecker_IsAvailable() 18 | return executable("podchecker") 19 | endfunction 20 | 21 | function! SyntaxCheckers_pod_podchecker_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'podchecker', 24 | \ 'filetype': 'pod', 25 | \ 'subchecker': 'podchecker' }) 26 | 27 | let errorformat = 28 | \ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' . 29 | \ '%E%[%#]%[%#]%[%#] ERROR: %m at line %l in file %f' 30 | 31 | return SyntasticMake({ 32 | \ 'makeprg': makeprg, 33 | \ 'errorformat': errorformat }) 34 | endfunction 35 | 36 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 37 | \ 'filetype': 'pod', 38 | \ 'name': 'podchecker'}) 39 | 40 | -------------------------------------------------------------------------------- /syntax_checkers/cpp/oclint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: oclint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: "UnCO" Lin 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_oclint_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_oclint_config': 16 | " 17 | " let g:syntastic_oclint_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_cpp_oclint_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_cpp_oclint_checker = 1 23 | 24 | runtime syntax_checkers/c/oclint.vim 25 | 26 | function! SyntaxCheckers_cpp_oclint_IsAvailable() 27 | return SyntaxCheckers_c_oclint_IsAvailable() 28 | endfunction 29 | 30 | function! SyntaxCheckers_cpp_oclint_GetLocList() 31 | return SyntaxCheckers_c_oclint_GetLocList() 32 | endfunction 33 | 34 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 35 | \ 'filetype': 'cpp', 36 | \ 'name': 'oclint'}) 37 | -------------------------------------------------------------------------------- /syntax_checkers/objc/oclint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: oclint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: "UnCO" Lin 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_oclint_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_oclint_config': 16 | " 17 | " let g:syntastic_oclint_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_objc_oclint_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_objc_oclint_checker = 1 23 | 24 | runtime syntax_checkers/c/oclint.vim 25 | 26 | function! SyntaxCheckers_objc_oclint_IsAvailable() 27 | return SyntaxCheckers_c_oclint_IsAvailable() 28 | endfunction 29 | 30 | function! SyntaxCheckers_objc_oclint_GetLocList() 31 | return SyntaxCheckers_c_oclint_GetLocList() 32 | endfunction 33 | 34 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 35 | \ 'filetype': 'objc', 36 | \ 'name': 'oclint'}) 37 | -------------------------------------------------------------------------------- /syntax_checkers/json/jsonval.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jsonval.vim 3 | "Description: JSON syntax checker - using jsonval 4 | "Maintainer: Miller Medeiros 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | 12 | if exists("g:loaded_syntastic_json_jsonval_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_json_jsonval_checker=1 16 | 17 | function! SyntaxCheckers_json_jsonval_IsAvailable() 18 | return executable('jsonval') 19 | endfunction 20 | 21 | function! SyntaxCheckers_json_jsonval_GetLocList() 22 | " based on https://gist.github.com/1196345 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'jsonval', 25 | \ 'filetype': 'json', 26 | \ 'subchecker': 'jsonval' }) 27 | 28 | let errorformat = 29 | \ '%E%f:\ %m\ at\ line\ %l,' . 30 | \ '%-G%.%#' 31 | 32 | return SyntasticMake({ 33 | \ 'makeprg': makeprg, 34 | \ 'errorformat': errorformat, 35 | \ 'defaults': {'bufnr': bufnr('')} }) 36 | endfunction 37 | 38 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 39 | \ 'filetype': 'json', 40 | \ 'name': 'jsonval'}) 41 | -------------------------------------------------------------------------------- /syntax_checkers/objcpp/oclint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: oclint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: "UnCO" Lin 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_oclint_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_oclint_config': 16 | " 17 | " let g:syntastic_oclint_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_objcpp_oclint_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_objcpp_oclint_checker = 1 23 | 24 | runtime syntax_checkers/c/oclint.vim 25 | 26 | function! SyntaxCheckers_objcpp_oclint_IsAvailable() 27 | return SyntaxCheckers_c_oclint_IsAvailable() 28 | endfunction 29 | 30 | function! SyntaxCheckers_objcpp_oclint_GetLocList() 31 | return SyntaxCheckers_c_oclint_GetLocList() 32 | endfunction 33 | 34 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 35 | \ 'filetype': 'objcpp', 36 | \ 'name': 'oclint'}) 37 | -------------------------------------------------------------------------------- /syntax_checkers/yaml/jsyaml.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: yaml.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | " 12 | "Installation: $ npm install -g js-yaml 13 | " 14 | "============================================================================ 15 | 16 | if exists("g:loaded_syntastic_yaml_jsyaml_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_yaml_jsyaml_checker=1 20 | 21 | function! SyntaxCheckers_yaml_jsyaml_IsAvailable() 22 | return executable("js-yaml") 23 | endfunction 24 | 25 | function! SyntaxCheckers_yaml_jsyaml_GetLocList() 26 | let makeprg = syntastic#makeprg#build({ 27 | \ 'exe': 'js-yaml', 28 | \ 'args': '--compact', 29 | \ 'filetype': 'yaml', 30 | \ 'subchecker': 'jsyaml' }) 31 | 32 | let errorformat='Error on line %l\, col %c:%m,%-G%.%#' 33 | 34 | return SyntasticMake({ 35 | \ 'makeprg': makeprg, 36 | \ 'errorformat': errorformat, 37 | \ 'defaults': {'bufnr': bufnr("")} }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'yaml', 42 | \ 'name': 'jsyaml'}) 43 | -------------------------------------------------------------------------------- /syntax_checkers/matlab/mlint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: matlab.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Jason Graham 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_matlab_mlint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_matlab_mlint_checker=1 17 | 18 | function! SyntaxCheckers_matlab_mlint_IsAvailable() 19 | return executable("mlint") 20 | endfunction 21 | 22 | function! SyntaxCheckers_matlab_mlint_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'mlint', 25 | \ 'args': '-id $*', 26 | \ 'filetype': 'matlab', 27 | \ 'subchecker': 'mlint' }) 28 | 29 | let errorformat = 30 | \ 'L %l (C %c): %*[a-zA-Z0-9]: %m,'. 31 | \ 'L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m' 32 | 33 | return SyntasticMake({ 34 | \ 'makeprg': makeprg, 35 | \ 'errorformat': errorformat, 36 | \ 'defaults': {'bufnr': bufnr("")} }) 37 | endfunction 38 | 39 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 40 | \ 'filetype': 'matlab', 41 | \ 'name': 'mlint'}) 42 | -------------------------------------------------------------------------------- /syntax_checkers/ruby/macruby.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: macruby.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "License: This program is free software. It comes without any warranty, 5 | " to the extent permitted by applicable law. You can redistribute 6 | " it and/or modify it under the terms of the Do What The Fuck You 7 | " Want To Public License, Version 2, as published by Sam Hocevar. 8 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 9 | " 10 | "============================================================================ 11 | if exists("g:loaded_syntastic_ruby_macruby_checker") 12 | finish 13 | endif 14 | let g:loaded_syntastic_ruby_macruby_checker=1 15 | 16 | function! SyntaxCheckers_ruby_macruby_IsAvailable() 17 | return executable('macruby') 18 | endfunction 19 | 20 | function! SyntaxCheckers_ruby_macruby_GetLocList() 21 | let makeprg = syntastic#makeprg#build({ 22 | \ 'exe': 'RUBYOPT= macruby', 23 | \ 'args': '-W1 -c', 24 | \ 'filetype': 'ruby', 25 | \ 'subchecker': 'macruby' }) 26 | 27 | let errorformat = 28 | \ '%-GSyntax OK,'. 29 | \ '%E%f:%l: syntax error\, %m,'. 30 | \ '%Z%p^,'. 31 | \ '%W%f:%l: warning: %m,'. 32 | \ '%Z%p^,'. 33 | \ '%W%f:%l: %m,'. 34 | \ '%-C%.%#' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat }) 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'ruby', 43 | \ 'name': 'macruby'}) 44 | -------------------------------------------------------------------------------- /autoload/syntastic/postprocess.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_postprocess_autoload") 2 | finish 3 | endif 4 | let g:loaded_syntastic_postprocess_autoload = 1 5 | 6 | let s:save_cpo = &cpo 7 | set cpo&vim 8 | 9 | function! s:compareErrorItems(a, b) 10 | if a:a['bufnr'] != a:b['bufnr'] 11 | " group by files 12 | return a:a['bufnr'] - a:b['bufnr'] 13 | elseif a:a['lnum'] != a:b['lnum'] 14 | return a:a['lnum'] - a:b['lnum'] 15 | elseif a:a['type'] !=? a:b['type'] 16 | " errors take precedence over warnings 17 | return a:a['type'] ==? 'e' ? -1 : 1 18 | else 19 | return get(a:a, 'col') - get(a:b, 'col') 20 | endif 21 | endfunction 22 | 23 | " natural sort 24 | function! syntastic#postprocess#sort(errors) 25 | return sort(a:errors, 's:compareErrorItems') 26 | endfunction 27 | 28 | function syntastic#postprocess#compressWhitespace(errors) 29 | let llist = [] 30 | 31 | for e in a:errors 32 | let e['text'] = substitute(e['text'], '\n', ' ', 'g') 33 | let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g') 34 | call add(llist, e) 35 | endfor 36 | 37 | return llist 38 | endfunction 39 | 40 | " remove spurious CR under Cygwin 41 | function! syntastic#postprocess#cygwinRemoveCR(errors) 42 | if has('win32unix') 43 | let llist = [] 44 | 45 | for e in a:errors 46 | let e['text'] = substitute(e['text'], '\r', '', 'g') 47 | call add(llist, e) 48 | endfor 49 | else 50 | let llist = a:errors 51 | endif 52 | 53 | return llist 54 | endfunction 55 | 56 | let &cpo = s:save_cpo 57 | unlet s:save_cpo 58 | " vim: set et sts=4 sw=4: 59 | -------------------------------------------------------------------------------- /syntax_checkers/scala/scalac.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: scala.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Rickey Visinski 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_scala_scalac_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_scala_scalac_checker=1 17 | 18 | function! SyntaxCheckers_scala_scalac_IsAvailable() 19 | return executable("scalac") 20 | endfunction 21 | 22 | if !exists("g:syntastic_scala_options") 23 | let g:syntastic_scala_options = " " 24 | endif 25 | 26 | 27 | function! SyntaxCheckers_scala_scalac_GetLocList() 28 | let makeprg = syntastic#makeprg#build({ 29 | \ 'exe': 'scalac', 30 | \ 'args': '-Ystop-after:parser '. g:syntastic_scala_options, 31 | \ 'filetype': 'scala', 32 | \ 'subchecker': 'scalac' }) 33 | 34 | let errorformat = '%f\:%l: %trror: %m' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat }) 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'scala', 43 | \ 'name': 'scalac'}) 44 | -------------------------------------------------------------------------------- /syntax_checkers/rust/rustc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: rust.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Chad Jablonski 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_rust_rustc_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_rust_rustc_checker=1 17 | 18 | function! SyntaxCheckers_rust_rustc_IsAvailable() 19 | return executable("rustc") 20 | endfunction 21 | 22 | function! SyntaxCheckers_rust_rustc_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'rustc', 25 | \ 'args': '--parse-only', 26 | \ 'filetype': 'rust', 27 | \ 'subchecker': 'rustc' }) 28 | 29 | let errorformat = 30 | \ '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,' . 31 | \ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' . 32 | \ '%C%f:%l %m,' . 33 | \ '%-Z%.%#' 34 | 35 | return SyntasticMake({ 36 | \ 'makeprg': makeprg, 37 | \ 'errorformat': errorformat }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'rust', 42 | \ 'name': 'rustc'}) 43 | -------------------------------------------------------------------------------- /syntax_checkers/twig/twiglint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: twig.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Alexander 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_twig_twiglint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_twig_twiglint_checker=1 17 | 18 | function! SyntaxCheckers_twig_twiglint_GetHighlightRegex(item) 19 | " Let's match the full line for now 20 | return '\V' 21 | endfunction 22 | 23 | function! SyntaxCheckers_twig_twiglint_IsAvailable() 24 | return executable('twig-lint') 25 | endfunction 26 | 27 | function! SyntaxCheckers_twig_twiglint_GetLocList() 28 | let makeprg = syntastic#makeprg#build({ 29 | \ 'exe': 'twig-lint', 30 | \ 'args': 'lint --format=csv', 31 | \ 'filetype': 'twig', 32 | \ 'subchecker': 'twiglint' }) 33 | 34 | let errorformat = '"%f"\,%l\,%m' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat}) 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'twig', 43 | \ 'name': 'twiglint'}) 44 | -------------------------------------------------------------------------------- /syntax_checkers/sh/checkbashisms.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: checkbashisms.vim 3 | "Description: Shell script syntax/style checking plugin for syntastic.vim 4 | "Notes: checkbashisms.pl can be downloaded from 5 | " http://debian.inode.at/debian/pool/main/d/devscripts/ 6 | " as part of the devscripts package. 7 | "============================================================================ 8 | 9 | if exists("g:loaded_syntastic_sh_checkbashisms_checker") 10 | finish 11 | endif 12 | let g:loaded_syntastic_sh_checkbashisms_checker=1 13 | 14 | 15 | function! SyntaxCheckers_sh_checkbashisms_IsAvailable() 16 | return executable('checkbashisms') 17 | endfunction 18 | 19 | 20 | function! SyntaxCheckers_sh_checkbashisms_GetLocList() 21 | let makeprg = syntastic#makeprg#build({ 22 | \ 'exe': 'checkbashisms', 23 | \ 'args': '-fx', 24 | \ 'filetype': 'sh', 25 | \ 'subchecker': 'checkbashisms'}) 26 | 27 | let errorformat = 28 | \ '%-Gscript %f is already a bash script; skipping,' . 29 | \ '%Eerror: %f: %m\, opened in line %l,' . 30 | \ '%Eerror: %f: %m,' . 31 | \ '%Ecannot open script %f for reading: %m,' . 32 | \ '%Wscript %f %m,%C%.# lines,' . 33 | \ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' . 34 | \ '%-G%.%#' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat, 39 | \ 'subtype': 'Style'}) 40 | endfunction 41 | 42 | 43 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 44 | \ 'filetype': 'sh', 45 | \ 'name': 'checkbashisms'}) 46 | -------------------------------------------------------------------------------- /syntax_checkers/co/coco.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: co.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Andrew Kelley 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_co_coco_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_co_coco_checker=1 16 | 17 | "bail if the user doesnt have coco installed 18 | if !executable("coco") 19 | finish 20 | endif 21 | 22 | function! SyntaxCheckers_co_coco_GetLocList() 23 | return executable('coco') 24 | endfunction 25 | 26 | function! SyntaxCheckers_co_coco_GetLocList() 27 | let makeprg = syntastic#makeprg#build({ 28 | \ 'exe': 'coco', 29 | \ 'args': '-c -o /tmp', 30 | \ 'filetype': 'co', 31 | \ 'subchecker': 'coco' }) 32 | 33 | let errorformat = 34 | \ '%EFailed at: %f,' . 35 | \ '%ZSyntax%trror: %m on line %l,'. 36 | \ '%EFailed at: %f,'. 37 | \ '%Z%trror: Parse error on line %l: %m' 38 | 39 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 40 | endfunction 41 | 42 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 43 | \ 'filetype': 'co', 44 | \ 'name': 'coco'}) 45 | -------------------------------------------------------------------------------- /syntax_checkers/go/govet.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: govet.vim 3 | "Description: Perform static analysis of Go code with the vet tool 4 | "Maintainer: Kamil Kisiel 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_go_govet_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_go_govet_checker=1 16 | 17 | function! SyntaxCheckers_go_govet_IsAvailable() 18 | return executable('go') 19 | endfunction 20 | 21 | function! SyntaxCheckers_go_govet_GetLocList() 22 | let makeprg = 'go vet' 23 | let errorformat = '%Evet: %.%\+: %f:%l:%c: %m,%W%f:%l: %m,%-G%.%#' 24 | 25 | " The go compiler needs to either be run with an import path as an 26 | " argument or directly from the package directory. Since figuring out 27 | " the proper import path is fickle, just cwd to the package. 28 | 29 | let errors = SyntasticMake({ 30 | \ 'makeprg': makeprg, 31 | \ 'errorformat': errorformat, 32 | \ 'cwd': expand('%:p:h'), 33 | \ 'defaults': {'type': 'w'} }) 34 | 35 | return errors 36 | endfunction 37 | 38 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 39 | \ 'filetype': 'go', 40 | \ 'name': 'govet'}) 41 | -------------------------------------------------------------------------------- /syntax_checkers/cucumber/cucumber.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: cucumber.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_cucumber_cucumber_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_cucumber_cucumber_checker=1 17 | 18 | function! SyntaxCheckers_cucumber_cucumber_IsAvailable() 19 | return executable('cucumber') 20 | endfunction 21 | 22 | function! SyntaxCheckers_cucumber_cucumber_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'cucumber', 25 | \ 'args': '--dry-run --quiet --strict --format pretty', 26 | \ 'filetype': 'cucumber', 27 | \ 'subchecker': 'cucumber' }) 28 | 29 | let errorformat = 30 | \ '%f:%l:%c:%m,' . 31 | \ '%W %.%# (%m),' . 32 | \ '%-Z%f:%l:%.%#,'. 33 | \ '%-G%.%#' 34 | 35 | return SyntasticMake({ 36 | \ 'makeprg': makeprg, 37 | \ 'errorformat': errorformat }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'cucumber', 42 | \ 'name': 'cucumber'}) 43 | -------------------------------------------------------------------------------- /syntax_checkers/json/jsonlint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jsonlint.vim 3 | "Description: JSON syntax checker - using jsonlint 4 | "Maintainer: Miller Medeiros 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | 12 | if exists("g:loaded_syntastic_json_jsonlint_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_json_jsonlint_checker=1 16 | 17 | function! SyntaxCheckers_json_jsonlint_IsAvailable() 18 | return executable('jsonlint') 19 | endfunction 20 | 21 | function! SyntaxCheckers_json_jsonlint_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'jsonlint', 24 | \ 'post_args': '--compact', 25 | \ 'filetype': 'json', 26 | \ 'subchecker': 'jsonlint' }) 27 | 28 | let errorformat = 29 | \ '%ELine %l:%c,'. 30 | \ '%Z\\s%#Reason: %m,'. 31 | \ '%C%.%#,'. 32 | \ '%f: line %l\, col %c\, %m,'. 33 | \ '%-G%.%#' 34 | 35 | return SyntasticMake({ 36 | \ 'makeprg': makeprg, 37 | \ 'errorformat': errorformat, 38 | \ 'defaults': {'bufnr': bufnr('')} }) 39 | endfunction 40 | 41 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 42 | \ 'filetype': 'json', 43 | \ 'name': 'jsonlint'}) 44 | -------------------------------------------------------------------------------- /syntax_checkers/go/gofmt.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: gofmt.vim 3 | "Description: Check go syntax using 'gofmt -l' 4 | "Maintainer: Brandon Thomson 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | " This syntax checker does not reformat your source code. 12 | " Use a BufWritePre autocommand to that end: 13 | " autocmd FileType go autocmd BufWritePre Fmt 14 | "============================================================================ 15 | if exists("g:loaded_syntastic_go_gofmt_checker") 16 | finish 17 | endif 18 | let g:loaded_syntastic_go_gofmt_checker=1 19 | 20 | function! SyntaxCheckers_go_gofmt_IsAvailable() 21 | return executable('gofmt') 22 | endfunction 23 | 24 | function! SyntaxCheckers_go_gofmt_GetLocList() 25 | let makeprg = syntastic#makeprg#build({ 26 | \ 'exe': 'gofmt', 27 | \ 'args': '-l', 28 | \ 'tail': '1>' . syntastic#util#DevNull(), 29 | \ 'filetype': 'go', 30 | \ 'subchecker': 'gofmt' }) 31 | 32 | let errorformat = '%f:%l:%c: %m,%-G%.%#' 33 | 34 | return SyntasticMake({ 35 | \ 'makeprg': makeprg, 36 | \ 'errorformat': errorformat, 37 | \ 'defaults': {'type': 'e'} }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'go', 42 | \ 'name': 'gofmt'}) 43 | -------------------------------------------------------------------------------- /syntax_checkers/python/pep8.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: pep8.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For details about pep8 see: https://github.com/jcrocholl/pep8 14 | 15 | if exists("g:loaded_syntastic_python_pep8_checker") 16 | finish 17 | endif 18 | let g:loaded_syntastic_python_pep8_checker=1 19 | 20 | function! SyntaxCheckers_python_pep8_IsAvailable() 21 | return executable('pep8') 22 | endfunction 23 | 24 | function! SyntaxCheckers_python_pep8_GetLocList() 25 | let makeprg = syntastic#makeprg#build({ 26 | \ 'exe': 'pep8', 27 | \ 'filetype': 'python', 28 | \ 'subchecker': 'pep8' }) 29 | 30 | let errorformat = '%f:%l:%c: %m' 31 | 32 | let loclist = SyntasticMake({ 33 | \ 'makeprg': makeprg, 34 | \ 'errorformat': errorformat, 35 | \ 'subtype': 'Style' }) 36 | 37 | for n in range(len(loclist)) 38 | let loclist[n]['type'] = loclist[n]['text'] =~? '^W' ? 'W' : 'E' 39 | endfor 40 | 41 | return loclist 42 | endfunction 43 | 44 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 45 | \ 'filetype': 'python', 46 | \ 'name': 'pep8'}) 47 | -------------------------------------------------------------------------------- /syntax_checkers/haml/haml.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: haml.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_haml_haml_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_haml_haml_checker=1 17 | 18 | if !exists("g:syntastic_haml_interpreter") 19 | let g:syntastic_haml_interpreter = "haml" 20 | endif 21 | 22 | function! SyntaxCheckers_haml_haml_IsAvailable() 23 | return executable(g:syntastic_haml_interpreter) 24 | endfunction 25 | 26 | function! SyntaxCheckers_haml_haml_GetLocList() 27 | let makeprg = syntastic#makeprg#build({ 28 | \ 'exe': g:syntastic_haml_interpreter, 29 | \ 'args': '-c', 30 | \ 'filetype': 'haml', 31 | \ 'subchecker': 'haml' }) 32 | 33 | let errorformat = 34 | \ 'Haml error on line %l: %m,' . 35 | \ 'Syntax error on line %l: %m,' . 36 | \ '%-G%.%#' 37 | 38 | return SyntasticMake({ 39 | \ 'makeprg': makeprg, 40 | \ 'errorformat': errorformat }) 41 | endfunction 42 | 43 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 44 | \ 'filetype': 'haml', 45 | \ 'name': 'haml'}) 46 | -------------------------------------------------------------------------------- /plugin/syntastic/notifiers.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_notifiers") 2 | finish 3 | endif 4 | let g:loaded_syntastic_notifiers = 1 5 | 6 | let g:SyntasticNotifiers = {} 7 | 8 | let s:notifier_types = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist'] 9 | 10 | " Public methods {{{1 11 | 12 | function! g:SyntasticNotifiers.Instance() 13 | if !exists('s:SyntasticNotifiersInstance') 14 | let s:SyntasticNotifiersInstance = copy(self) 15 | call s:SyntasticNotifiersInstance._initNotifiers() 16 | endif 17 | 18 | return s:SyntasticNotifiersInstance 19 | endfunction 20 | 21 | function! g:SyntasticNotifiers.refresh(loclist) 22 | for type in self._enabled_types 23 | let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') 24 | if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled() 25 | call self._notifier[type].refresh(a:loclist) 26 | endif 27 | endfor 28 | endfunction 29 | 30 | function! g:SyntasticNotifiers.reset(loclist) 31 | for type in self._enabled_types 32 | let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') 33 | if has_key(g:{class}, 'reset') && (!has_key(g:{class}, 'enabled') || self._notifier[type].enabled()) 34 | call self._notifier[type].reset(a:loclist) 35 | endif 36 | endfor 37 | endfunction 38 | 39 | " Private methods {{{1 40 | 41 | function! g:SyntasticNotifiers._initNotifiers() 42 | let self._notifier = {} 43 | for type in s:notifier_types 44 | let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') 45 | let self._notifier[type] = g:{class}.New() 46 | endfor 47 | 48 | let self._enabled_types = copy(s:notifier_types) 49 | endfunction 50 | 51 | " vim: set sw=4 sts=4 et fdm=marker: 52 | -------------------------------------------------------------------------------- /syntax_checkers/php/phpcs.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: phpcs.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " See here for details of phpcs 14 | " - phpcs (see http://pear.php.net/package/PHP_CodeSniffer) 15 | " 16 | if exists("g:loaded_syntastic_php_phpcs_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_php_phpcs_checker=1 20 | 21 | function! SyntaxCheckers_php_phpcs_IsAvailable() 22 | return executable('phpcs') 23 | endfunction 24 | 25 | function! SyntaxCheckers_php_phpcs_GetLocList() 26 | let makeprg = syntastic#makeprg#build({ 27 | \ 'exe': 'phpcs', 28 | \ 'args': '--report=csv', 29 | \ 'filetype': 'php', 30 | \ 'subchecker': 'phpcs' }) 31 | 32 | let errorformat = 33 | \ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,'. 34 | \ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]' 35 | 36 | return SyntasticMake({ 37 | \ 'makeprg': makeprg, 38 | \ 'errorformat': errorformat, 39 | \ 'subtype': 'Style' }) 40 | endfunction 41 | 42 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 43 | \ 'filetype': 'php', 44 | \ 'name': 'phpcs'}) 45 | -------------------------------------------------------------------------------- /syntax_checkers/tcl/nagelfar.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: nagelfar.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: James Pickard 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "Notes: Requires nagelfar v1.1.12 or later with support for -H option. 11 | " See nagelfar homepage http://nagelfar.berlios.de/. 12 | " 13 | "============================================================================ 14 | if exists("g:loaded_syntastic_tcl_nagelfar_checker") 15 | finish 16 | endif 17 | let g:loaded_syntastic_tcl_nagelfar_checker=1 18 | 19 | function! SyntaxCheckers_tcl_nagelfar_IsAvailable() 20 | return executable('nagelfar') 21 | endfunction 22 | 23 | function! SyntaxCheckers_tcl_nagelfar_GetLocList() 24 | let makeprg = syntastic#makeprg#build({ 25 | \ 'exe': 'nagelfar', 26 | \ 'args': '-H ' . g:syntastic_tcl_nagelfar_conf, 27 | \ 'filetype': 'tcl', 28 | \ 'subchecker': 'nagelfar' }) 29 | 30 | let errorformat = 31 | \ '%I%f: %l: N %m,'. 32 | \ '%f: %l: %t %m,'. 33 | \ '%-GChecking file %f' 34 | 35 | return SyntasticMake({ 36 | \ 'makeprg': makeprg, 37 | \ 'errorformat': errorformat }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'tcl', 42 | \ 'name': 'nagelfar'}) 43 | -------------------------------------------------------------------------------- /plugin/syntastic/cursor.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_notifier_cursor") 2 | finish 3 | endif 4 | let g:loaded_syntastic_notifier_cursor = 1 5 | 6 | if !exists('g:syntastic_echo_current_error') 7 | let g:syntastic_echo_current_error = 1 8 | endif 9 | 10 | let g:SyntasticCursorNotifier = {} 11 | 12 | " Public methods {{{1 13 | 14 | function! g:SyntasticCursorNotifier.New() 15 | let newObj = copy(self) 16 | return newObj 17 | endfunction 18 | 19 | function! g:SyntasticCursorNotifier.refresh(loclist) 20 | autocmd! syntastic CursorMoved 21 | let enabled = exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error 22 | if enabled && a:loclist.hasErrorsOrWarningsToDisplay() 23 | let b:syntastic_messages = copy(a:loclist.messages()) 24 | let b:oldLine = -1 25 | autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor() 26 | endif 27 | endfunction 28 | 29 | function! g:SyntasticCursorNotifier.reset(loclist) 30 | unlet! b:syntastic_messages 31 | let b:oldLine = -1 32 | endfunction 33 | 34 | " Private methods {{{1 35 | 36 | " The following defensive nonsense is needed because of the nature of autocmd 37 | function! g:SyntasticRefreshCursor() 38 | if !exists('b:syntastic_messages') || empty(b:syntastic_messages) 39 | " file not checked 40 | return 41 | endif 42 | 43 | if !exists('b:oldLine') 44 | let b:oldLine = -1 45 | endif 46 | let l = line('.') 47 | if l == b:oldLine 48 | return 49 | endif 50 | let b:oldLine = l 51 | 52 | if has_key(b:syntastic_messages, l) 53 | call syntastic#util#wideMsg(b:syntastic_messages[l]) 54 | else 55 | echo 56 | endif 57 | endfunction 58 | 59 | " vim: set sw=4 sts=4 et fdm=marker: 60 | -------------------------------------------------------------------------------- /syntax_checkers/elixir/elixir.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: elixir.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Richard Ramsden 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_elixir_elixir_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_elixir_elixir_checker=1 16 | 17 | let s:syntastic_elixir_compile_command = 'elixir' 18 | 19 | if filereadable('mix.exs') 20 | let s:syntastic_elixir_compile_command = 'mix compile' 21 | endif 22 | 23 | function! SyntaxCheckers_elixir_elixir_IsAvailable() 24 | if s:syntastic_elixir_compile_command == 'elixir' 25 | return executable('elixir') 26 | else 27 | return executable('mix') 28 | endif 29 | endfunction 30 | 31 | function! SyntaxCheckers_elixir_elixir_GetLocList() 32 | let makeprg = syntastic#makeprg#build({ 33 | \ 'exe': s:syntastic_elixir_compile_command, 34 | \ 'filetype': 'elixir', 35 | \ 'subchecker': 'elixir' }) 36 | 37 | let errorformat = '** %*[^\ ] %f:%l: %m' 38 | 39 | return SyntasticMake({ 40 | \ 'makeprg': makeprg, 41 | \ 'errorformat': errorformat }) 42 | endfunction 43 | 44 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 45 | \ 'filetype': 'elixir', 46 | \ 'name': 'elixir'}) 47 | -------------------------------------------------------------------------------- /syntax_checkers/gentoo_metadata/xmllint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: gentoo-metadata.vim 3 | "Description: Syntax checking plugin for Gentoo's metadata.xml files 4 | "Maintainer: James Rowe 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | " The DTDs required to validate metadata.xml files are available in 14 | " $PORTDIR/metadata/dtd, and these local files can be used to significantly 15 | " speed up validation. You can create a catalog file with: 16 | " 17 | " xmlcatalog --create --add rewriteURI http://www.gentoo.org/dtd/ \ 18 | " ${PORTDIR:-/usr/portage}/metadata/dtd/ /etc/xml/gentoo 19 | " 20 | " See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more 21 | " information. 22 | 23 | if exists("g:loaded_syntastic_gentoo_metadata_xmllint_checker") 24 | finish 25 | endif 26 | let g:loaded_syntastic_gentoo_metadata_xmllint_checker=1 27 | 28 | runtime syntax_checkers/xml/xmllint.vim 29 | 30 | function! SyntaxCheckers_gentoo_metadata_xmllint_IsAvailable() 31 | return SyntaxCheckers_xml_xmllint_IsAvailable() 32 | endfunction 33 | 34 | function! SyntaxCheckers_gentoo_metadata_xmllint_GetLocList() 35 | return SyntaxCheckers_xml_xmllint_GetLocList() 36 | endfunction 37 | 38 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 39 | \ 'filetype': 'gentoo_metadata', 40 | \ 'name': 'xmllint'}) 41 | -------------------------------------------------------------------------------- /autoload/syntastic/makeprg.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_makeprg_autoload") 2 | finish 3 | endif 4 | let g:loaded_syntastic_makeprg_autoload = 1 5 | 6 | "Returns a makeprg of the form 7 | " 8 | "[exe] [args] [filename] [post_args] [tail] 9 | " 10 | "A (made up) example: 11 | " ruby -a -b -c test_file.rb --more --args > /tmp/output 12 | " 13 | "To generate this you would call: 14 | " 15 | " let makeprg = syntastic#makeprg#build({ 16 | " \ 'exe': 'ruby', 17 | " \ 'args': '-a -b -c', 18 | " \ 'post_args': '--more --args', 19 | " \ 'tail': '> /tmp/output', 20 | " \ 'filetype': 'ruby', 21 | " \ 'subchecker': 'mri' }) 22 | " 23 | "Note that the current filename is added by default - but can be overridden by 24 | "passing in an 'fname' arg. 25 | " 26 | "Arguments 'filetype' and 'subchecker' are mandatory, handling of composite 27 | "types and user-defined variables breaks if you omit them. 28 | " 29 | "All other options can be overriden by the user with global variables - even 30 | "when not specified by the checker in syntastic#makeprg#build(). 31 | " 32 | "E.g. They could override the checker exe with 33 | " 34 | " let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb" 35 | " 36 | "The general form of the override option is: 37 | " syntastic_[filetype]_[subchecker]_[option-name] 38 | " 39 | function! syntastic#makeprg#build(opts) 40 | let builder = g:SyntasticMakeprgBuilder.New( 41 | \ get(a:opts, 'exe', ''), 42 | \ get(a:opts, 'args', ''), 43 | \ get(a:opts, 'fname', ''), 44 | \ get(a:opts, 'post_args', ''), 45 | \ get(a:opts, 'tail', ''), 46 | \ get(a:opts, 'filetype', ''), 47 | \ get(a:opts, 'subchecker', '') ) 48 | 49 | return builder.makeprg() 50 | endfunction 51 | -------------------------------------------------------------------------------- /syntax_checkers/haskell/hdevtools.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: hdevtools.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Anthony Carapetis 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_haskell_hdevtools_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_haskell_hdevtools_checker=1 17 | 18 | function! SyntaxCheckers_haskell_hdevtools_IsAvailable() 19 | return executable('hdevtools') 20 | endfunction 21 | 22 | function! SyntaxCheckers_haskell_hdevtools_GetLocList() 23 | let makeprg = syntastic#makeprg#build({ 24 | \ 'exe': 'hdevtools check', 25 | \ 'args': get(g:, 'hdevtools_options', ''), 26 | \ 'filetype': 'haskell', 27 | \ 'subchecker': 'hdevtools' }) 28 | 29 | let errorformat= '\%-Z\ %#,'. 30 | \ '%W%f:%l:%c:\ Warning:\ %m,'. 31 | \ '%E%f:%l:%c:\ %m,'. 32 | \ '%E%>%f:%l:%c:,'. 33 | \ '%+C\ \ %#%m,'. 34 | \ '%W%>%f:%l:%c:,'. 35 | \ '%+C\ \ %#%tarning:\ %m,' 36 | 37 | return SyntasticMake({ 38 | \ 'makeprg': makeprg, 39 | \ 'errorformat': errorformat, 40 | \ 'postprocess': ['compressWhitespace'] }) 41 | endfunction 42 | 43 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 44 | \ 'filetype': 'haskell', 45 | \ 'name': 'hdevtools'}) 46 | 47 | -------------------------------------------------------------------------------- /syntax_checkers/lisp/clisp.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: lisp.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Karl Yngve Lervåg 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_lisp_clisp_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_lisp_clisp_checker=1 16 | 17 | function! SyntaxCheckers_lisp_clisp_IsAvailable() 18 | return executable("clisp") 19 | endfunction 20 | 21 | function! SyntaxCheckers_lisp_clisp_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': 'clisp', 24 | \ 'args': '-q -c', 25 | \ 'tail': '-o /tmp/clisp-vim-compiled-file', 26 | \ 'filetype': 'lisp', 27 | \ 'subchecker': 'clisp' }) 28 | 29 | let errorformat = 30 | \ '%-G;%.%#,' . 31 | \ '%W%>WARNING:%.%#line %l : %m,' . 32 | \ '%Z %#%m,' . 33 | \ '%W%>WARNING:%.%#lines %l..%\d\# : %m,' . 34 | \ '%Z %#%m,' . 35 | \ '%E%>The following functions were %m,' . 36 | \ '%Z %m,' . 37 | \ '%-G%.%#' 38 | 39 | return SyntasticMake({ 40 | \ 'makeprg': makeprg, 41 | \ 'errorformat': errorformat, 42 | \ 'defaults': {'bufnr': bufnr('')} }) 43 | endfunction 44 | 45 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 46 | \ 'filetype': 'lisp', 47 | \ 'name': 'clisp'}) 48 | -------------------------------------------------------------------------------- /plugin/syntastic/balloons.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_notifier_balloons") 2 | finish 3 | endif 4 | let g:loaded_syntastic_notifier_balloons = 1 5 | 6 | if !exists("g:syntastic_enable_balloons") 7 | let g:syntastic_enable_balloons = 1 8 | endif 9 | 10 | if !has('balloon_eval') 11 | let g:syntastic_enable_balloons = 0 12 | endif 13 | 14 | let g:SyntasticBalloonsNotifier = {} 15 | 16 | " Public methods {{{1 17 | 18 | function! g:SyntasticBalloonsNotifier.New() 19 | let newObj = copy(self) 20 | return newObj 21 | endfunction 22 | 23 | function! g:SyntasticBalloonsNotifier.enabled() 24 | return exists('b:syntastic_enable_balloons') ? b:syntastic_enable_balloons : g:syntastic_enable_balloons 25 | endfunction 26 | 27 | " Update the error balloons 28 | function! g:SyntasticBalloonsNotifier.refresh(loclist) 29 | let b:syntastic_balloons = {} 30 | if a:loclist.hasErrorsOrWarningsToDisplay() 31 | let buf = bufnr('') 32 | let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf') 33 | if !empty(issues) 34 | for i in issues 35 | if has_key(b:syntastic_balloons, i['lnum']) 36 | let b:syntastic_balloons[i['lnum']] .= "\n" . i['text'] 37 | else 38 | let b:syntastic_balloons[i['lnum']] = i['text'] 39 | endif 40 | endfor 41 | set beval bexpr=SyntasticBalloonsExprNotifier() 42 | endif 43 | endif 44 | endfunction 45 | 46 | " Reset the error balloons 47 | function! g:SyntasticBalloonsNotifier.reset(loclist) 48 | set nobeval 49 | endfunction 50 | 51 | " Private functions {{{1 52 | 53 | function! SyntasticBalloonsExprNotifier() 54 | if !exists('b:syntastic_balloons') 55 | return '' 56 | endif 57 | return get(b:syntastic_balloons, v:beval_lnum, '') 58 | endfunction 59 | 60 | " vim: set sw=4 sts=4 et fdm=marker: 61 | -------------------------------------------------------------------------------- /syntax_checkers/z80/z80syntaxchecker.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: z80.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Romain Giot 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_z80_z80syntaxchecker_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_z80_z80syntaxchecker_checker=1 17 | 18 | "bail if the user doesnt have z80_syntax_checker.py installed 19 | "To obtain this application there are two solutions: 20 | " - Install this python package: https://github.com/rgiot/pycpcdemotools 21 | " - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py 22 | function! SyntaxCheckers_z80_z80syntaxchecker_IsAvailable() 23 | return executable("z80_syntax_checker.py") 24 | endfunction 25 | 26 | function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList() 27 | let makeprg = syntastic#makeprg#build({ 28 | \ 'exe': 'z80_syntax_checker.py', 29 | \ 'filetype': 'z80', 30 | \ 'subchecker': 'z80syntaxchecker' }) 31 | 32 | let errorformat = '%f:%l %m' 33 | 34 | return SyntasticMake({ 35 | \ 'makeprg': makeprg, 36 | \ 'errorformat': errorformat }) 37 | endfunction 38 | 39 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 40 | \ 'filetype': 'z80', 41 | \ 'name': 'z80syntaxchecker'}) 42 | -------------------------------------------------------------------------------- /syntax_checkers/ruby/jruby.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jruby.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Leonid Shevtsov 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | if exists("g:loaded_syntastic_ruby_jruby_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_ruby_jruby_checker=1 16 | 17 | function! SyntaxCheckers_ruby_jruby_IsAvailable() 18 | return executable('jruby') 19 | endfunction 20 | 21 | function! SyntaxCheckers_ruby_jruby_GetLocList() 22 | let makeprg = syntastic#makeprg#build({ 23 | \ 'exe': s:exe(), 24 | \ 'args': s:args(), 25 | \ 'filetype': 'ruby', 26 | \ 'subchecker': 'jruby' }) 27 | 28 | let errorformat = 29 | \ '%-GSyntax OK for %f,'. 30 | \ '%ESyntaxError in %f:%l: syntax error\, %m,'. 31 | \ '%Z%p^,'. 32 | \ '%W%f:%l: warning: %m,'. 33 | \ '%Z%p^,'. 34 | \ '%W%f:%l: %m,'. 35 | \ '%-C%.%#' 36 | 37 | return SyntasticMake({ 38 | \ 'makeprg': makeprg, 39 | \ 'errorformat': errorformat }) 40 | endfunction 41 | 42 | function s:args() 43 | return has('win32') ? '-W1 -T1 -c' : '-W1 -c' 44 | endfunction 45 | 46 | function s:exe() 47 | return has('win32') ? 'jruby' : 'RUBYOPT= jruby' 48 | endfunction 49 | 50 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 51 | \ 'filetype': 'ruby', 52 | \ 'name': 'jruby'}) 53 | -------------------------------------------------------------------------------- /syntax_checkers/javascript/gjslint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: gjslint.vim 3 | "Description: Javascript syntax checker - using gjslint 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | if exists("g:loaded_syntastic_javascript_gjslint_checker") 12 | finish 13 | endif 14 | let g:loaded_syntastic_javascript_gjslint_checker=1 15 | 16 | if !exists("g:syntastic_javascript_gjslint_conf") 17 | let g:syntastic_javascript_gjslint_conf = "" 18 | endif 19 | 20 | function! SyntaxCheckers_javascript_gjslint_IsAvailable() 21 | return executable('gjslint') 22 | endfunction 23 | 24 | function! SyntaxCheckers_javascript_gjslint_GetLocList() 25 | let makeprg = syntastic#makeprg#build({ 26 | \ 'exe': 'gjslint', 27 | \ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep", 28 | \ 'filetype': 'javascript', 29 | \ 'subchecker': 'gjslint' }) 30 | 31 | let errorformat = 32 | \ "%f:%l:(New Error -%\\?\%n) %m," . 33 | \ "%f:%l:(-%\\?%n) %m," . 34 | \ "%-G1 files checked," . 35 | \ " no errors found.," . 36 | \ "%-G%.%#" 37 | 38 | return SyntasticMake({ 39 | \ 'makeprg': makeprg, 40 | \ 'errorformat': errorformat }) 41 | endfunction 42 | 43 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 44 | \ 'filetype': 'javascript', 45 | \ 'name': 'gjslint'}) 46 | 47 | -------------------------------------------------------------------------------- /syntax_checkers/zpt/zptlint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: zpt.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: claytron 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_zpt_zptlint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_zpt_zptlint_checker=1 17 | 18 | " In order for this plugin to be useful, you will need to set up the 19 | " zpt filetype in your vimrc 20 | " 21 | " " set up zope page templates as the zpt filetype 22 | " au BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml 23 | " 24 | " Then install the zptlint program, found on pypi: 25 | " http://pypi.python.org/pypi/zptlint 26 | 27 | function! SyntaxCheckers_zpt_zptlint_IsAvailable() 28 | return executable("zptlint") 29 | endfunction 30 | 31 | function! SyntaxCheckers_zpt_zptlint_GetLocList() 32 | let makeprg = syntastic#makeprg#build({ 33 | \ 'exe': 'zptlint', 34 | \ 'filetype': 'zpt', 35 | \ 'subchecker': 'zptlint' }) 36 | 37 | let errorformat= 38 | \ '%-P*** Error in: %f,'. 39 | \ '%Z%*\s\, at line %l\, column %c,'. 40 | \ '%E%*\s%m,'. 41 | \ '%-Q' 42 | 43 | return SyntasticMake({ 44 | \ 'makeprg': makeprg, 45 | \ 'errorformat': errorformat }) 46 | endfunction 47 | 48 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 49 | \ 'filetype': 'zpt', 50 | \ 'name': 'zptlint'}) 51 | -------------------------------------------------------------------------------- /syntax_checkers/c/checkpatch.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: checkpatch.vim 3 | "Description: Syntax checking plugin for syntastic.vim using checkpatch.pl 4 | "Maintainer: Daniel Walker 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | if exists("g:loaded_syntastic_c_checkpatch_checker") 12 | finish 13 | endif 14 | let g:loaded_syntastic_c_checkpatch_checker = 1 15 | 16 | " Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed. 17 | if executable("checkpatch.pl") 18 | let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl' 19 | elseif executable("./scripts/checkpatch.pl") 20 | let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl' 21 | endif 22 | 23 | function SyntaxCheckers_c_checkpatch_IsAvailable() 24 | return exists("g:syntastic_c_checker_checkpatch_location") 25 | endfunction 26 | 27 | 28 | function! SyntaxCheckers_c_checkpatch_GetLocList() 29 | let makeprg = syntastic#makeprg#build({ 30 | \ 'exe': g:syntastic_c_checker_checkpatch_location, 31 | \ 'args': '--no-summary --no-tree --terse --file', 32 | \ 'filetype': 'c', 33 | \ 'subchecker': 'checkpatch' }) 34 | 35 | let errorformat = 36 | \ '%f:%l: %tARNING: %m,' . 37 | \ '%f:%l: %tRROR: %m' 38 | 39 | return SyntasticMake({ 40 | \ 'makeprg': makeprg, 41 | \ 'errorformat': errorformat, 42 | \ 'subtype': 'Style' }) 43 | endfunction 44 | 45 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 46 | \ 'filetype': 'c', 47 | \ 'name': 'checkpatch'}) 48 | -------------------------------------------------------------------------------- /syntax_checkers/coffee/coffee.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: coffee.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Lincoln Stoll 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " Note: this script requires CoffeeScript version 1.6.2 or newer. 14 | " 15 | if exists("g:loaded_syntastic_coffee_coffee_checker") 16 | finish 17 | endif 18 | let g:loaded_syntastic_coffee_coffee_checker=1 19 | 20 | function! SyntaxCheckers_coffee_coffee_IsAvailable() 21 | return executable("coffee") && 22 | \ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2]) 23 | endfunction 24 | 25 | function! SyntaxCheckers_coffee_coffee_GetLocList() 26 | let makeprg = syntastic#makeprg#build({ 27 | \ 'exe': 'coffee', 28 | \ 'args': '-cp', 29 | \ 'filetype': 'coffee', 30 | \ 'subchecker': 'coffee' }) 31 | 32 | let errorformat = 33 | \ '%E%f:%l:%c: %trror: %m,' . 34 | \ 'Syntax%trror: In %f\, %m on line %l,' . 35 | \ '%EError: In %f\, Parse error on line %l: %m,' . 36 | \ '%EError: In %f\, %m on line %l,' . 37 | \ '%W%f(%l): lint warning: %m,' . 38 | \ '%W%f(%l): warning: %m,' . 39 | \ '%E%f(%l): SyntaxError: %m,' . 40 | \ '%-Z%p^,' . 41 | \ '%-G%.%#' 42 | 43 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 44 | endfunction 45 | 46 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 47 | \ 'filetype': 'coffee', 48 | \ 'name': 'coffee'}) 49 | -------------------------------------------------------------------------------- /syntax_checkers/ruby/rubocop.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: rubocop.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Recai Oktaş 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " In order to use rubocop with the default ruby checker (mri): 14 | " let g:syntastic_ruby_checkers = ['mri', 'rubocop'] 15 | 16 | if exists("g:loaded_syntastic_ruby_rubocop_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_ruby_rubocop_checker=1 20 | 21 | function! SyntaxCheckers_ruby_rubocop_IsAvailable() 22 | return executable('rubocop') 23 | endfunction 24 | 25 | function! SyntaxCheckers_ruby_rubocop_GetLocList() 26 | let makeprg = syntastic#makeprg#build({ 27 | \ 'exe': 'rubocop', 28 | \ 'args': '--emacs --silent', 29 | \ 'filetype': 'ruby', 30 | \ 'subchecker': 'rubocop' }) 31 | 32 | let errorformat = '%f:%l:\ %t:\ %m' 33 | 34 | let loclist = SyntasticMake({ 35 | \ 'makeprg': makeprg, 36 | \ 'errorformat': errorformat, 37 | \ 'subtype': 'Style'}) 38 | 39 | " convert rubocop severities to error types recognized by syntastic 40 | for n in range(len(loclist)) 41 | if loclist[n]['type'] == 'F' 42 | let loclist[n]['type'] = 'E' 43 | elseif loclist[n]['type'] != 'W' && loclist[n]['type'] != 'E' 44 | let loclist[n]['type'] = 'W' 45 | endif 46 | endfor 47 | 48 | return loclist 49 | endfunction 50 | 51 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 52 | \ 'filetype': 'ruby', 53 | \ 'name': 'rubocop'}) 54 | -------------------------------------------------------------------------------- /syntax_checkers/rst/rst2pseudoxml.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: rst.vim 3 | "Description: Syntax checking plugin for docutil's reStructuredText files 4 | "Maintainer: James Rowe 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | " We use rst2pseudoxml.py, as it is ever so marginally faster than the other 14 | " rst2${x} tools in docutils. 15 | 16 | if exists("g:loaded_syntastic_rst_rst2pseudoxml_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_rst_rst2pseudoxml_checker=1 20 | 21 | function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() 22 | return executable("rst2pseudoxml.py") || executable("rst2pseudoxml") 23 | endfunction 24 | 25 | function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() 26 | let makeprg = syntastic#makeprg#build({ 27 | \ 'exe': s:exe(), 28 | \ 'args': '--report=2 --exit-status=1', 29 | \ 'tail': syntastic#util#DevNull(), 30 | \ 'filetype': 'rst', 31 | \ 'subchecker': 'rst2pseudoxml' }) 32 | 33 | let errorformat = 34 | \ '%f:%l:\ (%tNFO/1)\ %m,'. 35 | \ '%f:%l:\ (%tARNING/2)\ %m,'. 36 | \ '%f:%l:\ (%tRROR/3)\ %m,'. 37 | \ '%f:%l:\ (%tEVERE/4)\ %m,'. 38 | \ '%-G%.%#' 39 | 40 | return SyntasticMake({ 41 | \ 'makeprg': makeprg, 42 | \ 'errorformat': errorformat }) 43 | endfunction 44 | 45 | function s:exe() 46 | return executable("rst2pseudoxml.py") ? "rst2pseudoxml.py" : "rst2pseudoxml" 47 | endfunction 48 | 49 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 50 | \ 'filetype': 'rst', 51 | \ 'name': 'rst2pseudoxml'}) 52 | -------------------------------------------------------------------------------- /syntax_checkers/javascript/jsl.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jsl.vim 3 | "Description: Javascript syntax checker - using jsl 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | if exists("g:loaded_syntastic_javascript_jsl_checker") 12 | finish 13 | endif 14 | let g:loaded_syntastic_javascript_jsl_checker=1 15 | 16 | if !exists("g:syntastic_javascript_jsl_conf") 17 | let g:syntastic_javascript_jsl_conf = "" 18 | endif 19 | 20 | function s:ConfFlag() 21 | if !empty(g:syntastic_javascript_jsl_conf) 22 | return "-conf " . g:syntastic_javascript_jsl_conf 23 | endif 24 | 25 | return "" 26 | endfunction 27 | 28 | function! SyntaxCheckers_javascript_jsl_IsAvailable() 29 | return executable('jsl') 30 | endfunction 31 | 32 | function! SyntaxCheckers_javascript_jsl_GetLocList() 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'jsl', 35 | \ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process", 36 | \ 'filetype': 'javascript', 37 | \ 'subchecker': 'jsl' }) 38 | 39 | let errorformat = 40 | \ '%W%f(%l): lint warning: %m,'. 41 | \ '%-Z%p^,'. 42 | \ '%W%f(%l): warning: %m,'. 43 | \ '%-Z%p^,'. 44 | \ '%E%f(%l): SyntaxError: %m,'. 45 | \ '%-Z%p^,'. 46 | \ '%-G' 47 | 48 | return SyntasticMake({ 49 | \ 'makeprg': makeprg, 50 | \ 'errorformat': errorformat }) 51 | endfunction 52 | 53 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 54 | \ 'filetype': 'javascript', 55 | \ 'name': 'jsl'}) 56 | 57 | -------------------------------------------------------------------------------- /syntax_checkers/php/php.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: php.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_php_php_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_php_php_checker=1 17 | 18 | function! SyntaxCheckers_php_php_IsAvailable() 19 | return executable("php") 20 | endfunction 21 | 22 | function! SyntaxCheckers_php_php_GetHighlightRegex(item) 23 | let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'") 24 | if len(unexpected) < 1 25 | return '' 26 | endif 27 | return '\V'.split(unexpected, "'")[1] 28 | endfunction 29 | 30 | function! SyntaxCheckers_php_php_GetLocList() 31 | let makeprg = syntastic#makeprg#build({ 32 | \ 'exe': 'php', 33 | \ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0', 34 | \ 'filetype': 'php', 35 | \ 'subchecker': 'php' }) 36 | 37 | let errorformat = 38 | \ '%-GNo syntax errors detected in%.%#,'. 39 | \ 'Parse error: %#syntax %trror\, %m in %f on line %l,'. 40 | \ 'Parse %trror: %m in %f on line %l,'. 41 | \ 'Fatal %trror: %m in %f on line %l,'. 42 | \ '%-G\s%#,'. 43 | \ '%-GErrors parsing %.%#' 44 | 45 | return SyntasticMake({ 46 | \ 'makeprg': makeprg, 47 | \ 'errorformat': errorformat }) 48 | endfunction 49 | 50 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 51 | \ 'filetype': 'php', 52 | \ 'name': 'php'}) 53 | -------------------------------------------------------------------------------- /syntax_checkers/python/flake8.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: flake8.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Authors: Sylvain Soliman 5 | " kstep 6 | " 7 | "============================================================================ 8 | if exists("g:loaded_syntastic_python_flake8_checker") 9 | finish 10 | endif 11 | let g:loaded_syntastic_python_flake8_checker=1 12 | 13 | function! SyntaxCheckers_python_flake8_IsAvailable() 14 | return executable('flake8') 15 | endfunction 16 | 17 | function! SyntaxCheckers_python_flake8_GetHighlightRegex(i) 18 | if match(a:i['text'], 'is assigned to but never used') > -1 19 | \ || match(a:i['text'], 'imported but unused') > -1 20 | \ || match(a:i['text'], 'undefined name') > -1 21 | \ || match(a:i['text'], 'redefinition of') > -1 22 | \ || match(a:i['text'], 'referenced before assignment') > -1 23 | \ || match(a:i['text'], 'duplicate argument') > -1 24 | \ || match(a:i['text'], 'after other statements') > -1 25 | \ || match(a:i['text'], 'shadowed by loop variable') > -1 26 | 27 | let term = split(a:i['text'], "'", 1)[1] 28 | return '\V\<'.term.'\>' 29 | endif 30 | return '' 31 | endfunction 32 | 33 | function! SyntaxCheckers_python_flake8_GetLocList() 34 | let makeprg = syntastic#makeprg#build({ 35 | \ 'exe': 'flake8', 36 | \ 'filetype': 'python', 37 | \ 'subchecker': 'flake8' }) 38 | 39 | let errorformat = 40 | \ '%E%f:%l: could not compile,%-Z%p^,'. 41 | \ '%W%f:%l:%c: F%n %m,'. 42 | \ '%W%f:%l:%c: C%n %m,'. 43 | \ '%E%f:%l:%c: %t%n %m,'. 44 | \ '%E%f:%l: %t%n %m,'. 45 | \ '%-G%.%#' 46 | 47 | return SyntasticMake({ 48 | \ 'makeprg': makeprg, 49 | \ 'errorformat': errorformat }) 50 | endfunction 51 | 52 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 53 | \ 'filetype': 'python', 54 | \ 'name': 'flake8'}) 55 | -------------------------------------------------------------------------------- /syntax_checkers/xml/xmllint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: xml.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Sebastian Kusnier 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_xml_xmllint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_xml_xmllint_checker=1 17 | 18 | " You can use a local installation of DTDs to significantly speed up validation 19 | " and allow you to validate XML data without network access, see xmlcatalog(1) 20 | " and http://www.xmlsoft.org/catalog.html for more information. 21 | 22 | function! SyntaxCheckers_xml_xmllint_IsAvailable() 23 | return executable('xmllint') 24 | endfunction 25 | 26 | function! SyntaxCheckers_xml_xmllint_GetLocList() 27 | let makeprg = syntastic#makeprg#build({ 28 | \ 'exe': 'xmllint', 29 | \ 'args': '--xinclude --noout --postvalid', 30 | \ 'filetype': 'xml', 31 | \ 'subchecker': 'xmllint' }) 32 | 33 | let errorformat= 34 | \ '%E%f:%l: error : %m,' . 35 | \ '%-G%f:%l: validity error : Validation failed: no DTD found %m,' . 36 | \ '%W%f:%l: warning : %m,' . 37 | \ '%W%f:%l: validity warning : %m,' . 38 | \ '%E%f:%l: validity error : %m,' . 39 | \ '%E%f:%l: parser error : %m,' . 40 | \ '%E%f:%l: %m,' . 41 | \ '%-Z%p^,' . 42 | \ '%-G%.%#' 43 | 44 | return SyntasticMake({ 45 | \ 'makeprg': makeprg, 46 | \ 'errorformat': errorformat }) 47 | endfunction 48 | 49 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 50 | \ 'filetype': 'xml', 51 | \ 'name': 'xmllint'}) 52 | -------------------------------------------------------------------------------- /syntax_checkers/text/atdtool.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: atdtool.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_text_atdtool_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_text_atdtool_checker = 1 17 | 18 | function! SyntaxCheckers_text_atdtool_IsAvailable() 19 | return executable('atdtool') 20 | endfunction 21 | 22 | function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item) 23 | let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)') 24 | if term != '' 25 | let col = get(a:item, 'col', 0) 26 | let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . term 27 | endif 28 | return term 29 | endfunction 30 | 31 | function! SyntaxCheckers_text_atdtool_GetLocList() 32 | let makeprg = syntastic#makeprg#build({ 33 | \ 'exe': 'atdtool', 34 | \ 'tail': '2>' . syntastic#util#DevNull(), 35 | \ 'filetype': 'text', 36 | \ 'subchecker': 'atdtool' }) 37 | 38 | let errorformat = 39 | \ '%W%f:%l:%c: %m,'. 40 | \ '%+C suggestions:%.%#' 41 | 42 | let loclist = SyntasticMake({ 43 | \ 'makeprg': makeprg, 44 | \ 'errorformat': errorformat, 45 | \ 'subtype': 'Style' }) 46 | 47 | for n in range(len(loclist)) 48 | let loclist[n]['text'] = substitute(loclist[n]['text'], '\n\s\+', ' | ', 'g') 49 | endfor 50 | 51 | return loclist 52 | endfunction 53 | 54 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 55 | \ 'filetype': 'text', 56 | \ 'name': 'atdtool'}) 57 | -------------------------------------------------------------------------------- /syntax_checkers/erlang/erlang.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: erlang.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Pawel Salata 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_erlang_erlang_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_erlang_erlang_checker=1 17 | 18 | let s:check_file = expand(':p:h') . '/erlang_check_file.erl' 19 | if !exists("g:syntastic_erlc_include_path") 20 | let g:syntastic_erlc_include_path="" 21 | endif 22 | 23 | function! SyntaxCheckers_erlang_escript_IsAvailable() 24 | return executable('escript') 25 | endfunction 26 | 27 | function! SyntaxCheckers_erlang_escript_GetLocList() 28 | let extension = expand('%:e') 29 | if match(extension, 'hrl') >= 0 30 | return [] 31 | endif 32 | let shebang = getbufline(bufnr('%'), 1)[0] 33 | if len(shebang) > 0 34 | if match(shebang, 'escript') >= 0 35 | let makeprg = 'escript -s '.shellescape(expand('%:p')) 36 | else 37 | let makeprg = 'escript ' . s:check_file . ' '. shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path 38 | endif 39 | else 40 | let makeprg = 'escript ' . s:check_file . ' ' . shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path 41 | endif 42 | let errorformat = 43 | \ '%f:%l:\ %tarning:\ %m,'. 44 | \ '%E%f:%l:\ %m' 45 | 46 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 47 | endfunction 48 | 49 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 50 | \ 'filetype': 'erlang', 51 | \ 'name': 'escript'}) 52 | -------------------------------------------------------------------------------- /plugin/syntastic/makeprg_builder.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_makeprg_builder") 2 | finish 3 | endif 4 | let g:loaded_syntastic_makeprg_builder = 1 5 | 6 | let g:SyntasticMakeprgBuilder = {} 7 | 8 | " Public methods {{{1 9 | 10 | function! g:SyntasticMakeprgBuilder.New(exe, args, fname, post_args, tail, filetype, subchecker) 11 | let newObj = copy(self) 12 | let newObj._exe = a:exe 13 | let newObj._args = a:args 14 | let newObj._fname = a:fname 15 | let newObj._post_args = a:post_args 16 | let newObj._tail = a:tail 17 | let newObj._filetype = empty(a:filetype) ? &filetype : a:filetype 18 | let newObj._subchecker = a:subchecker 19 | return newObj 20 | endfunction 21 | 22 | function! g:SyntasticMakeprgBuilder.makeprg() 23 | return join([self.exe(), self.args(), self.fname(), self.post_args(), self.tail()]) 24 | endfunction 25 | 26 | function! g:SyntasticMakeprgBuilder.exe() 27 | return self._getOpt('exe') 28 | endfunction 29 | 30 | function! g:SyntasticMakeprgBuilder.args() 31 | return self._getOpt('args') 32 | endfunction 33 | 34 | function! g:SyntasticMakeprgBuilder.fname() 35 | if empty(self._fname) 36 | return shellescape(expand("%")) 37 | else 38 | return self._fname 39 | endif 40 | endfunction 41 | 42 | function! g:SyntasticMakeprgBuilder.post_args() 43 | return self._getOpt('post_args') 44 | endfunction 45 | 46 | function! g:SyntasticMakeprgBuilder.tail() 47 | return self._getOpt('tail') 48 | endfunction 49 | 50 | " Private methods {{{1 51 | 52 | function g:SyntasticMakeprgBuilder._getOpt(name) 53 | if self._optExists(a:name) 54 | return {self._optName(a:name)} 55 | endif 56 | 57 | return self['_' . a:name] 58 | endfunction 59 | 60 | function! g:SyntasticMakeprgBuilder._optExists(name) 61 | return exists(self._optName(a:name)) 62 | endfunction 63 | 64 | function! g:SyntasticMakeprgBuilder._optName(name) 65 | let setting = "g:syntastic_" . self._filetype 66 | if !empty(self._subchecker) 67 | let setting .= '_' . self._subchecker 68 | endif 69 | return setting . '_' . a:name 70 | endfunction 71 | 72 | " vim: set sw=4 sts=4 et fdm=marker: 73 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Bug reports / Github issues 2 | 3 | When reporting a bug make sure you search the existing github issues for the 4 | same/similar issues. If you find one, feel free to add a `+1` comment with any 5 | additonal information that may help us solve the issue. 6 | 7 | When creating a new issue be sure to state the following: 8 | 9 | * Steps to reproduce the bug. 10 | * The version of vim you are using. 11 | * The version of syntastic you are using. 12 | 13 | For syntax checker bugs also state the version of the checker executable that you are using. 14 | 15 | # Submitting a patch 16 | 17 | * Fork the repo on github 18 | * Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking 19 | * Submit a pull request based off your topic branch 20 | 21 | Small focused patches are preferred. 22 | 23 | Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say. 24 | 25 | # General style notes 26 | 27 | Following the coding conventions/styles used in the syntastic core: 28 | 29 | * Use 4 space indents. 30 | * Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!). 31 | * Dont use `l:` prefixes for variables unless actually required (i.e. almost never). 32 | * Code for maintainabiliy. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability. 33 | 34 | # Syntax checker style notes 35 | 36 | The preferred style for error format strings is one "clause" per line. E.g. 37 | (from the coffeelint checker): 38 | 39 | ```viml 40 | let errorformat = '%E%f:%l:%c: %trror: %m,' . 41 | \ 'Syntax%trror: In %f\, %m on line %l,' . 42 | \ '%EError: In %f\, Parse error on line %l: %m,' . 43 | \ '%EError: In %f\, %m on line %l,' . 44 | \ '%W%f(%l): lint warning: %m,' . 45 | \ '%W%f(%l): warning: %m,' . 46 | \ '%E%f(%l): SyntaxError: %m,' . 47 | \ '%-Z%p^,' . 48 | \ '%-G%.%#' 49 | ``` 50 | -------------------------------------------------------------------------------- /syntax_checkers/applescript/osacompile.vim: -------------------------------------------------------------------------------- 1 | "============================================================================== 2 | " FileName: applescript.vim 3 | " Desc: Syntax checking plugin for syntastic.vim 4 | " Author: Zhao Cai 5 | " Email: caizhaoff@gmail.com 6 | " Version: 0.2.1 7 | " Date Created: Thu 09 Sep 2011 10:30:09 AM EST 8 | " Last Modified: Fri 09 Dec 2011 01:10:24 PM EST 9 | " 10 | " History: 0.1.0 - working, but it will run the script everytime to check 11 | " syntax. Should use osacompile but strangely it does not give 12 | " errors. 13 | " 14 | " 0.2.0 - switch to osacompile, it gives less errors compared 15 | " with osascript. 16 | " 17 | " 0.2.1 - remove g:syntastic_applescript_tempfile. use 18 | " tempname() instead. 19 | " 20 | " License: This program is free software. It comes without any 21 | " warranty, to the extent permitted by applicable law. You can 22 | " redistribute it and/or modify it under the terms of the Do What The 23 | " Fuck You Want To Public License, Version 2, as published by Sam 24 | " Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. 25 | " 26 | "============================================================================ 27 | 28 | if exists("g:loaded_syntastic_applescript_osacompile_checker") 29 | finish 30 | endif 31 | let g:loaded_syntastic_applescript_osacompile_checker=1 32 | 33 | function! SyntaxCheckers_applescript_osacompile_IsAvailable() 34 | return executable('osacompile') 35 | endfunction 36 | 37 | function! SyntaxCheckers_applescript_osacompile_GetLocList() 38 | let makeprg = syntastic#makeprg#build({ 39 | \ 'exe': 'osacompile', 40 | \ 'args': '-o ' . tempname() . '.scpt ', 41 | \ 'filetype': 'applescript', 42 | \ 'subchecker': 'osacompile' }) 43 | let errorformat = '%f:%l:%m' 44 | 45 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 46 | endfunction 47 | 48 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 49 | \ 'filetype': 'applescript', 50 | \ 'name': 'osacompile'}) 51 | -------------------------------------------------------------------------------- /syntax_checkers/c/sparse.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: sparse.vim 3 | "Description: Syntax checking plugin for syntastic.vim using sparse.pl 4 | "Maintainer: Daniel Walker 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_sparse_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_sparse_config': 16 | " 17 | " let g:syntastic_sparse_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_c_sparse_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_c_sparse_checker = 1 23 | 24 | function! SyntaxCheckers_c_sparse_IsAvailable() 25 | return executable("sparse") 26 | endfunction 27 | 28 | if !exists('g:syntastic_sparse_config_file') 29 | let g:syntastic_sparse_config_file = '.syntastic_sparse_config' 30 | endif 31 | 32 | function! SyntaxCheckers_c_sparse_GetLocList() 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'sparse', 35 | \ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file), 36 | \ 'filetype': 'c', 37 | \ 'subchecker': 'sparse' }) 38 | 39 | let errorformat = '%f:%l:%v: %trror: %m,%f:%l:%v: %tarning: %m,' 40 | 41 | let loclist = SyntasticMake({ 42 | \ 'makeprg': makeprg, 43 | \ 'errorformat': errorformat, 44 | \ 'defaults': {'bufnr': bufnr("")} }) 45 | return loclist 46 | endfunction 47 | 48 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 49 | \ 'filetype': 'c', 50 | \ 'name': 'sparse'}) 51 | -------------------------------------------------------------------------------- /plugin/syntastic/modemap.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_modemap") 2 | finish 3 | endif 4 | let g:loaded_syntastic_modemap = 1 5 | 6 | let g:SyntasticModeMap = {} 7 | 8 | " Public methods {{{1 9 | 10 | function! g:SyntasticModeMap.Instance() 11 | if !exists('s:SyntasticModeMapInstance') 12 | let s:SyntasticModeMapInstance = copy(self) 13 | call s:SyntasticModeMapInstance._initModeMapFromGlobalOpts() 14 | endif 15 | 16 | return s:SyntasticModeMapInstance 17 | endfunction 18 | 19 | function! g:SyntasticModeMap.allowsAutoChecking(filetype) 20 | let fts = split(a:filetype, '\.') 21 | 22 | if self.isPassive() 23 | return self._isOneFiletypeActive(fts) 24 | else 25 | return self._noFiletypesArePassive(fts) 26 | endif 27 | endfunction 28 | 29 | function! g:SyntasticModeMap.isPassive() 30 | return self._mode == "passive" 31 | endfunction 32 | 33 | function! g:SyntasticModeMap.toggleMode() 34 | if self._mode == "active" 35 | let self._mode = "passive" 36 | else 37 | let self._mode = "active" 38 | endif 39 | endfunction 40 | 41 | function! g:SyntasticModeMap.echoMode() 42 | echo "Syntastic: " . self._mode . " mode enabled" 43 | endfunction 44 | 45 | " Private methods {{{1 46 | 47 | function! g:SyntasticModeMap._initModeMapFromGlobalOpts() 48 | let self._mode = "active" 49 | let self._activeFiletypes = [] 50 | let self._passiveFiletypes = [] 51 | 52 | if exists("g:syntastic_mode_map") 53 | let self._mode = get(g:syntastic_mode_map, 'mode', self._mode) 54 | let self._activeFiletypes = get(g:syntastic_mode_map, 'active_filetypes', self._activeFiletypes) 55 | let self._passiveFiletypes = get(g:syntastic_mode_map, 'passive_filetypes', self._passiveFiletypes) 56 | endif 57 | endfunction 58 | 59 | function! g:SyntasticModeMap._isOneFiletypeActive(filetypes) 60 | return !empty(filter(a:filetypes, 'index(self._activeFiletypes, v:val) != -1')) 61 | endfunction 62 | 63 | function! g:SyntasticModeMap._noFiletypesArePassive(filetypes) 64 | return empty(filter(a:filetypes, 'index(self._passiveFiletypes, v:val) != -1')) 65 | endfunction 66 | 67 | " vim: set sw=4 sts=4 et fdm=marker: 68 | -------------------------------------------------------------------------------- /syntax_checkers/css/csslint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: css.vim 3 | "Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net). 4 | "Maintainer: Ory Band 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " Specify additional options to csslint with this option. e.g. to disable 13 | " warnings: 14 | " 15 | " let g:syntastic_csslint_options = "--warnings=none" 16 | 17 | if exists("g:loaded_syntastic_css_csslint_checker") 18 | finish 19 | endif 20 | let g:loaded_syntastic_css_csslint_checker=1 21 | 22 | if !exists('g:syntastic_csslint_options') 23 | let g:syntastic_csslint_options = "" 24 | endif 25 | 26 | function! SyntaxCheckers_css_csslint_IsAvailable() 27 | return executable('csslint') 28 | endfunction 29 | 30 | function! SyntaxCheckers_css_csslint_GetLocList() 31 | let makeprg = syntastic#makeprg#build({ 32 | \ 'exe': 'csslint', 33 | \ 'args': '--format=compact ' . g:syntastic_csslint_options, 34 | \ 'filetype': 'css', 35 | \ 'subchecker': 'csslint' }) 36 | 37 | " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. 38 | let errorformat = 39 | \ '%-G,' . 40 | \ '%-G%f: lint free!,' . 41 | \ '%f: line %l\, col %c\, %trror - %m,' . 42 | \ '%f: line %l\, col %c\, %tarning - %m,'. 43 | \ '%f: line %l\, col %c\, %m,' 44 | 45 | return SyntasticMake({ 46 | \ 'makeprg': makeprg, 47 | \ 'errorformat': errorformat, 48 | \ 'defaults': {'bufnr': bufnr("")} }) 49 | 50 | endfunction 51 | 52 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 53 | \ 'filetype': 'css', 54 | \ 'name': 'csslint'}) 55 | -------------------------------------------------------------------------------- /syntax_checkers/python/pyflakes.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: pyflakes.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Authors: Martin Grenfell 5 | " kstep 6 | " Parantapa Bhattacharya 7 | " 8 | "============================================================================ 9 | if exists("g:loaded_syntastic_python_pyflakes_checker") 10 | finish 11 | endif 12 | let g:loaded_syntastic_python_pyflakes_checker=1 13 | 14 | function! SyntaxCheckers_python_pyflakes_IsAvailable() 15 | return executable('pyflakes') 16 | endfunction 17 | 18 | function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i) 19 | if match(a:i['text'], 'is assigned to but never used') > -1 20 | \ || match(a:i['text'], 'imported but unused') > -1 21 | \ || match(a:i['text'], 'undefined name') > -1 22 | \ || match(a:i['text'], 'redefinition of') > -1 23 | \ || match(a:i['text'], 'referenced before assignment') > -1 24 | \ || match(a:i['text'], 'duplicate argument') > -1 25 | \ || match(a:i['text'], 'after other statements') > -1 26 | \ || match(a:i['text'], 'shadowed by loop variable') > -1 27 | 28 | let term = split(a:i['text'], "'", 1)[1] 29 | return '\V\<'.term.'\>' 30 | endif 31 | return '' 32 | endfunction 33 | 34 | function! SyntaxCheckers_python_pyflakes_GetLocList() 35 | let makeprg = syntastic#makeprg#build({ 36 | \ 'exe': 'pyflakes', 37 | \ 'filetype': 'python', 38 | \ 'subchecker': 'pyflakes' }) 39 | 40 | let errorformat = 41 | \ '%E%f:%l: could not compile,'. 42 | \ '%-Z%p^,'. 43 | \ '%E%f:%l:%c: %m,'. 44 | \ '%E%f:%l: %m,'. 45 | \ '%-G%.%#' 46 | 47 | return SyntasticMake({ 48 | \ 'makeprg': makeprg, 49 | \ 'errorformat': errorformat, 50 | \ 'defaults': {'text': "Syntax error"} }) 51 | endfunction 52 | 53 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 54 | \ 'filetype': 'python', 55 | \ 'name': 'pyflakes'}) 56 | -------------------------------------------------------------------------------- /syntax_checkers/slim/slimrb.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: slim.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_slim_slimrb_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_slim_slimrb_checker=1 17 | 18 | function! SyntaxCheckers_slim_slimrb_IsAvailable() 19 | return executable("slimrb") 20 | endfunction 21 | 22 | function! s:SlimrbVersion() 23 | if !exists('s:slimrb_version') 24 | let s:slimrb_version = syntastic#util#parseVersion('slimrb --version 2>' . syntastic#util#DevNull()) 25 | end 26 | return s:slimrb_version 27 | endfunction 28 | 29 | function! SyntaxCheckers_slim_slimrb_GetLocList() 30 | let makeprg = syntastic#makeprg#build({ 31 | \ 'exe': 'slimrb', 32 | \ 'args': '-c', 33 | \ 'filetype': 'slim', 34 | \ 'subchecker': 'slimrb' }) 35 | 36 | if syntastic#util#versionIsAtLeast(s:SlimrbVersion(), [1,3,1]) 37 | let errorformat = 38 | \ '%C\ %#%f\, Line %l\, Column %c,'. 39 | \ '%-G\ %.%#,'. 40 | \ '%ESlim::Parser::SyntaxError: %m,'. 41 | \ '%+C%.%#' 42 | else 43 | let errorformat = 44 | \ '%C\ %#%f\, Line %l,'. 45 | \ '%-G\ %.%#,'. 46 | \ '%ESlim::Parser::SyntaxError: %m,'. 47 | \ '%+C%.%#' 48 | endif 49 | 50 | return SyntasticMake({ 51 | \ 'makeprg': makeprg, 52 | \ 'errorformat': errorformat }) 53 | endfunction 54 | 55 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 56 | \ 'filetype': 'slim', 57 | \ 'name': 'slimrb'}) 58 | -------------------------------------------------------------------------------- /syntax_checkers/javascript/jslint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jslint.vim 3 | "Description: Javascript syntax checker - using jslint 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "Tested with jslint 0.1.4. 12 | "============================================================================ 13 | if exists("g:loaded_syntastic_javascript_jslint_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_javascript_jslint_checker=1 17 | 18 | if !exists("g:syntastic_javascript_jslint_conf") 19 | let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars" 20 | endif 21 | 22 | function! SyntaxCheckers_javascript_jslint_IsAvailable() 23 | return executable('jslint') 24 | endfunction 25 | 26 | function! SyntaxCheckers_javascript_jslint_HighlightTerm(error) 27 | let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'') 28 | if len(unexpected) < 1 | return '' | end 29 | return '\V'.split(unexpected, "'")[1] 30 | endfunction 31 | 32 | function! SyntaxCheckers_javascript_jslint_GetLocList() 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'jslint', 35 | \ 'args': g:syntastic_javascript_jslint_conf, 36 | \ 'filetype': 'javascript', 37 | \ 'subchecker': 'jslint' }) 38 | 39 | let errorformat = 40 | \ '%E %##%n %m,'. 41 | \ '%-Z%.%#Line %l\, Pos %c,'. 42 | \ '%-G%.%#' 43 | 44 | return SyntasticMake({ 45 | \ 'makeprg': makeprg, 46 | \ 'errorformat': errorformat, 47 | \ 'defaults': {'bufnr': bufnr("")} }) 48 | endfunction 49 | 50 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 51 | \ 'filetype': 'javascript', 52 | \ 'name': 'jslint'}) 53 | 54 | -------------------------------------------------------------------------------- /syntax_checkers/haskell/ghc-mod.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: ghc-mod.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Anthony Carapetis 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_haskell_ghc_mod_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_haskell_ghc_mod_checker=1 17 | 18 | function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() 19 | return executable('ghc-mod') 20 | endfunction 21 | 22 | function! SyntaxCheckers_haskell_ghc_mod_GetLocList() 23 | let errorformat = 24 | \ '%-G%\s%#,' . 25 | \ '%f:%l:%c:%trror: %m,' . 26 | \ '%f:%l:%c:%tarning: %m,'. 27 | \ '%f:%l:%c: %trror: %m,' . 28 | \ '%f:%l:%c: %tarning: %m,' . 29 | \ '%f:%l:%c:%m,' . 30 | \ '%E%f:%l:%c:,' . 31 | \ '%Z%m' 32 | 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'ghc-mod check', 35 | \ 'args': '--hlintOpt="--language=XmlSyntax"', 36 | \ 'filetype': 'haskell', 37 | \ 'subchecker': 'ghc_mod' }) 38 | let loclist1 = SyntasticMake({ 39 | \ 'makeprg': makeprg, 40 | \ 'errorformat': errorformat }) 41 | 42 | let makeprg = syntastic#makeprg#build({ 43 | \ 'exe': 'ghc-mod lint', 44 | \ 'args': '--hlintOpt="--language=XmlSyntax"', 45 | \ 'filetype': 'haskell', 46 | \ 'subchecker': 'ghc_mod' }) 47 | let loclist2 = SyntasticMake({ 48 | \ 'makeprg': makeprg, 49 | \ 'errorformat': errorformat }) 50 | 51 | return loclist1 + loclist2 52 | endfunction 53 | 54 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 55 | \ 'filetype': 'haskell', 56 | \ 'name': 'ghc_mod'}) 57 | -------------------------------------------------------------------------------- /plugin/syntastic/checker.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_checker") 2 | finish 3 | endif 4 | let g:loaded_syntastic_checker = 1 5 | 6 | let g:SyntasticChecker = {} 7 | 8 | " Public methods {{{1 9 | 10 | function! g:SyntasticChecker.New(args) 11 | let newObj = copy(self) 12 | 13 | let newObj._filetype = a:args['filetype'] 14 | let newObj._name = a:args['name'] 15 | 16 | 17 | let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_' 18 | let newObj._locListFunc = function(prefix . 'GetLocList') 19 | let newObj._isAvailableFunc = function(prefix . 'IsAvailable') 20 | 21 | if exists('*' . prefix . 'GetHighlightRegex') 22 | let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex') 23 | else 24 | let newObj._highlightRegexFunc = '' 25 | endif 26 | 27 | return newObj 28 | endfunction 29 | 30 | function! g:SyntasticChecker.getFiletype() 31 | return self._filetype 32 | endfunction 33 | 34 | function! g:SyntasticChecker.getName() 35 | return self._name 36 | endfunction 37 | 38 | function! g:SyntasticChecker.getLocList() 39 | let list = self._locListFunc() 40 | call syntastic#util#debug('getLocList: checker ' . self._filetype . '/' . self._name . ' returned ' . v:shell_error) 41 | call self._populateHighlightRegexes(list) 42 | return g:SyntasticLoclist.New(list) 43 | endfunction 44 | 45 | function! g:SyntasticChecker.getHighlightRegexFor(error) 46 | if empty(self._highlightRegexFunc) 47 | return [] 48 | endif 49 | 50 | return self._highlightRegexFunc(error) 51 | endfunction 52 | 53 | function! g:SyntasticChecker.isAvailable() 54 | return self._isAvailableFunc() 55 | endfunction 56 | 57 | " Private methods {{{1 58 | 59 | function! g:SyntasticChecker._populateHighlightRegexes(list) 60 | let list = a:list 61 | if !empty(self._highlightRegexFunc) 62 | for i in range(0, len(list)-1) 63 | if list[i]['valid'] 64 | let term = self._highlightRegexFunc(list[i]) 65 | if len(term) > 0 66 | let list[i]['hl'] = term 67 | endif 68 | endif 69 | endfor 70 | endif 71 | return list 72 | endfunction 73 | 74 | " vim: set sw=4 sts=4 et fdm=marker: 75 | -------------------------------------------------------------------------------- /syntax_checkers/html/validator_decode.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | #============================================================================ 3 | #File: validator_decode.awk 4 | #Description: Helper script for validator.vim 5 | #Maintainer: LCD 47 6 | #License: This program is free software. It comes without any warranty, 7 | # to the extent permitted by applicable law. You can redistribute 8 | # it and/or modify it under the terms of the Do What The Fuck You 9 | # Want To Public License, Version 2, as published by Sam Hocevar. 10 | # See http://sam.zoy.org/wtfpl/COPYING for more details. 11 | # 12 | #============================================================================ 13 | 14 | BEGIN { 15 | FS = OFS = "\"" 16 | hextab ["0"] = 0; hextab ["8"] = 8; 17 | hextab ["1"] = 1; hextab ["9"] = 9; 18 | hextab ["2"] = 2; hextab ["A"] = hextab ["a"] = 10 19 | hextab ["3"] = 3; hextab ["B"] = hextab ["b"] = 11; 20 | hextab ["4"] = 4; hextab ["C"] = hextab ["c"] = 12; 21 | hextab ["5"] = 5; hextab ["D"] = hextab ["d"] = 13; 22 | hextab ["6"] = 6; hextab ["E"] = hextab ["e"] = 14; 23 | hextab ["7"] = 7; hextab ["F"] = hextab ["f"] = 15; 24 | } 25 | 26 | function urldecode (url) { 27 | decoded = "" 28 | i = 1 29 | len = length (url) 30 | while ( i <= len ) { 31 | c = substr (url, i, 1) 32 | if ( c == "%" ) { 33 | if ( i + 2 <= len ) { 34 | c1 = substr (url, i + 1, 1) 35 | c2 = substr (url, i + 2, 1) 36 | if ( hextab [c1] != "" && hextab [c2] != "" ) { 37 | code = 0 + hextab [c1] * 16 + hextab [c2] + 0 38 | c = sprintf ("%c", code) 39 | } 40 | else 41 | c = c c1 c2 42 | i += 2 43 | } 44 | else if ( i + 1 <= len ) { 45 | c = substr (url, i, 2) 46 | i++ 47 | } 48 | } 49 | else if ( c == "+" ) 50 | c = " " 51 | decoded = decoded c 52 | i++ 53 | } 54 | return decoded 55 | } 56 | 57 | { 58 | $2 = urldecode($2) 59 | gsub ("\\\\\"", "\"", $2) 60 | print 61 | } 62 | -------------------------------------------------------------------------------- /syntax_checkers/eruby/ruby.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: eruby.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_eruby_ruby_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_eruby_ruby_checker=1 17 | 18 | if !exists("g:syntastic_ruby_exec") 19 | let g:syntastic_ruby_exec = "ruby" 20 | endif 21 | 22 | function! SyntaxCheckers_eruby_ruby_IsAvailable() 23 | return executable(expand(g:syntastic_ruby_exec)) 24 | endfunction 25 | 26 | function! SyntaxCheckers_eruby_ruby_GetLocList() 27 | let exe = expand(g:syntastic_ruby_exec) 28 | if !has('win32') 29 | let exe = 'RUBYOPT= ' . exe 30 | endif 31 | 32 | let fname = fnameescape(expand('%')) 33 | 34 | let enc = &fileencoding != '' ? &fileencoding : &encoding 35 | let encoding_string = enc ==# 'utf-8' ? ', :encoding => "UTF-8"' : '' 36 | 37 | "gsub fixes issue #7, rails has it's own eruby syntax 38 | let makeprg = 39 | \ exe . ' -rerb -e ' . 40 | \ shellescape('puts ERB.new(File.read("' . fname . '"' . encoding_string . ').gsub(''<\%='',''<\%''), nil, ''-'').src') . 41 | \ ' \| ' . exe . ' -c' 42 | 43 | let errorformat = 44 | \ '%-GSyntax OK,'. 45 | \ '%E-:%l: syntax error\, %m,%Z%p^,'. 46 | \ '%W-:%l: warning: %m,'. 47 | \ '%Z%p^,'. 48 | \ '%-C%.%#' 49 | 50 | return SyntasticMake({ 51 | \ 'makeprg': makeprg, 52 | \ 'errorformat': errorformat, 53 | \ 'defaults': { 'bufnr': bufnr(""), 'vcol': 1 } }) 54 | endfunction 55 | 56 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 57 | \ 'filetype': 'eruby', 58 | \ 'name': 'ruby'}) 59 | -------------------------------------------------------------------------------- /syntax_checkers/javascript/jshint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: jshint.vim 3 | "Description: Javascript syntax checker - using jshint 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | 12 | if exists("g:loaded_syntastic_javascript_jshint_checker") 13 | finish 14 | endif 15 | let g:loaded_syntastic_javascript_jshint_checker=1 16 | 17 | if !exists("g:syntastic_javascript_jshint_conf") 18 | let g:syntastic_javascript_jshint_conf = "" 19 | endif 20 | 21 | function! SyntaxCheckers_javascript_jshint_IsAvailable() 22 | return executable('jshint') 23 | endfunction 24 | 25 | function! SyntaxCheckers_javascript_jshint_GetLocList() 26 | let jshint_new = s:JshintNew() 27 | let makeprg = syntastic#makeprg#build({ 28 | \ 'exe': 'jshint', 29 | \ 'post_args': (jshint_new ? ' --verbose ' : '') . s:Args(), 30 | \ 'filetype': 'javascript', 31 | \ 'subchecker': 'jshint' }) 32 | 33 | let errorformat = jshint_new ? 34 | \ '%f: line %l\, col %c\, %m \(%t%*\d\)' : 35 | \ '%E%f: line %l\, col %c\, %m' 36 | 37 | return SyntasticMake({ 38 | \ 'makeprg': makeprg, 39 | \ 'errorformat': errorformat, 40 | \ 'defaults': {'bufnr': bufnr('')} }) 41 | endfunction 42 | 43 | function s:JshintNew() 44 | return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1]) 45 | endfunction 46 | 47 | function s:Args() 48 | " node-jshint uses .jshintrc as config unless --config arg is present 49 | return !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : '' 50 | endfunction 51 | 52 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 53 | \ 'filetype': 'javascript', 54 | \ 'name': 'jshint'}) 55 | 56 | -------------------------------------------------------------------------------- /syntax_checkers/less/lessc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: less.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Julien Blanchard 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | " To send additional options to less use the variable g:syntastic_less_options. 14 | " The default is 15 | " let g:syntastic_less_options = "--no-color" 16 | " 17 | " To use less-lint instead of less set the variable 18 | " g:syntastic_less_use_less_lint. 19 | 20 | if exists("g:loaded_syntastic_less_lessc_checker") 21 | finish 22 | endif 23 | let g:loaded_syntastic_less_lessc_checker=1 24 | 25 | if !exists("g:syntastic_less_options") 26 | let g:syntastic_less_options = "--no-color" 27 | endif 28 | 29 | if !exists("g:syntastic_less_use_less_lint") 30 | let g:syntastic_less_use_less_lint = 0 31 | endif 32 | 33 | if g:syntastic_less_use_less_lint 34 | let s:check_file = 'node ' . expand(':p:h') . '/less-lint.js' 35 | else 36 | let s:check_file = 'lessc' 37 | end 38 | 39 | function! SyntaxCheckers_less_lessc_IsAvailable() 40 | return executable('lessc') 41 | endfunction 42 | 43 | function! SyntaxCheckers_less_lessc_GetLocList() 44 | let makeprg = syntastic#makeprg#build({ 45 | \ 'exe': s:check_file, 46 | \ 'args': g:syntastic_less_options, 47 | \ 'tail': syntastic#util#DevNull(), 48 | \ 'filetype': 'less', 49 | \ 'subchecker': 'lessc' }) 50 | 51 | let errorformat = '%m in %f:%l:%c' 52 | 53 | return SyntasticMake({ 54 | \ 'makeprg': makeprg, 55 | \ 'errorformat': errorformat, 56 | \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} }) 57 | endfunction 58 | 59 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 60 | \ 'filetype': 'less', 61 | \ 'name': 'lessc'}) 62 | -------------------------------------------------------------------------------- /syntax_checkers/css/prettycss.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: prettycss.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For details about PrettyCSS see: 14 | " 15 | " - http://fidian.github.io/PrettyCSS/ 16 | " - https://github.com/fidian/PrettyCSS 17 | 18 | if exists("g:loaded_syntastic_css_prettycss_checker") 19 | finish 20 | endif 21 | let g:loaded_syntastic_css_prettycss_checker=1 22 | 23 | function! SyntaxCheckers_css_prettycss_IsAvailable() 24 | return executable('prettycss') 25 | endfunction 26 | 27 | function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item) 28 | let term = matchstr(a:item["text"], ' (\zs[^)]\+\ze)$') 29 | if term != '' 30 | let term = '\V' . term 31 | endif 32 | return term 33 | endfunction 34 | 35 | function! SyntaxCheckers_css_prettycss_GetLocList() 36 | let makeprg = syntastic#makeprg#build({ 37 | \ 'exe': 'prettycss', 38 | \ 'filetype': 'css', 39 | \ 'subchecker': 'prettycss' }) 40 | 41 | " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. 42 | let errorformat = 43 | \ '%EError: %m\, line %l\, char %c),' . 44 | \ '%WWarning: %m\, line %l\, char %c),' . 45 | \ '%-G%.%#' 46 | 47 | let loclist = SyntasticMake({ 48 | \ 'makeprg': makeprg, 49 | \ 'errorformat': errorformat, 50 | \ 'defaults': {'bufnr': bufnr("")}, 51 | \ 'postprocess': ['sort'] }) 52 | 53 | for n in range(len(loclist)) 54 | let loclist[n]["text"] .= ')' 55 | endfor 56 | 57 | return loclist 58 | endfunction 59 | 60 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 61 | \ 'filetype': 'css', 62 | \ 'name': 'prettycss'}) 63 | -------------------------------------------------------------------------------- /plugin/syntastic/highlighting.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_notifier_highlighting") 2 | finish 3 | endif 4 | let g:loaded_syntastic_notifier_highlighting = 1 5 | 6 | if !exists("g:syntastic_enable_highlighting") 7 | let g:syntastic_enable_highlighting = 1 8 | endif 9 | 10 | " Highlighting requires getmatches introduced in 7.1.040 11 | if v:version < 701 || (v:version == 701 && !has('patch040')) 12 | let g:syntastic_enable_highlighting = 0 13 | endif 14 | 15 | let g:SyntasticHighlightingNotifier = {} 16 | 17 | " Public methods {{{1 18 | 19 | function! g:SyntasticHighlightingNotifier.New() 20 | let newObj = copy(self) 21 | return newObj 22 | endfunction 23 | 24 | function! g:SyntasticHighlightingNotifier.enabled() 25 | return exists('b:syntastic_enable_highlighting') ? b:syntastic_enable_highlighting : g:syntastic_enable_highlighting 26 | endfunction 27 | 28 | " Sets error highlights in the cuirrent window 29 | function! g:SyntasticHighlightingNotifier.refresh(loclist) 30 | call self.reset(a:loclist) 31 | let buf = bufnr('') 32 | let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf') 33 | for item in issues 34 | let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning' 35 | 36 | " The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is 37 | " used to override default highlighting. 38 | if has_key(item, 'hl') 39 | call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl']) 40 | elseif get(item, 'col') 41 | let lastcol = col([item['lnum'], '$']) 42 | let lcol = min([lastcol, item['col']]) 43 | 44 | " a bug in vim can sometimes cause there to be no 'vcol' key, 45 | " so check for its existence 46 | let coltype = has_key(item, 'vcol') && item['vcol'] ? 'v' : 'c' 47 | 48 | call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype) 49 | endif 50 | endfor 51 | endfunction 52 | 53 | " Remove all error highlights from the window 54 | function! g:SyntasticHighlightingNotifier.reset(loclist) 55 | for match in getmatches() 56 | if stridx(match['group'], 'Syntastic') == 0 57 | call matchdelete(match['id']) 58 | endif 59 | endfor 60 | endfunction 61 | 62 | " vim: set sw=4 sts=4 et fdm=marker: 63 | -------------------------------------------------------------------------------- /syntax_checkers/java/checkstyle.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: checkstyle.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Dmitry Geurkov 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | " Tested with checkstyle 5.5 12 | "============================================================================ 13 | if exists("g:loaded_syntastic_java_checkstyle_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_java_checkstyle_checker=1 17 | 18 | if !exists("g:syntastic_java_checkstyle_classpath") 19 | let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar' 20 | endif 21 | 22 | if !exists("g:syntastic_java_checkstyle_conf_file") 23 | let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml' 24 | endif 25 | 26 | function! SyntaxCheckers_java_checkstyle_IsAvailable() 27 | return executable('java') 28 | endfunction 29 | 30 | function! SyntaxCheckers_java_checkstyle_GetLocList() 31 | 32 | let fname = fnameescape( expand('%:p:h') . '/' . expand('%:t') ) 33 | 34 | if has('win32unix') 35 | let fname = substitute(system('cygpath -m ' . fname), '\%x00', '', 'g') 36 | endif 37 | 38 | let makeprg = syntastic#makeprg#build({ 39 | \ 'exe': 'java', 40 | \ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . 41 | \ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file, 42 | \ 'fname': fname, 43 | \ 'filetype': 'java', 44 | \ 'subchecker': 'checkstyle' }) 45 | 46 | " check style format 47 | let errorformat = '%f:%l:%c:\ %m,%f:%l:\ %m' 48 | 49 | return SyntasticMake({ 50 | \ 'makeprg': makeprg, 51 | \ 'errorformat': errorformat, 52 | \ 'postprocess': ['cygwinRemoveCR'] }) 53 | 54 | endfunction 55 | 56 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 57 | \ 'filetype': 'java', 58 | \ 'name': 'checkstyle'}) 59 | -------------------------------------------------------------------------------- /syntax_checkers/c/make.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: make.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Gregor Uhlenheuer 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists('g:loaded_syntastic_c_make_checker') 14 | finish 15 | endif 16 | let g:loaded_syntastic_c_make_checker = 1 17 | 18 | function SyntaxCheckers_c_make_IsAvailable() 19 | return executable('make') 20 | endfunction 21 | 22 | let s:save_cpo = &cpo 23 | set cpo&vim 24 | 25 | function! SyntaxCheckers_c_make_GetLocList() 26 | 27 | let makeprg = 'make -sk' 28 | 29 | let errorformat = 30 | \ '%-G%f:%s:,' . 31 | \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . 32 | \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . 33 | \ '%-GIn file included%.%#,' . 34 | \ '%-G %#from %f:%l\,,' . 35 | \ '%f:%l:%c: %trror: %m,' . 36 | \ '%f:%l:%c: %tarning: %m,' . 37 | \ '%f:%l:%c: %m,' . 38 | \ '%f:%l: %trror: %m,' . 39 | \ '%f:%l: %tarning: %m,'. 40 | \ '%f:%l: %m' 41 | 42 | if exists('g:syntastic_c_errorformat') 43 | let errorformat = g:syntastic_c_errorformat 44 | endif 45 | 46 | " process makeprg 47 | let errors = SyntasticMake({ 'makeprg': makeprg, 48 | \ 'errorformat': errorformat }) 49 | 50 | " filter the processed errors if desired 51 | if exists('g:syntastic_c_remove_include_errors') && 52 | \ g:syntastic_c_remove_include_errors != 0 53 | return filter(errors, 54 | \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) 55 | else 56 | return errors 57 | endif 58 | endfunction 59 | 60 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 61 | \ 'filetype': 'c', 62 | \ 'name': 'make'}) 63 | 64 | let &cpo = s:save_cpo 65 | unlet s:save_cpo 66 | -------------------------------------------------------------------------------- /syntax_checkers/tex/chktex.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: chktex.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For details about ChkTeX see: 14 | " 15 | " http://baruch.ev-en.org/proj/chktex/ 16 | " 17 | " Checker options: 18 | " 19 | " - g:syntastic_tex_chktex_showmsgs (boolean; default: 1) 20 | " whether to show informational messages (chktex option "-m"); 21 | " by default informational messages are shown as warnings 22 | " 23 | " - g:syntastic_tex_chktex_args (string; default: empty) 24 | " command line options to pass to chktex 25 | 26 | if exists("g:loaded_syntastic_tex_chktex_checker") 27 | finish 28 | endif 29 | let g:loaded_syntastic_tex_chktex_checker = 1 30 | 31 | if !exists('g:syntastic_tex_chktex_showmsgs') 32 | let g:syntastic_tex_chktex_showmsgs = 1 33 | endif 34 | 35 | function! SyntaxCheckers_tex_chktex_IsAvailable() 36 | return executable("chktex") 37 | endfunction 38 | 39 | function! SyntaxCheckers_tex_chktex_GetLocList() 40 | let makeprg = syntastic#makeprg#build({ 41 | \ 'exe': 'chktex', 42 | \ 'post_args': '-q -v1', 43 | \ 'filetype': 'tex', 44 | \ 'subchecker': 'chktex' }) 45 | 46 | let errorformat = 47 | \ '%EError\ %\\d%\\+\ in\ %f\ line\ %l:\ %m,' . 48 | \ '%WWarning\ %\\d%\\+\ in\ %f\ line\ %l:\ %m,' . 49 | \ (g:syntastic_tex_chktex_showmsgs ? '%WMessage\ %\\d%\\+\ in\ %f\ line %l:\ %m,' : '') . 50 | \ '%+Z%p^,' . 51 | \ '%-G%.%#' 52 | 53 | return SyntasticMake({ 54 | \ 'makeprg': makeprg, 55 | \ 'errorformat': errorformat, 56 | \ 'subtype': 'Style', 57 | \ 'postprocess': ['sort'] }) 58 | endfunction 59 | 60 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 61 | \ 'filetype': 'tex', 62 | \ 'name': 'chktex'}) 63 | -------------------------------------------------------------------------------- /syntax_checkers/lua/luac.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: lua.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Gregor Uhlenheuer 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_lua_luac_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_lua_luac_checker=1 17 | 18 | function! SyntaxCheckers_lua_luac_IsAvailable() 19 | return executable('luac') 20 | endfunction 21 | 22 | function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) 23 | let near = matchstr(a:pos['text'], "near '[^']\\+'") 24 | let result = '' 25 | if len(near) > 0 26 | let near = split(near, "'")[1] 27 | if near == '' 28 | let p = getpos('$') 29 | let a:pos['lnum'] = p[1] 30 | let a:pos['col'] = p[2] 31 | let result = '\%'.p[2].'c' 32 | else 33 | let result = '\V'.near 34 | endif 35 | let open = matchstr(a:pos['text'], "(to close '[^']\\+' at line [0-9]\\+)") 36 | if len(open) > 0 37 | let oline = split(open, "'")[1:2] 38 | let line = 0+strpart(oline[1], 9) 39 | call matchadd('SpellCap', '\%'.line.'l\V'.oline[0]) 40 | endif 41 | endif 42 | return result 43 | endfunction 44 | 45 | 46 | function! SyntaxCheckers_lua_luac_GetLocList() 47 | let makeprg = syntastic#makeprg#build({ 48 | \ 'exe': 'luac', 49 | \ 'args': '-p', 50 | \ 'filetype': 'lua', 51 | \ 'subchecker': 'luac' }) 52 | 53 | let errorformat = 'luac: %#%f:%l: %m' 54 | 55 | return SyntasticMake({ 56 | \ 'makeprg': makeprg, 57 | \ 'errorformat': errorformat, 58 | \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } }) 59 | 60 | endfunction 61 | 62 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 63 | \ 'filetype': 'lua', 64 | \ 'name': 'luac'}) 65 | -------------------------------------------------------------------------------- /syntax_checkers/c/splint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: splint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_splint_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_splint_config': 16 | " 17 | " let g:syntastic_splint_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_c_splint_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_c_splint_checker = 1 23 | 24 | function! SyntaxCheckers_c_splint_IsAvailable() 25 | return executable("splint") 26 | endfunction 27 | 28 | if !exists('g:syntastic_splint_config_file') 29 | let g:syntastic_splint_config_file = '.syntastic_splint_config' 30 | endif 31 | 32 | function! SyntaxCheckers_c_splint_GetLocList() 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'splint', 35 | \ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file), 36 | \ 'filetype': 'c', 37 | \ 'subchecker': 'splint' }) 38 | 39 | let errorformat = 40 | \ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' . 41 | \ '%W%f:%l:%v: %m,' . 42 | \ '%W%f:%l: %m,' . 43 | \ '%-C %\+In file included from %.%#,' . 44 | \ '%-C %\+from %.%#,' . 45 | \ '%+C %.%#' 46 | 47 | return SyntasticMake({ 48 | \ 'makeprg': makeprg, 49 | \ 'errorformat': errorformat, 50 | \ 'subtype': 'Style', 51 | \ 'postprocess': ['compressWhitespace'], 52 | \ 'defaults': {'type': 'W'} }) 53 | endfunction 54 | 55 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 56 | \ 'filetype': 'c', 57 | \ 'name': 'splint'}) 58 | -------------------------------------------------------------------------------- /syntax_checkers/c/oclint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: oclint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: "UnCO" Lin 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " The setting 'g:syntastic_oclint_config_file' allows you to define a file 13 | " that contains additional compiler arguments like include directories or 14 | " CFLAGS. The file is expected to contain one option per line. If none is 15 | " given the filename defaults to '.syntastic_oclint_config': 16 | " 17 | " let g:syntastic_oclint_config_file = '.config' 18 | 19 | if exists("g:loaded_syntastic_c_oclint_checker") 20 | finish 21 | endif 22 | let g:loaded_syntastic_c_oclint_checker = 1 23 | 24 | function! SyntaxCheckers_c_oclint_IsAvailable() 25 | return executable("oclint") 26 | endfunction 27 | 28 | if !exists('g:syntastic_oclint_config_file') 29 | let g:syntastic_oclint_config_file = '.syntastic_oclint_config' 30 | endif 31 | 32 | function! SyntaxCheckers_c_oclint_GetLocList() 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'oclint', 35 | \ 'args': '-text', 36 | \ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file), 37 | \ 'filetype': 'c', 38 | \ 'subchecker': 'oclint' }) 39 | 40 | let errorformat = 41 | \ '%E%f:%l:%c: %m P1 ,' . 42 | \ '%E%f:%l:%c: %m P2 ,' . 43 | \ '%W%f:%l:%c: %m P3 ,' . 44 | \ '%E%f:%l:%c: fatal error: %m,' . 45 | \ '%E%f:%l:%c: error: %m,' . 46 | \ '%W%f:%l:%c: warning: %m,' . 47 | \ '%-G%.%#' 48 | 49 | return SyntasticMake({ 50 | \ 'makeprg': makeprg, 51 | \ 'errorformat': errorformat, 52 | \ 'subtype': 'Style', 53 | \ 'postprocess': ['compressWhitespace', 'sort'] }) 54 | endfunction 55 | 56 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 57 | \ 'filetype': 'c', 58 | \ 'name': 'oclint'}) 59 | -------------------------------------------------------------------------------- /syntax_checkers/cpp/cpplint.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: cpplint.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For details about cpplint see: 14 | " https://code.google.com/p/google-styleguide/ 15 | " 16 | " Checker options: 17 | " 18 | " - g:syntastic_cpp_cpplint_thres (integer; default: 5) 19 | " error threshold: policy violations with a severity above this 20 | " value are highlighted as errors, the others are warnings 21 | " 22 | " - g:syntastic_cpp_cpplint_args (string; default: '--verbose=3') 23 | " command line options to pass to cpplint 24 | 25 | if exists("g:loaded_syntastic_cpp_cpplint_checker") 26 | finish 27 | endif 28 | let g:loaded_syntastic_cpp_cpplint_checker = 1 29 | 30 | if !exists('g:syntastic_cpp_cpplint_thres') 31 | let g:syntastic_cpp_cpplint_thres = 5 32 | endif 33 | 34 | if ! exists('g:syntastic_cpp_cpplint_args') 35 | let g:syntastic_cpp_cpplint_args = '--verbose=3' 36 | endif 37 | 38 | function! SyntaxCheckers_cpp_cpplint_IsAvailable() 39 | return executable('cpplint.py') 40 | endfunction 41 | 42 | function! SyntaxCheckers_cpp_cpplint_GetLocList() 43 | let makeprg = syntastic#makeprg#build({ 44 | \ 'exe': 'cpplint.py', 45 | \ 'filetype': 'cpp', 46 | \ 'subchecker': 'cpplint' }) 47 | 48 | let errorformat = '%A%f:%l: %m [%t],%-G%.%#' 49 | 50 | let loclist = SyntasticMake({ 51 | \ 'makeprg': makeprg, 52 | \ 'errorformat': errorformat, 53 | \ 'subtype': 'Style' }) 54 | 55 | " change error types according to the prescribed threshold 56 | for n in range(len(loclist)) 57 | let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E' 58 | endfor 59 | 60 | return loclist 61 | endfunction 62 | 63 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 64 | \ 'filetype': 'cpp', 65 | \ 'name': 'cpplint'}) 66 | -------------------------------------------------------------------------------- /syntax_checkers/html/w3.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: w3.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " Checker option: 14 | " 15 | " - g:syntastic_html_w3_api (string; default: 'http://validator.w3.org/check') 16 | " URL of the service to use for checking; leave it to the default to run the 17 | " checks against http://validator.w3.org/, or set it to 18 | " 'http://localhost/w3c-validator/check' if you're running a local service 19 | 20 | if exists("g:loaded_syntastic_html_w3_checker") 21 | finish 22 | endif 23 | let g:loaded_syntastic_html_w3_checker = 1 24 | 25 | if !exists('g:syntastic_html_w3_api') 26 | let g:syntastic_html_w3_api = 'http://validator.w3.org/check' 27 | endif 28 | 29 | function! SyntaxCheckers_html_w3_IsAvailable() 30 | return executable('curl') 31 | endfunction 32 | 33 | function! SyntaxCheckers_html_w3_GetLocList() 34 | let makeprg = 'curl -s -F output=json ' . 35 | \ '-F uploaded_file=@' . shellescape(expand('%:p')) . '\;type=text/html ' . 36 | \ g:syntastic_html_w3_api 37 | let errorformat = 38 | \ '%A %\+{,' . 39 | \ '%C %\+"lastLine": %l\,%\?,' . 40 | \ '%C %\+"lastColumn": %c\,%\?,' . 41 | \ '%C %\+"message": "%m"\,%\?,' . 42 | \ '%C %\+"type": "%trror"\,%\?,' . 43 | \ '%-G %\+"type": "%tnfo"\,%\?,' . 44 | \ '%C %\+"subtype": "%tarning"\,%\?,' . 45 | \ '%Z %\+}\,,' . 46 | \ '%-G%.%#' 47 | let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) 48 | 49 | for n in range(len(loclist)) 50 | let loclist[n]['text'] = substitute(loclist[n]['text'], '\\\([\"]\)', '\1', 'g') 51 | endfor 52 | 53 | return loclist 54 | endfunction 55 | 56 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 57 | \ 'filetype': 'html', 58 | \ 'name': 'w3'}) 59 | 60 | -------------------------------------------------------------------------------- /syntax_checkers/perl/perlcritic.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: perlcritic.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For details about perlcritic see: 14 | " 15 | " - http://perlcritic.tigris.org/ 16 | " - https://metacpan.org/module/Perl::Critic 17 | " 18 | " Checker options: 19 | " 20 | " - g:syntastic_perl_perlcritic_thres (integer; default: 5) 21 | " error threshold: policy violations with a severity above this 22 | " value are highlighted as errors, the others are warnings 23 | " 24 | " - g:syntastic_perl_perlcritic_args (string; default: empty) 25 | " command line options to pass to perlcritic 26 | 27 | if exists("g:loaded_syntastic_perl_perlcritic_checker") 28 | finish 29 | endif 30 | let g:loaded_syntastic_perl_perlcritic_checker=1 31 | 32 | if !exists('g:syntastic_perl_perlcritic_thres') 33 | let g:syntastic_perl_perlcritic_thres = 5 34 | endif 35 | 36 | function! SyntaxCheckers_perl_perlcritic_IsAvailable() 37 | return executable('perlcritic') 38 | endfunction 39 | 40 | function! SyntaxCheckers_perl_perlcritic_GetLocList() 41 | let makeprg = syntastic#makeprg#build({ 42 | \ 'exe': 'perlcritic', 43 | \ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"', 44 | \ 'filetype': 'perl', 45 | \ 'subchecker': 'perlcritic' }) 46 | 47 | let errorformat = '%t:%f:%l:%c:%m' 48 | 49 | let loclist = SyntasticMake({ 50 | \ 'makeprg': makeprg, 51 | \ 'errorformat': errorformat, 52 | \ 'subtype': 'Style' }) 53 | 54 | " change error types according to the prescribed threshold 55 | for n in range(len(loclist)) 56 | let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_perl_perlcritic_thres ? 'W' : 'E' 57 | endfor 58 | 59 | return loclist 60 | endfunction 61 | 62 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 63 | \ 'filetype': 'perl', 64 | \ 'name': 'perlcritic'}) 65 | -------------------------------------------------------------------------------- /syntax_checkers/fortran/gfortran.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: fortran.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Karl Yngve Lervåg 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "Note: This syntax checker uses gfortran with the option -fsyntax-only 11 | " to check for errors and warnings. Additional flags may be 12 | " supplied through both local and global variables, 13 | " b:syntastic_fortran_flags, 14 | " g:syntastic_fortran_flags. 15 | " This is particularly useful when the source requires module files 16 | " in order to compile (that is when it needs modules defined in 17 | " separate files). 18 | " 19 | "============================================================================ 20 | 21 | if exists("g:loaded_syntastic_fortran_gfortran_checker") 22 | finish 23 | endif 24 | let g:loaded_syntastic_fortran_gfortran_checker=1 25 | 26 | if !exists('g:syntastic_fortran_flags') 27 | let g:syntastic_fortran_flags = '' 28 | endif 29 | 30 | function! SyntaxCheckers_fortran_gfortran_IsAvailable() 31 | return executable('gfortran') 32 | endfunction 33 | 34 | function! SyntaxCheckers_fortran_gfortran_GetLocList() 35 | let makeprg = syntastic#makeprg#build({ 36 | \ 'exe': 'gfortran', 37 | \ 'args': s:args(), 38 | \ 'filetype': 'fortran', 39 | \ 'subchecker': 'gfortran' }) 40 | 41 | let errorformat = 42 | \ '%-C %#,'. 43 | \ '%-C %#%.%#,'. 44 | \ '%A%f:%l.%c:,'. 45 | \ '%Z%m,'. 46 | \ '%G%.%#' 47 | 48 | return SyntasticMake({ 49 | \ 'makeprg': makeprg, 50 | \ 'errorformat': errorformat }) 51 | endfunction 52 | 53 | function s:args() 54 | let rv = '-fsyntax-only ' . g:syntastic_fortran_flags 55 | if exists('b:syntastic_fortran_flags') 56 | let rv .= " " . b:syntastic_fortran_flags 57 | endif 58 | return rv 59 | endfunction 60 | 61 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 62 | \ 'filetype': 'fortran', 63 | \ 'name': 'gfortran'}) 64 | -------------------------------------------------------------------------------- /syntax_checkers/haxe/haxe.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: haxe.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: David Bernard 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_haxe_haxe_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_haxe_haxe_checker=1 17 | 18 | function! SyntaxCheckers_haxe_haxe_IsAvailable() 19 | return executable('haxe') 20 | endfunction 21 | 22 | " s:FindInParent 23 | " find the file argument and returns the path to it. 24 | " Starting with the current working dir, it walks up the parent folders 25 | " until it finds the file, or it hits the stop dir. 26 | " If it doesn't find it, it returns "Nothing" 27 | function! s:FindInParent(fln,flsrt,flstp) 28 | let here = a:flsrt 29 | while ( strlen( here) > 0 ) 30 | let p = split(globpath(here, a:fln), '\n') 31 | if len(p) > 0 32 | return ['ok', here, fnamemodify(p[0], ':p:t')] 33 | endif 34 | let fr = match(here, '/[^/]*$') 35 | if fr == -1 36 | break 37 | endif 38 | let here = strpart(here, 0, fr) 39 | if here == a:flstp 40 | break 41 | endif 42 | endwhile 43 | return ['fail', '', ''] 44 | endfunction 45 | 46 | function! SyntaxCheckers_haxe_haxe_GetLocList() 47 | let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/') 48 | if success == 'ok' 49 | let makeprg = syntastic#makeprg#build({ 50 | \ 'exe': 'haxe', 51 | \ 'fname': shellescape(fnameescape(hxmlname)), 52 | \ 'filetype': 'haxe', 53 | \ 'subchecker': 'haxe' }) 54 | 55 | let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m' 56 | 57 | return SyntasticMake({ 58 | \ 'makeprg': makeprg, 59 | \ 'errorformat': errorformat, 60 | \ 'cwd': hxmldir }) 61 | else 62 | return [] 63 | endif 64 | endfunction 65 | 66 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 67 | \ 'filetype': 'haxe', 68 | \ 'name': 'haxe'}) 69 | -------------------------------------------------------------------------------- /syntax_checkers/dart/dart_analyzer.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: dart_analyzer.vim 3 | "Description: Dart syntax checker - using dart_analyzer 4 | "Maintainer: Maksim Ryzhikov 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | if exists("g:loaded_syntastic_dart_dart_analyzer_checker") 12 | finish 13 | endif 14 | let g:loaded_syntastic_dart_dart_analyzer_checker=1 15 | 16 | if !exists("g:syntastic_dart_analyzer_conf") 17 | let g:syntastic_dart_analyzer_conf = '' 18 | endif 19 | 20 | function! SyntaxCheckers_dart_dart_analyzer_IsAvailable() 21 | return executable("dart_analyzer") 22 | endfunction 23 | 24 | function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error) 25 | let lcol = a:error['col'] - 1 26 | let rcol = a:error['nr'] + lcol + 1 27 | 28 | return '\%>'.lcol.'c\%<'.rcol.'c' 29 | endfunction 30 | 31 | function! SyntaxCheckers_dart_dart_analyzer_GetLocList() 32 | let args = !empty(g:syntastic_dart_analyzer_conf) ? ' ' . g:syntastic_dart_analyzer_conf : '' 33 | let makeprg = syntastic#makeprg#build({ 34 | \ 'exe': 'dart_analyzer', 35 | \ 'args': '--error_format machine', 36 | \ 'post_args': args, 37 | \ 'filetype': 'dart', 38 | \ 'subchecker': 'dart_analyzer' }) 39 | 40 | " Machine readable format looks like: 41 | " SEVERITY|TYPE|ERROR_CODE|file:FILENAME|LINE_NUMBER|COLUMN|LENGTH|MESSAGE 42 | " SEVERITY: (WARNING|ERROR) 43 | " TYPE: (RESOLVER|STATIC_TYPE|...) 44 | " ERROR_CODE: (NO_SUCH_TYPE|...) 45 | " FILENAME: String 46 | " LINE_NUMBER: int 47 | " COLUMN: int 48 | " LENGHT: int 49 | " MESSAGE: String 50 | 51 | " We use %n to grab the error length to be able to access it in the matcher. 52 | let commonformat = '|%.%#|%.%#|file:%f|%l|%c|%n|%m' 53 | 54 | " TODO(amouravski): simply take everything after ERROR|WARNING as a message 55 | " and then parse it by hand later. 56 | let errorformat = '%EERROR'.l:commonformat.','. 57 | \'%WWARNING'.l:commonformat 58 | 59 | return SyntasticMake({ 60 | \ 'makeprg': makeprg, 61 | \ 'errorformat': errorformat }) 62 | endfunction 63 | 64 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 65 | \ 'filetype': 'dart', 66 | \ 'name': 'dart_analyzer'}) 67 | -------------------------------------------------------------------------------- /syntax_checkers/sh/sh.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: sh.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Gregor Uhlenheuer 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_sh_sh_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_sh_sh_checker=1 17 | 18 | function! s:GetShell() 19 | if !exists('b:shell') || b:shell == '' 20 | let b:shell = '' 21 | let shebang = getbufline(bufnr('%'), 1)[0] 22 | if len(shebang) > 0 23 | if match(shebang, 'bash') >= 0 24 | let b:shell = 'bash' 25 | elseif match(shebang, 'zsh') >= 0 26 | let b:shell = 'zsh' 27 | elseif match(shebang, 'sh') >= 0 28 | let b:shell = 'sh' 29 | endif 30 | endif 31 | " try to use env variable in case no shebang could be found 32 | if b:shell == '' 33 | let b:shell = fnamemodify(expand('$SHELL'), ':t') 34 | endif 35 | endif 36 | return b:shell 37 | endfunction 38 | 39 | function! s:ForwardToZshChecker() 40 | let registry = g:SyntasticRegistry.Instance() 41 | if registry.checkable('zsh') 42 | return SyntaxCheckers_zsh_zsh_GetLocList() 43 | else 44 | return [] 45 | endif 46 | 47 | endfunction 48 | 49 | 50 | function! s:IsShellValid() 51 | return len(s:GetShell()) > 0 && executable(s:GetShell()) 52 | endfunction 53 | 54 | 55 | function! SyntaxCheckers_sh_sh_IsAvailable() 56 | return s:IsShellValid() 57 | endfunction 58 | 59 | function! SyntaxCheckers_sh_sh_GetLocList() 60 | if s:GetShell() == 'zsh' 61 | return s:ForwardToZshChecker() 62 | endif 63 | 64 | if !s:IsShellValid() 65 | return [] 66 | endif 67 | 68 | let makeprg = syntastic#makeprg#build({ 69 | \ 'exe': s:GetShell(), 70 | \ 'args': '-n', 71 | \ 'filetype': 'sh', 72 | \ 'subchecker': 'sh'}) 73 | 74 | let errorformat = '%f: line %l: %m' 75 | 76 | return SyntasticMake({ 77 | \ 'makeprg': makeprg, 78 | \ 'errorformat': errorformat}) 79 | endfunction 80 | 81 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 82 | \ 'filetype': 'sh', 83 | \ 'name': 'sh'}) 84 | -------------------------------------------------------------------------------- /syntax_checkers/javascript/closurecompiler.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: closurecompiler.vim 3 | "Description: Javascript syntax checker - using Google Closure Compiler 4 | "Maintainer: Motohiro Takayama 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | "============================================================================ 11 | " 12 | " To enable this plugin, edit the .vimrc like this: 13 | " 14 | " let g:syntastic_javascript_checker = "closurecompiler" 15 | " 16 | " and set the path to the Google Closure Compiler: 17 | " 18 | " let g:syntastic_javascript_closure_compiler_path = '/path/to/google-closure-compiler.jar' 19 | " 20 | " It takes additional options for Google Closure Compiler with the variable 21 | " g:syntastic_javascript_closure_compiler_options. 22 | " 23 | 24 | if exists("g:loaded_syntastic_javascript_closurecompiler_checker") 25 | finish 26 | endif 27 | let g:loaded_syntastic_javascript_closurecompiler_checker=1 28 | 29 | if !exists("g:syntastic_javascript_closure_compiler_options") 30 | let g:syntastic_javascript_closure_compiler_options = "" 31 | endif 32 | 33 | function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() 34 | return exists("g:syntastic_javascript_closure_compiler_path") 35 | endfunction 36 | 37 | function! SyntaxCheckers_javascript_closurecompiler_GetLocList() 38 | if exists("g:syntastic_javascript_closure_compiler_file_list") 39 | let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ') 40 | else 41 | let file_list = shellescape(expand('%')) 42 | endif 43 | 44 | let makeprg = syntastic#makeprg#build({ 45 | \ 'exe': 'java -jar ' . g:syntastic_javascript_closure_compiler_path, 46 | \ 'args': g:syntastic_javascript_closure_compiler_options . ' --js' , 47 | \ 'fname': file_list, 48 | \ 'filetype': 'javascript', 49 | \ 'subchecker': 'closurecompiler' }) 50 | 51 | let errorformat = 52 | \ '%-GOK,'. 53 | \ '%E%f:%l: ERROR - %m,'. 54 | \ '%Z%p^,'. 55 | \ '%W%f:%l: WARNING - %m,'. 56 | \ '%Z%p^' 57 | 58 | return SyntasticMake({ 59 | \ 'makeprg': makeprg, 60 | \ 'errorformat': errorformat }) 61 | endfunction 62 | 63 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 64 | \ 'filetype': 'javascript', 65 | \ 'name': 'closurecompiler'}) 66 | 67 | -------------------------------------------------------------------------------- /syntax_checkers/ruby/mri.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: mri.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_ruby_mri_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_ruby_mri_checker=1 17 | 18 | if !exists("g:syntastic_ruby_exec") 19 | let g:syntastic_ruby_exec = "ruby" 20 | endif 21 | 22 | function! SyntaxCheckers_ruby_mri_IsAvailable() 23 | return executable(expand(g:syntastic_ruby_exec)) 24 | endfunction 25 | 26 | function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i) 27 | if match(a:i['text'], 'assigned but unused variable') > -1 28 | let term = split(a:i['text'], ' - ')[1] 29 | return '\V\<'.term.'\>' 30 | endif 31 | 32 | return '' 33 | endfunction 34 | 35 | function! SyntaxCheckers_ruby_mri_GetLocList() 36 | let exe = expand(g:syntastic_ruby_exec) 37 | if !has('win32') 38 | let exe = 'RUBYOPT= ' . exe 39 | endif 40 | 41 | let makeprg = syntastic#makeprg#build({ 42 | \ 'exe': exe, 43 | \ 'args': '-w -T1 -c', 44 | \ 'filetype': 'ruby', 45 | \ 'subchecker': 'mri' }) 46 | 47 | "this is a hack to filter out a repeated useless warning in rspec files 48 | "containing lines like 49 | " 50 | " foo.should == 'bar' 51 | " 52 | "Which always generate the warning below. Note that ruby >= 1.9.3 includes 53 | "the word "possibly" in the warning 54 | let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,' 55 | 56 | " filter out lines starting with ... 57 | " long lines are truncated and wrapped in ... %p then returns the wrong 58 | " column offset 59 | let errorformat .= '%-G%\%.%\%.%\%.%.%#,' 60 | 61 | let errorformat .= 62 | \ '%-GSyntax OK,'. 63 | \ '%E%f:%l: syntax error\, %m,'. 64 | \ '%Z%p^,'. 65 | \ '%W%f:%l: warning: %m,'. 66 | \ '%Z%p^,'. 67 | \ '%W%f:%l: %m,'. 68 | \ '%-C%.%#' 69 | 70 | return SyntasticMake({ 71 | \ 'makeprg': makeprg, 72 | \ 'errorformat': errorformat }) 73 | endfunction 74 | 75 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 76 | \ 'filetype': 'ruby', 77 | \ 'name': 'mri'}) 78 | -------------------------------------------------------------------------------- /syntax_checkers/cuda/nvcc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: cuda.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | " 5 | "Author: Hannes Schulz 6 | " 7 | "============================================================================ 8 | 9 | " in order to also check header files add this to your .vimrc: 10 | " (this creates an empty .syntastic_dummy.cu file in your source directory) 11 | " 12 | " let g:syntastic_cuda_check_header = 1 13 | 14 | " By default, nvcc and thus syntastic, defaults to the most basic architecture. 15 | " This can produce false errors if the developer intends to compile for newer 16 | " hardware and use newer features, eg. double precision numbers. To pass a 17 | " specific target arch to nvcc, e.g. add the following to your .vimrc: 18 | " 19 | " let g:syntastic_cuda_arch = "sm_20" 20 | 21 | 22 | if exists("g:loaded_syntastic_cuda_nvcc_checker") 23 | finish 24 | endif 25 | let g:loaded_syntastic_cuda_nvcc_checker=1 26 | 27 | function! SyntaxCheckers_cuda_nvcc_IsAvailable() 28 | return executable('nvcc') 29 | endfunction 30 | 31 | function! SyntaxCheckers_cuda_nvcc_GetLocList() 32 | if exists('g:syntastic_cuda_arch') 33 | let arch_flag = '-arch=' . g:syntastic_cuda_arch 34 | else 35 | let arch_flag = '' 36 | endif 37 | let makeprg = 38 | \ 'nvcc ' . arch_flag . ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' . 39 | \ shellescape(expand('%')) . ' ' . syntastic#c#GetNullDevice() 40 | let errorformat = 41 | \ '%*[^"]"%f"%*\D%l: %m,'. 42 | \ '"%f"%*\D%l: %m,'. 43 | \ '%-G%f:%l: (Each undeclared identifier is reported only once,'. 44 | \ '%-G%f:%l: for each function it appears in.),'. 45 | \ '%f:%l:%c:%m,'. 46 | \ '%f(%l):%m,'. 47 | \ '%f:%l:%m,'. 48 | \ '"%f"\, line %l%*\D%c%*[^ ] %m,'. 49 | \ '%D%*\a[%*\d]: Entering directory `%f'','. 50 | \ '%X%*\a[%*\d]: Leaving directory `%f'','. 51 | \ '%D%*\a: Entering directory `%f'','. 52 | \ '%X%*\a: Leaving directory `%f'','. 53 | \ '%DMaking %*\a in %f,'. 54 | \ '%f|%l| %m' 55 | 56 | if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$' 57 | if exists('g:syntastic_cuda_check_header') 58 | let makeprg = 59 | \ 'echo > .syntastic_dummy.cu ; ' . 60 | \ 'nvcc ' . arch_flag . ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' . 61 | \ shellescape(expand('%')) . ' ' . syntastic#c#GetNullDevice() 62 | else 63 | return [] 64 | endif 65 | endif 66 | 67 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 68 | endfunction 69 | 70 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 71 | \ 'filetype': 'cuda', 72 | \ 'name': 'nvcc'}) 73 | -------------------------------------------------------------------------------- /syntax_checkers/perl/perl.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: perl.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Anthony Carapetis , 5 | " Eric Harmon 6 | "License: This program is free software. It comes without any warranty, 7 | " to the extent permitted by applicable law. You can redistribute 8 | " it and/or modify it under the terms of the Do What The Fuck You 9 | " Want To Public License, Version 2, as published by Sam Hocevar. 10 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 11 | " 12 | "============================================================================ 13 | " 14 | " In order to add some custom lib directories that should be added to the 15 | " perl command line you can add those as a comma-separated list to the variable 16 | " g:syntastic_perl_lib_path. 17 | " 18 | " let g:syntastic_perl_lib_path = './lib,./lib/auto' 19 | " 20 | " To use your own perl error output munger script, use the 21 | " g:syntastic_perl_efm_program option. Any command line parameters should be 22 | " included in the variable declaration. The program should expect a single 23 | " parameter; the fully qualified filename of the file to be checked. 24 | " 25 | " let g:syntastic_perl_efm_program = "foo.pl -o -m -g" 26 | " 27 | 28 | if exists("g:loaded_syntastic_perl_perl_checker") 29 | finish 30 | endif 31 | let g:loaded_syntastic_perl_perl_checker=1 32 | 33 | if !exists("g:syntastic_perl_interpreter") 34 | let g:syntastic_perl_interpreter = "perl" 35 | endif 36 | 37 | function! SyntaxCheckers_perl_perl_IsAvailable() 38 | return executable(g:syntastic_perl_interpreter) 39 | endfunction 40 | 41 | if !exists("g:syntastic_perl_efm_program") 42 | let g:syntastic_perl_efm_program = 43 | \ g:syntastic_perl_interpreter . ' ' . 44 | \ shellescape(expand(':p:h') . '/efm_perl.pl') . 45 | \ ' -c -w' 46 | endif 47 | 48 | function! SyntaxCheckers_perl_perl_GetLocList() 49 | let makeprg = exists("b:syntastic_perl_efm_program") ? b:syntastic_perl_efm_program : g:syntastic_perl_efm_program 50 | if exists("g:syntastic_perl_lib_path") 51 | let makeprg .= ' -I' . g:syntastic_perl_lib_path 52 | endif 53 | let makeprg .= ' ' . shellescape(expand('%')) . s:ExtraMakeprgArgs() 54 | 55 | let errorformat = '%t:%f:%l:%m' 56 | 57 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) 58 | endfunction 59 | 60 | function! s:ExtraMakeprgArgs() 61 | let shebang = syntastic#util#parseShebang() 62 | if index(shebang['args'], '-T') != -1 63 | return ' -Tc' 64 | endif 65 | 66 | return '' 67 | endfunction 68 | 69 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 70 | \ 'filetype': 'perl', 71 | \ 'name': 'perl'}) 72 | -------------------------------------------------------------------------------- /syntax_checkers/go/go.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: go.vim 3 | "Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]' 4 | "Maintainer: Kamil Kisiel 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | " This syntax checker does not reformat your source code. 12 | " Use a BufWritePre autocommand to that end: 13 | " autocmd FileType go autocmd BufWritePre Fmt 14 | "============================================================================ 15 | if exists("g:loaded_syntastic_go_go_checker") 16 | finish 17 | endif 18 | let g:loaded_syntastic_go_go_checker=1 19 | 20 | function! SyntaxCheckers_go_go_IsAvailable() 21 | return executable('go') 22 | endfunction 23 | 24 | function! SyntaxCheckers_go_go_GetLocList() 25 | " Check with gofmt first, since `go build` and `go test` might not report 26 | " syntax errors in the current file if another file with syntax error is 27 | " compiled first. 28 | let makeprg = syntastic#makeprg#build({ 29 | \ 'exe': 'gofmt', 30 | \ 'args': '-l', 31 | \ 'tail': '1>' . syntastic#util#DevNull(), 32 | \ 'filetype': 'go', 33 | \ 'subchecker': 'go' }) 34 | 35 | let errorformat = 36 | \ '%f:%l:%c: %m,' . 37 | \ '%-G%.%#' 38 | 39 | let errors = SyntasticMake({ 40 | \ 'makeprg': makeprg, 41 | \ 'errorformat': errorformat, 42 | \ 'defaults': {'type': 'e'} }) 43 | if !empty(errors) 44 | return errors 45 | endif 46 | 47 | " Test files, i.e. files with a name ending in `_test.go`, are not 48 | " compiled by `go build`, therefore `go test` must be called for those. 49 | if match(expand('%'), '_test.go$') == -1 50 | let makeprg = 'go build ' . syntastic#c#GetNullDevice() 51 | else 52 | let makeprg = 'go test -c ' . syntastic#c#GetNullDevice() 53 | endif 54 | 55 | let errorformat = 56 | \ '%f:%l:%c:%m,' . 57 | \ '%f:%l%m,' . 58 | \ '%-G#%.%#' 59 | 60 | " The go compiler needs to either be run with an import path as an 61 | " argument or directly from the package directory. Since figuring out 62 | " the proper import path is fickle, just cwd to the package. 63 | 64 | let errors = SyntasticMake({ 65 | \ 'makeprg': makeprg, 66 | \ 'errorformat': errorformat, 67 | \ 'cwd': expand('%:p:h'), 68 | \ 'defaults': {'type': 'e'} }) 69 | 70 | return errors 71 | endfunction 72 | 73 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 74 | \ 'filetype': 'go', 75 | \ 'name': 'go'}) 76 | -------------------------------------------------------------------------------- /syntax_checkers/sass/sass.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: sass.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | 13 | if exists("g:loaded_syntastic_sass_sass_checker") 14 | finish 15 | endif 16 | let g:loaded_syntastic_sass_sass_checker=1 17 | 18 | function! SyntaxCheckers_sass_sass_IsAvailable() 19 | return executable("sass") 20 | endfunction 21 | 22 | "sass caching for large files drastically speeds up the checking, but store it 23 | "in a temp location otherwise sass puts .sass_cache dirs in the users project 24 | let s:sass_cache_location = tempname() 25 | 26 | "By default do not check partials as unknown variables are a syntax error 27 | if !exists("g:syntastic_sass_check_partials") 28 | let g:syntastic_sass_check_partials = 0 29 | endif 30 | 31 | "use compass imports if available 32 | let s:imports = "" 33 | if executable("compass") 34 | let s:imports = "--compass" 35 | endif 36 | 37 | function! SyntaxCheckers_sass_sass_GetLocList() 38 | if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_' 39 | return [] 40 | endif 41 | 42 | let makeprg = syntastic#makeprg#build({ 43 | \ 'exe': 'sass', 44 | \ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check', 45 | \ 'filetype': 'sass', 46 | \ 'subchecker': 'sass' }) 47 | 48 | let errorformat = 49 | \ '%ESyntax %trror: %m,' . 50 | \ '%+C %.%#,' . 51 | \ '%C on line %l of %f\, %.%#,' . 52 | \ '%C on line %l of %f,' . 53 | \ '%-G %\+from line %.%#,' . 54 | \ '%-G %\+Use --trace for backtrace.,' . 55 | \ '%W%>DEPRECATION WARNING on line %l of %f:,' . 56 | \ '%+C%> %.%#,' . 57 | \ '%W%>WARNING: on line %l of %f:,' . 58 | \ '%+C%> %.%#,' . 59 | \ '%W%>WARNING on line %l of %f: %m,' . 60 | \ '%+C%> %.%#,' . 61 | \ '%W%>WARNING on line %l of %f:,' . 62 | \ '%Z%m,' . 63 | \ '%W%>WARNING: %m,' . 64 | \ '%C on line %l of %f\, %.%#,' . 65 | \ '%C on line %l of %f,' . 66 | \ '%-G %\+from line %.%#,' . 67 | \ 'Syntax %trror on line %l: %m,' . 68 | \ '%-G%.%#' 69 | 70 | return SyntasticMake({ 71 | \ 'makeprg': makeprg, 72 | \ 'errorformat': errorformat, 73 | \ 'postprocess': ['compressWhitespace'] }) 74 | endfunction 75 | 76 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 77 | \ 'filetype': 'sass', 78 | \ 'name': 'sass'}) 79 | -------------------------------------------------------------------------------- /syntax_checkers/xhtml/tidy.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: xhtml.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " Checker option: 14 | " 15 | " - g:syntastic_xhtml_tidy_ignore_errors (list; default: []) 16 | " list of errors to ignore 17 | 18 | if exists("g:loaded_syntastic_xhtml_tidy_checker") 19 | finish 20 | endif 21 | let g:loaded_syntastic_xhtml_tidy_checker=1 22 | 23 | if !exists('g:syntastic_xhtml_tidy_ignore_errors') 24 | let g:syntastic_xhtml_tidy_ignore_errors = [] 25 | endif 26 | 27 | function! SyntaxCheckers_xhtml_tidy_IsAvailable() 28 | return executable("tidy") 29 | endfunction 30 | 31 | " TODO: join this with html.vim DRY's sake? 32 | function! s:TidyEncOptByFenc() 33 | let tidy_opts = { 34 | \'utf-8' : '-utf8', 35 | \'ascii' : '-ascii', 36 | \'latin1' : '-latin1', 37 | \'iso-2022-jp' : '-iso-2022', 38 | \'cp1252' : '-win1252', 39 | \'macroman' : '-mac', 40 | \'utf-16le' : '-utf16le', 41 | \'utf-16' : '-utf16', 42 | \'big5' : '-big5', 43 | \'cp932' : '-shiftjis', 44 | \'sjis' : '-shiftjis', 45 | \'cp850' : '-ibm858', 46 | \} 47 | return get(tidy_opts, &fileencoding, '-utf8') 48 | endfunction 49 | 50 | function! s:IgnoreError(text) 51 | for i in g:syntastic_xhtml_tidy_ignore_errors 52 | if stridx(a:text, i) != -1 53 | return 1 54 | endif 55 | endfor 56 | return 0 57 | endfunction 58 | 59 | function! SyntaxCheckers_xhtml_tidy_GetLocList() 60 | let encopt = s:TidyEncOptByFenc() 61 | let makeprg = syntastic#makeprg#build({ 62 | \ 'exe': 'tidy', 63 | \ 'args': encopt . ' -xml -e', 64 | \ 'filetype': 'xhtml', 65 | \ 'subchecker': 'tidy' }) 66 | 67 | let errorformat= 68 | \ '%Wline %l column %v - Warning: %m,' . 69 | \ '%Eline %l column %v - Error: %m,' . 70 | \ '%-G%.%#' 71 | 72 | let loclist = SyntasticMake({ 73 | \ 'makeprg': makeprg, 74 | \ 'errorformat': errorformat, 75 | \ 'defaults': {'bufnr': bufnr("")} }) 76 | 77 | for n in range(len(loclist)) 78 | if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1 79 | let loclist[n]['valid'] = 0 80 | endif 81 | endfor 82 | 83 | return loclist 84 | endfunction 85 | 86 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 87 | \ 'filetype': 'xhtml', 88 | \ 'name': 'tidy'}) 89 | -------------------------------------------------------------------------------- /syntax_checkers/vala/valac.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: vala.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Konstantin Stepanov (me@kstep.me) 5 | "Notes: Add special comment line into your vala file starting with 6 | " "// modules: " and containing space delimited list of vala 7 | " modules, used by the file, so this script can build correct 8 | " --pkg arguments. 9 | " Alternatively you can set g:syntastic_vala_modules array 10 | " in your .vimrc or .lvimrc with localvimrc plugin 11 | " (http://www.vim.org/scripts/script.php?script_id=441). 12 | " Valac compiler is not the fastest thing in the world, so you 13 | " may want to disable this plugin with 14 | " let g:syntastic_vala_check_disabled = 1 command in your .vimrc or 15 | " command line. Unlet this variable to set it to 0 to reenable 16 | " this checker. 17 | "License: This program is free software. It comes without any warranty, 18 | " to the extent permitted by applicable law. You can redistribute 19 | " it and/or modify it under the terms of the Do What The Fuck You 20 | " Want To Public License, Version 2, as published by Sam Hocevar. 21 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 22 | " 23 | "============================================================================ 24 | 25 | if exists("g:loaded_syntastic_vala_valac_checker") 26 | finish 27 | endif 28 | let g:loaded_syntastic_vala_valac_checker = 1 29 | 30 | function! SyntaxCheckers_vala_valac_IsAvailable() 31 | return executable('valac') 32 | endfunction 33 | 34 | function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) 35 | let strlength = strlen(matchstr(a:pos['text'], '\^\+$')) 36 | return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c' 37 | endfunction 38 | 39 | function! s:GetValaModules() 40 | if exists('g:syntastic_vala_modules') 41 | if type(g:syntastic_vala_modules) == type('') 42 | return split(g:syntastic_vala_modules, '\s\+') 43 | elseif type(g:syntastic_vala_modules) == type([]) 44 | return copy(g:syntastic_vala_modules) 45 | else 46 | echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string' 47 | endif 48 | endif 49 | 50 | let modules_line = search('^// modules: ', 'n') 51 | let modules_str = getline(modules_line) 52 | return split(strpart(modules_str, 12), '\s\+') 53 | endfunction 54 | 55 | function! SyntaxCheckers_vala_valac_GetLocList() 56 | let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') 57 | let makeprg = syntastic#makeprg#build({ 58 | \ 'exe': 'valac', 59 | \ 'args': '-C ' . vala_pkg_args, 60 | \ 'filetype': 'vala', 61 | \ 'subchecker': 'valac' }) 62 | let errorformat = 63 | \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'. 64 | \ '%C%m,'. 65 | \ '%Z%m' 66 | 67 | return SyntasticMake({ 68 | \ 'makeprg': makeprg, 69 | \ 'errorformat': errorformat }) 70 | endfunction 71 | 72 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 73 | \ 'filetype': 'vala', 74 | \ 'name': 'valac'}) 75 | -------------------------------------------------------------------------------- /syntax_checkers/php/phpmd.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: phpmd.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: Martin Grenfell 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " See here for details of phpmd 14 | " - phpmd (see http://phpmd.org) 15 | 16 | if exists("g:loaded_syntastic_php_phpmd_checker") 17 | finish 18 | endif 19 | let g:loaded_syntastic_php_phpmd_checker=1 20 | 21 | function! SyntaxCheckers_php_phpmd_IsAvailable() 22 | return executable('phpmd') 23 | endfunction 24 | 25 | function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item) 26 | let term = matchstr(a:item['text'], '\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)') 27 | if term != '' 28 | return '\V'.substitute(term, '\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '') 29 | endif 30 | let term = matchstr(a:item['text'], '\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.') 31 | if term != '' 32 | return '\V'.substitute(term, '\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '') 33 | endif 34 | let term = matchstr(a:item['text'], '\C^Avoid using short method names like \S\+::\S\+()\.') 35 | if term != '' 36 | return '\V'.substitute(term, '\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '') 37 | endif 38 | let term = matchstr(a:item['text'], '\C^\S\+ accesses the super-global variable ') 39 | if term != '' 40 | return '\V'.substitute(term, '\C accesses the super-global variable .*$', '', '') 41 | endif 42 | let term = matchstr(a:item['text'], '\C^Constant \S\+ should be defined in uppercase') 43 | if term != '' 44 | return '\V'.substitute(term, '\C^Constant \(\S\+\) should be defined in uppercase', '\1', '') 45 | endif 46 | let term = matchstr(a:item['text'], "\\C^The '\\S\\+()' method which returns ") 47 | if term != '' 48 | return '\V'.substitute(term, "\\C^The '\\(\\S\\+\\()' method which returns.*", '\1', '') 49 | endif 50 | let term = matchstr(a:item['text'], '\C variable \S\+ should begin with ') 51 | if term != '' 52 | return '\V'.substitute(term, '\C.* variable \(\S\+\) should begin with .*', '\1', '') 53 | endif 54 | let term = matchstr(a:item['text'], "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'") 55 | if term != '' 56 | return '\V'.substitute(term, "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '') 57 | endif 58 | return '' 59 | endfunction 60 | 61 | function! SyntaxCheckers_php_phpmd_GetLocList() 62 | let makeprg = syntastic#makeprg#build({ 63 | \ 'exe': 'phpmd', 64 | \ 'post_args': 'text codesize,design,unusedcode,naming', 65 | \ 'filetype': 'php', 66 | \ 'subchecker': 'phpmd' }) 67 | 68 | let errorformat = '%E%f:%l%\s%#%m' 69 | 70 | return SyntasticMake({ 71 | \ 'makeprg': makeprg, 72 | \ 'errorformat': errorformat, 73 | \ 'subtype' : 'Style' }) 74 | endfunction 75 | 76 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 77 | \ 'filetype': 'php', 78 | \ 'name': 'phpmd'}) 79 | -------------------------------------------------------------------------------- /syntax_checkers/html/validator.vim: -------------------------------------------------------------------------------- 1 | "============================================================================ 2 | "File: validator.vim 3 | "Description: Syntax checking plugin for syntastic.vim 4 | "Maintainer: LCD 47 5 | "License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | "============================================================================ 12 | " 13 | " For detail;s about validator see: http://about.validator.nu/ 14 | " 15 | " Checker options: 16 | " 17 | " - g:syntastic_html_validator_api (string; default: 'http://validator.nu/') 18 | " URL of the service to use for checking; leave it to the default to run the 19 | " checks against http://validator.nu/, or set it to 'http://localhost:8888/' 20 | " if you're running a local service as per http://about.validator.nu/#src 21 | " 22 | " - g:syntastic_html_validator_parser (string; default: empty) 23 | " parser to use; legal values are: xml, xmldtd, html, html5, html4, html4tr; 24 | " set it to 'html5' to check HTML5 files; see the wiki for reference: 25 | " http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser 26 | " 27 | " - g:syntastic_html_validator_nsfilter (string; default: empty) 28 | " sets the nsfilter for the parser; see the wiki for details: 29 | " http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#nsfilter 30 | 31 | if exists("g:loaded_syntastic_html_validator_checker") 32 | finish 33 | endif 34 | let g:loaded_syntastic_html_validator_checker=1 35 | 36 | if !exists('g:syntastic_html_validator_api') 37 | let g:syntastic_html_validator_api = 'http://validator.nu/' 38 | endif 39 | 40 | if !exists('g:syntastic_html_validator_parser') 41 | let g:syntastic_html_validator_parser = '' 42 | endif 43 | 44 | if !exists('g:syntastic_html_validator_nsfilter') 45 | let g:syntastic_html_validator_nsfilter = '' 46 | endif 47 | 48 | let s:decoder = 'awk -f ' . shellescape(expand(':p:h') . '/validator_decode.awk') 49 | 50 | function! SyntaxCheckers_html_validator_IsAvailable() 51 | return executable('curl') && executable('awk') 52 | endfunction 53 | 54 | function! SyntaxCheckers_html_validator_GetLocList() 55 | let makeprg = 'curl -s --compressed -F out=gnu -F asciiquotes=yes' . 56 | \ (!empty(g:syntastic_html_validator_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') . 57 | \ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') . 58 | \ ' -F doc=@' . shellescape(expand('%')) . '\;type=text/html\;filename=' . shellescape(expand('%')) . ' ' . 59 | \ g:syntastic_html_validator_api . ' \| ' . s:decoder 60 | let errorformat = 61 | \ '%E"%f":%l: %trror: %m,' . 62 | \ '%E"%f":%l-%\d%\+: %trror: %m,' . 63 | \ '%E"%f":%l%\%.%c: %trror: %m,' . 64 | \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror: %m,' . 65 | \ '%E"%f":%l: %trror fatal: %m,' . 66 | \ '%E"%f":%l-%\d%\+: %trror fatal: %m,' . 67 | \ '%E"%f":%l%\%.%c: %trror fatal: %m,' . 68 | \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror fatal: %m,' . 69 | \ '%W"%f":%l: info %tarning: %m,' . 70 | \ '%W"%f":%l-%\d%\+: info %tarning: %m,' . 71 | \ '%W"%f":%l%\%.%c: info %tarning: %m,' . 72 | \ '%W"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: info %tarning: %m' 73 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) 74 | endfunction 75 | 76 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 77 | \ 'filetype': 'html', 78 | \ 'name': 'validator'}) 79 | --------------------------------------------------------------------------------