Merge branch 'master' into E855-on-lclose

This commit is contained in:
Alex Efros 2012-12-19 17:25:05 +02:00
commit ccfdcef04d
82 changed files with 2112 additions and 577 deletions

13
LICENCE Normal file
View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -2,7 +2,7 @@
/ \,,_ .'| / \,,_ .'|
,{{| /}}}}/_.' _____________________________________________ ,{{| /}}}}/_.' _____________________________________________
}}}}` '{{' '. / \ }}}}` '{{' '. / \
{{{{{ _ ;, \ / Gentlemen, \ {{{{{ _ ;, \ / Ladies and Gentlemen, \
,}}}}}} /o`\ ` ;) | | ,}}}}}} /o`\ ` ;) | |
{{{{{{ / ( | this is ... | {{{{{{ / ( | this is ... |
}}}}}} | \ | | }}}}}} | \ | |
@ -50,12 +50,44 @@ enabled.
Installation Installation
------------ ------------
[pathogen.vim](https://github.com/tpope/vim-pathogen) is the recommended way to install syntastic. Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already
have pathogen working then skip Step 1 and go to Step 2.
Step 1: Install pathogen.vim
----------------------------
First I'll show you how to install tpope's [pathogen.vim](https://github.com/tpope/vim-pathogen) so that
it's easy to install syntastic. Do this in your Terminal so that you get the pathogen.vim file
and the directories it needs:
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -so ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
Next you *need to add this* to your ~/.vimrc:
call pathogen#infect()
Step 2: Install syntastic as a pathogen bundle
----------------------------------------------
You now have pathogen installed and can put syntastic into ~/.vim/bundle like this:
cd ~/.vim/bundle cd ~/.vim/bundle
git clone https://github.com/scrooloose/syntastic.git git clone https://github.com/scrooloose/syntastic.git
Then reload vim, run `:Helptags`, and check out `:help syntastic.txt`. Quit vim and start it back up to reload it, then type:
:Helptags
If you get an error when you do this, then you probably didn't install pathogen right. Go back to
step 1 and make sure you did the following:
1. Created both the ~/.vim/autoload and ~/.vim/bundle directories.
2. Added the "call pathogen#infect()" line to your ~/.vimrc file
3. Did the git clone of syntastic inside ~/.vim/bundle
4. Have permissions to access all of these directories.
Google group Google group
@ -69,10 +101,19 @@ FAQ
__Q. I installed syntastic but it isn't reporting any errors ...__ __Q. I installed syntastic but it isn't reporting any errors ...__
A. The most likely reason is that the syntax checker that it requires isn't installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executable is required, just look in `syntax_checkers/<filetype>.vim`. A. The most likely reason is that the syntax checker that it requires isn't installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executable is required, just look in `syntax_checkers/<filetype>.vim`. Note that aliases do not work; the actual executable must be available in your `$PATH`. Symbolic links are okay.
Another reason it could fail is that the error output for the syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request. Another reason it could fail is that the error output for the syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request.
__Q. How can I jump between the different errors without using the location list at the bottom of the window?__
A. Vim provides several built in commands for this. See `:help :lnext` and `:help :lprev`.
If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired](https://github.com/tpope/vim-unimpaired) - which provides such mappings (among other things).
__Q. A syntax checker is giving me unwanted/strange style tips??__
A. Some filetypes (e.g. php) have style checkers as well as syntax checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the syntax checker integration file (e.g. `syntax_checkers/php.vim`) to see what options are available.
Changelog Changelog
--------- ---------

View File

@ -53,10 +53,26 @@ function! s:Unique(list)
return l return l
endfunction endfunction
" convenience function to determine the 'null device' parameter
" based on the current operating system
function! syntastic#c#GetNullDevice()
if has('win32')
return '-o nul'
elseif has('unix') || has('mac')
return '-o /dev/null'
endif
return ''
endfunction
" get the gcc include directory argument depending on the default " get the gcc include directory argument depending on the default
" includes and the optional user-defined 'g:syntastic_c_include_dirs' " includes and the optional user-defined 'g:syntastic_c_include_dirs'
function! syntastic#c#GetIncludeDirs(filetype) function! syntastic#c#GetIncludeDirs(filetype)
let include_dirs = []
if !exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
\ !g:syntastic_{a:filetype}_no_default_include_dirs
let include_dirs = copy(s:default_includes) let include_dirs = copy(s:default_includes)
endif
if exists('g:syntastic_'.a:filetype.'_include_dirs') if exists('g:syntastic_'.a:filetype.'_include_dirs')
call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs) call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs)

View File

@ -0,0 +1,42 @@
if exists("g:loaded_syntastic_util_autoload")
finish
endif
let g:loaded_syntastic_util_autoload = 1
let s:save_cpo = &cpo
set cpo&vim
function! syntastic#util#DevNull()
if has('win32')
return 'NUL'
endif
return '/dev/null'
endfunction
"search the first 5 lines of the file for a magic number and return a map
"containing the args and the executable
"
"e.g.
"
"#!/usr/bin/perl -f -bar
"
"returns
"
"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
function! syntastic#util#ParseShebang()
for lnum in range(1,5)
let line = getline(lnum)
if line =~ '^#!'
let exe = matchstr(line, '^#!\s*\zs[^ \t]*')
let args = split(matchstr(line, '^#!\s*[^ \t]*\zs.*'))
return {'exe': exe, 'args': args}
endif
endfor
return {'exe': '', 'args': []}
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -163,6 +163,20 @@ syntax errors: >
let g:syntastic_enable_signs=1 let g:syntastic_enable_signs=1
< <
*'syntastic_error_symbol'* *'syntastic_style_error_symbol'*
*'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'*
Use this option to control what the syntastic |:sign| text contains. Several
error symobls can be customized:
syntastic_error_symbol - For syntax errors, defaults to '>>'
syntastic_style_error_symbol - For style errors, defaults to 'S>'
syntastic_warning_symbol - For syntax warnings, defaults to '>>'
syntastic_style_warning_symbol - For style warnings, defaults to 'S>'
Example: >
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
<
*'syntastic_enable_balloons'* *'syntastic_enable_balloons'*
Default: 1 Default: 1
Use this option to tell syntastic whether to display error messages in balloons Use this option to tell syntastic whether to display error messages in balloons
@ -260,7 +274,7 @@ this option has the following effects:
Default: [Syntax: line:%F (%t)] Default: [Syntax: line:%F (%t)]
Use this option to control what the syntastic statusline text contains. Several Use this option to control what the syntastic statusline text contains. Several
magic flags are availble to insert information: magic flags are available to insert information:
%e - number of errors %e - number of errors
%w - number of warnings %w - number of warnings
%t - total number of warnings and errors %t - total number of warnings and errors
@ -340,7 +354,7 @@ The author of syntastic is a mighty wild stallion, hear him roar! >
< <
He likes to trot around in the back yard reading his emails and sipping a He likes to trot around in the back yard reading his emails and sipping a
scolding hot cup of Earl Grey. Email him at martin.grenfell at gmail dot com. scalding hot cup of Earl Grey. Email him at martin.grenfell at gmail dot com.
He can also be found trolling the #vim channel on the freenode IRC network as He can also be found trolling the #vim channel on the freenode IRC network as
scrooloose. scrooloose.

View File

@ -19,13 +19,26 @@ let g:loaded_syntastic_plugin = 1
let s:running_windows = has("win16") || has("win32") let s:running_windows = has("win16") || has("win32")
if !s:running_windows
let s:uname = system('uname')
endif
if !exists("g:syntastic_enable_signs") if !exists("g:syntastic_enable_signs")
let g:syntastic_enable_signs = 1 let g:syntastic_enable_signs = 1
endif endif
if !exists("g:syntastic_error_symbol")
let g:syntastic_error_symbol = '>>'
endif
if !exists("g:syntastic_warning_symbol")
let g:syntastic_warning_symbol = '>>'
endif
if !exists("g:syntastic_style_error_symbol")
let g:syntastic_style_error_symbol = 'S>'
endif
if !exists("g:syntastic_style_warning_symbol")
let g:syntastic_style_warning_symbol = 'S>'
endif
if !has('signs') if !has('signs')
let g:syntastic_enable_signs = 0 let g:syntastic_enable_signs = 0
endif endif
@ -41,6 +54,11 @@ if !exists("g:syntastic_enable_highlighting")
let g:syntastic_enable_highlighting = 1 let g:syntastic_enable_highlighting = 1
endif endif
" highlighting requires getmatches introduced in 7.1.040
if v:version < 701 || (v:version == 701 && !has('patch040'))
let g:syntastic_enable_highlighting = 0
endif
if !exists("g:syntastic_echo_current_error") if !exists("g:syntastic_echo_current_error")
let g:syntastic_echo_current_error = 1 let g:syntastic_echo_current_error = 1
endif endif
@ -115,9 +133,7 @@ function! s:UpdateErrors(auto_invoked)
call s:CacheErrors() call s:CacheErrors()
end end
if s:BufHasErrorsOrWarningsToDisplay()
call setloclist(0, s:LocList()) call setloclist(0, s:LocList())
endif
if g:syntastic_enable_balloons if g:syntastic_enable_balloons
call s:RefreshBalloons() call s:RefreshBalloons()
@ -128,7 +144,7 @@ function! s:UpdateErrors(auto_invoked)
endif endif
if g:syntastic_enable_highlighting if g:syntastic_enable_highlighting
call s:HightlightErrors() call s:HighlightErrors()
endif endif
if g:syntastic_auto_jump && s:BufHasErrorsOrWarningsToDisplay() if g:syntastic_auto_jump && s:BufHasErrorsOrWarningsToDisplay()
@ -183,7 +199,7 @@ function! s:CacheErrors()
"functions legally for filetypes like "gentoo-metadata" "functions legally for filetypes like "gentoo-metadata"
let fts = substitute(&ft, '-', '_', 'g') let fts = substitute(&ft, '-', '_', 'g')
for ft in split(fts, '\.') for ft in split(fts, '\.')
if s:Checkable(ft) if SyntasticCheckable(ft)
let errors = SyntaxCheckers_{ft}_GetLocList() let errors = SyntaxCheckers_{ft}_GetLocList()
"keep only lines that effectively match an error/warning "keep only lines that effectively match an error/warning
let errors = s:FilterLocList({'valid': 1}, errors) let errors = s:FilterLocList({'valid': 1}, errors)
@ -226,7 +242,10 @@ function! s:ModeMapAllowsAutoChecking()
endfunction endfunction
function! s:BufHasErrorsOrWarningsToDisplay() function! s:BufHasErrorsOrWarningsToDisplay()
return len(s:Errors()) || (!g:syntastic_quiet_warnings && !empty(s:LocList())) if empty(s:LocList())
return 0
endif
return len(s:Errors()) || !g:syntastic_quiet_warnings
endfunction endfunction
function! s:Errors() function! s:Errors()
@ -274,10 +293,10 @@ endfunction
if g:syntastic_enable_signs if g:syntastic_enable_signs
"define the signs used to display syntax and style errors/warns "define the signs used to display syntax and style errors/warns
sign define SyntasticError text=>> texthl=error exe 'sign define SyntasticError text='.g:syntastic_error_symbol.' texthl=error'
sign define SyntasticWarning text=>> texthl=todo exe 'sign define SyntasticWarning text='.g:syntastic_warning_symbol.' texthl=todo'
sign define SyntasticStyleError text=S> texthl=error exe 'sign define SyntasticStyleError text='.g:syntastic_style_error_symbol.' texthl=error'
sign define SyntasticStyleWarning text=S> texthl=todo exe 'sign define SyntasticStyleWarning text='.g:syntastic_style_warning_symbol.' texthl=todo'
endif endif
"start counting sign ids at 5000, start here to hopefully avoid conflicting "start counting sign ids at 5000, start here to hopefully avoid conflicting
@ -348,6 +367,7 @@ endfunction
"display the cached errors for this buf in the location list "display the cached errors for this buf in the location list
function! s:ShowLocList() function! s:ShowLocList()
if !empty(s:LocList()) if !empty(s:LocList())
call setloclist(0, s:LocList())
let num = winnr() let num = winnr()
exec "lopen " . g:syntastic_loc_list_height exec "lopen " . g:syntastic_loc_list_height
if num != winnr() if num != winnr()
@ -373,7 +393,7 @@ endfunction
" "
"If the 'force_highlight_callback' key is set for an error item, then invoke "If the 'force_highlight_callback' key is set for an error item, then invoke
"the callback even if it can be highlighted automatically. "the callback even if it can be highlighted automatically.
function! s:HightlightErrors() function! s:HighlightErrors()
call s:ClearErrorHighlights() call s:ClearErrorHighlights()
let fts = substitute(&ft, '-', '_', 'g') let fts = substitute(&ft, '-', '_', 'g')
@ -410,16 +430,6 @@ function! s:ClearErrorHighlights()
endfor endfor
endfunction endfunction
"check if a syntax checker exists for the given filetype - and attempt to
"load one
function! s:Checkable(ft)
if !exists("g:loaded_" . a:ft . "_syntax_checker")
exec "runtime syntax_checkers/" . a:ft . ".vim"
endif
return exists("*SyntaxCheckers_". a:ft ."_GetLocList")
endfunction
"set up error ballons for the current set of errors "set up error ballons for the current set of errors
function! s:RefreshBalloons() function! s:RefreshBalloons()
let b:syntastic_balloons = {} let b:syntastic_balloons = {}
@ -436,7 +446,10 @@ function! s:WideMsg(msg)
let old_ruler = &ruler let old_ruler = &ruler
let old_showcmd = &showcmd let old_showcmd = &showcmd
let msg = strpart(a:msg, 0, winwidth(0)-1) "convert tabs to spaces so that the tabs count towards the window width
"as the proper amount of characters
let msg = substitute(a:msg, "\t", repeat(" ", &tabstop), "g")
let msg = strpart(msg, 0, winwidth(0)-1)
"This is here because it is possible for some error messages to begin with "This is here because it is possible for some error messages to begin with
"\n which will cause a "press enter" prompt. I have noticed this in the "\n which will cause a "press enter" prompt. I have noticed this in the
@ -480,6 +493,64 @@ function! s:LoadChecker(checker, ft)
exec "runtime syntax_checkers/" . a:ft . "/" . a:checker . ".vim" exec "runtime syntax_checkers/" . a:ft . "/" . a:checker . ".vim"
endfunction endfunction
"the script changes &shellpipe and &shell to stop the screen flicking when
"shelling out to syntax checkers. Not all OSs support the hacks though
function! s:OSSupportsShellpipeHack()
return !s:running_windows && (s:uname() !~ "FreeBSD") && (s:uname() !~ "OpenBSD")
endfunction
function! s:IsRedrawRequiredAfterMake()
return !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
endfunction
function! s:uname()
if !exists('s:uname')
let s:uname = system('uname')
endif
return s:uname
endfunction
"find all syntax checkers matching `&rtp/syntax_checkers/a:ft/*.vim`
function s:FindCheckersForFt(ft)
let checkers = []
for ft_checker_fname in split(globpath(&runtimepath, "syntax_checkers/" . a:ft . "/*.vim"), '\n')
let checker_name = fnamemodify(ft_checker_fname, ':t:r')
call add(checkers, checker_name)
endfor
return checkers
endfunction
"check if a syntax checker exists for the given filetype - and attempt to
"load one
function! SyntasticCheckable(ft)
"users can just define a syntax checking function and it will override the
"syntastic default
if exists("*SyntaxCheckers_". a:ft ."_GetLocList")
return 1
endif
if !exists("g:loaded_" . a:ft . "_syntax_checker")
exec "runtime syntax_checkers/" . a:ft . ".vim"
let {"g:loaded_" . a:ft . "_syntax_checker"} = 1
endif
return exists("*SyntaxCheckers_". a:ft ."_GetLocList")
endfunction
"the args must be arrays of the form [major, minor, macro]
function SyntasticIsVersionAtLeast(installed, required)
if a:installed[0] != a:required[0]
return a:installed[0] > a:required[0]
endif
if a:installed[1] != a:required[1]
return a:installed[1] > a:required[1]
endif
return a:installed[2] >= a:required[2]
endfunction
"return a string representing the state of buffer according to "return a string representing the state of buffer according to
"g:syntastic_stl_format "g:syntastic_stl_format
" "
@ -544,7 +615,7 @@ function! SyntasticMake(options)
let old_shell = &shell let old_shell = &shell
let old_errorformat = &l:errorformat let old_errorformat = &l:errorformat
if !s:running_windows && (s:uname !~ "FreeBSD") if s:OSSupportsShellpipeHack()
"this is a hack to stop the screen needing to be ':redraw'n when "this is a hack to stop the screen needing to be ':redraw'n when
"when :lmake is run. Otherwise the screen flickers annoyingly "when :lmake is run. Otherwise the screen flickers annoyingly
let &shellpipe='&>' let &shellpipe='&>'
@ -568,7 +639,7 @@ function! SyntasticMake(options)
let &shellpipe=old_shellpipe let &shellpipe=old_shellpipe
let &shell=old_shell let &shell=old_shell
if !s:running_windows && s:uname =~ "FreeBSD" if s:IsRedrawRequiredAfterMake()
redraw! redraw!
endif endif
@ -604,30 +675,36 @@ function! SyntasticAddToErrors(errors, options)
return a:errors return a:errors
endfunction endfunction
"take a list of syntax checkers for the current filetype and load the right "find all checkers for the given filetype and load the right one based on the
"one based on the global settings and checker executable availabity "global settings and checker executable availabity
" "
"a:checkers should be a list of syntax checker names. These names are assumed "Find all files matching `&rtp/syntax_checkers/a:ft/*.vim`. These files should
"to be the names of the vim syntax checker files that should be sourced, as "contain syntastic syntax checkers. The file names are also assumed to be the
"well as the names of the actual syntax checker executables. The checkers "names of syntax checker executables.
"should be listed in order of default preference. "
"e.g. ~/.vim/syntax_checkers/python/flake8.vim is a syntax checker for python
"that calls the `flake8` executable.
" "
"a:ft should be the filetype for the checkers being loaded "a:ft should be the filetype for the checkers being loaded
" "
"if a option called 'g:syntastic_{a:ft}_checker' exists then attempt to "If a option called 'g:syntastic_{a:ft}_checker' exists then attempt to
"load the checker that it points to "load the checker that it points to.
function! SyntasticLoadChecker(checkers, ft) "
"e.g. let g:syntastic_python_checker="flake8" will tell syntastic to use
"flake8 for python.
function! SyntasticLoadChecker(ft)
let opt_name = "g:syntastic_" . a:ft . "_checker" let opt_name = "g:syntastic_" . a:ft . "_checker"
let checkers = s:FindCheckersForFt(&ft)
if exists(opt_name) if exists(opt_name)
let opt_val = {opt_name} let opt_val = {opt_name}
if index(a:checkers, opt_val) != -1 && executable(opt_val) if index(checkers, opt_val) != -1
call s:LoadChecker(opt_val, a:ft) call s:LoadChecker(opt_val, a:ft)
else else
echoerr &ft . " syntax not supported or not installed." echoerr &ft . " syntax not supported or not installed."
endif endif
else else
for checker in a:checkers for checker in checkers
if executable(checker) if executable(checker)
return s:LoadChecker(checker, a:ft) return s:LoadChecker(checker, a:ft)
endif endif

127
syntax_checkers/ada.vim Normal file
View File

@ -0,0 +1,127 @@
"============================================================================
"File: ada.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law.
"
"============================================================================
" in order to also check header files add this to your .vimrc:
" (this usually creates a .gch file in your source directory)
"
" let g:syntastic_ada_check_header = 1
"
" To disable the search of included header files after special
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_ada_no_include_search = 1
"
" In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable
" g:syntastic_ada_include_dirs. This list can be used like this:
"
" let g:syntastic_ada_include_dirs = [ 'includes', 'headers' ]
"
" To enable header files being re-checked on every file write add the
" following line to your .vimrc. Otherwise the header files are checked only
" one time on initially loading the file.
" In order to force syntastic to refresh the header includes simply
" unlet b:syntastic_ada_includes. Then the header files are being re-checked
" on the next file write.
"
" let g:syntastic_ada_auto_refresh_includes = 1
"
" Alternatively you can set the buffer local variable b:syntastic_ada_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_ada_cflags = ' -I/usr/include/libsoup-2.4'
"
" Moreover it is possible to add additional compiler options to the syntax
" checking execution via the variable 'g:syntastic_ada_compiler_options':
"
" let g:syntastic_ada_compiler_options = ' -std=c++0x'
"
" Additionally the setting 'g:syntastic_ada_config_file' allows you to define
" a file that contains additional compiler arguments like include directories
" or CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_ada_config':
"
" let g:syntastic_ada_config_file = '.config'
"
" Using the global variable 'g:syntastic_ada_remove_include_errors' you can
" specify whether errors of files included via the
" g:syntastic_ada_include_dirs' setting are removed from the result set:
"
" let g:syntastic_ada_remove_include_errors = 1
if !executable('gcc')
finish
endif
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_ada_config_file')
let g:syntastic_ada_config_file = '.syntastic_ada_config'
endif
function! SyntaxCheckers_ada_GetLocList()
let makeprg = 'gcc -c -fsyntax-only '
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
if exists('g:syntastic_ada_compiler_options')
let makeprg .= g:syntastic_ada_compiler_options
endif
let makeprg .= ' ' . shellescape(expand('%')) .
\ ' ' . syntastic#c#GetIncludeDirs('ada')
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
if exists('g:syntastic_ada_check_header')
let makeprg = 'g++ -c '.shellescape(expand('%')).
\ ' ' . syntastic#c#GetIncludeDirs('ada')
else
return []
endif
endif
if !exists('b:syntastic_ada_cflags')
if !exists('g:syntastic_ada_no_include_search') ||
\ g:syntastic_ada_no_include_search != 1
if exists('g:syntastic_ada_auto_refresh_includes') &&
\ g:syntastic_ada_auto_refresh_includes != 0
let makeprg .= syntastic#c#SearchHeaders()
else
if !exists('b:syntastic_ada_includes')
let b:syntastic_ada_includes = syntastic#c#SearchHeaders()
endif
let makeprg .= b:syntastic_ada_includes
endif
endif
else
let makeprg .= b:syntastic_ada_cflags
endif
" add optional config file parameters
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_ada_config_file)
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_ada_remove_include_errors') &&
\ g:syntastic_ada_remove_include_errors != 0
return filter(errors,
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
else
return errors
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -25,11 +25,6 @@
" "
"============================================================================ "============================================================================
if exists("loaded_applescript_syntax_checker")
finish
endif
let loaded_applescript_syntax_checker = 1
"bail if the user doesnt have osacompile installed "bail if the user doesnt have osacompile installed
if !executable("osacompile") if !executable("osacompile")
finish finish

View File

@ -1,7 +1,7 @@
"============================================================================ "============================================================================
"File: c.vim "File: c.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com> "Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
@ -10,138 +10,26 @@
" "
"============================================================================ "============================================================================
" In order to also check header files add this to your .vimrc: if !exists('g:syntastic_c_checker')
" (this usually creates a .gch file in your source directory) let g:syntastic_c_checker = "gcc"
"
" let g:syntastic_c_check_header = 1
"
" To disable the search of included header files after special
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_c_no_include_search = 1
"
" To enable header files being re-checked on every file write add the
" following line to your .vimrc. Otherwise the header files are checked only
" one time on initially loading the file.
" In order to force syntastic to refresh the header includes simply
" unlet b:syntastic_c_includes. Then the header files are being re-checked on
" the next file write.
"
" let g:syntastic_c_auto_refresh_includes = 1
"
" Alternatively you can set the buffer local variable b:syntastic_c_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'
"
" In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable
" g:syntastic_c_include_dirs. This list can be used like this:
"
" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ]
"
" Moreover it is possible to add additional compiler options to the syntax
" checking execution via the variable 'g:syntastic_c_compiler_options':
"
" let g:syntastic_c_compiler_options = ' -ansi'
"
" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
" file that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_c_config':
"
" let g:syntastic_c_config_file = '.config'
"
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
" specify whether errors of files included via the g:syntastic_c_include_dirs'
" setting are removed from the result set:
"
" let g:syntastic_c_remove_include_errors = 1
if exists('loaded_c_syntax_checker')
finish
endif
let loaded_c_syntax_checker = 1
if !executable('gcc')
finish
endif endif
let s:save_cpo = &cpo if g:syntastic_c_checker == "gcc" || g:syntastic_c_checker == "clang"
set cpo&vim if executable(g:syntastic_c_checker)
runtime! syntax_checkers/c/gcc.vim
if !exists('g:syntastic_c_compiler_options') endif
let g:syntastic_c_compiler_options = '-std=gnu99' elseif g:syntastic_c_checker == "checkpatch"
if executable("checkpatch.pl") || executable("./scripts/checkpatch.pl")
runtime! syntax_checkers/c/checkpatch.vim
endif
elseif g:syntastic_c_checker == "checkpatch-kernel-only"
if executable("./scripts/checkpatch.pl")
runtime! syntax_checkers/c/checkpatch.vim
elseif executable("gcc")
runtime! syntax_checkers/c/gcc.vim
endif
elseif g:syntastic_c_checker == "sparse"
if executable("cgcc")
runtime! syntax_checkers/c/sparse.vim
endif
endif endif
if !exists('g:syntastic_c_config_file')
let g:syntastic_c_config_file = '.syntastic_c_config'
endif
function! SyntaxCheckers_c_GetLocList()
let makeprg = 'gcc -fsyntax-only '
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
\ 'each function it appears%.%#,%-GIn file included%.%#,'.
\ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m'
" add optional user-defined compiler options
let makeprg .= g:syntastic_c_compiler_options
let makeprg .= ' '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
" determine whether to parse header files as well
if expand('%') =~? '.h$'
if exists('g:syntastic_c_check_header')
let makeprg = 'gcc -c '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
else
return []
endif
endif
" check if the user manually set some cflags
if !exists('b:syntastic_c_cflags')
" check whether to search for include files at all
if !exists('g:syntastic_c_no_include_search') ||
\ g:syntastic_c_no_include_search != 1
" refresh the include file search if desired
if exists('g:syntastic_c_auto_refresh_includes') &&
\ g:syntastic_c_auto_refresh_includes != 0
let makeprg .= syntastic#c#SearchHeaders()
else
" search for header includes if not cached already
if !exists('b:syntastic_c_includes')
let b:syntastic_c_includes = syntastic#c#SearchHeaders()
endif
let makeprg .= b:syntastic_c_includes
endif
endif
else
" use the user-defined cflags
let makeprg .= b:syntastic_c_cflags
endif
" add optional config file parameters
let makeprg .= ' '.syntastic#c#ReadConfig(g:syntastic_c_config_file)
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_c_remove_include_errors') &&
\ g:syntastic_c_remove_include_errors != 0
return filter(errors,
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
else
return errors
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -0,0 +1,35 @@
"============================================================================
"File: checkpatch.vim
"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl
"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists("loaded_checkpatch_syntax_checker")
finish
endif
let loaded_checkpatch_syntax_checker = 1
" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed.
if executable("checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl'
elseif executable("./scripts/checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
else
finish
endif
function! SyntaxCheckers_c_GetLocList()
let makeprg = g:syntastic_c_checker_checkpatch_location
let makeprg .= " --no-summary --no-tree --terse --file ".shellescape(expand('%'))
let errorformat = '%f:%l: %tARNING: %m,%f:%l: %tRROR: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")} })
return loclist
endfunction

165
syntax_checkers/c/gcc.vim Normal file
View File

@ -0,0 +1,165 @@
"============================================================================
"File: c.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
" In order to also check header files add this to your .vimrc:
"
" let g:syntastic_c_check_header = 1
"
" To disable the search of included header files after special
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_c_no_include_search = 1
"
" To disable the include of the default include dirs (such as /usr/include)
" add this line to your .vimrc:
"
" let g:syntastic_c_no_default_include_dirs = 1
"
" To enable header files being re-checked on every file write add the
" following line to your .vimrc. Otherwise the header files are checked only
" one time on initially loading the file.
" In order to force syntastic to refresh the header includes simply
" unlet b:syntastic_c_includes. Then the header files are being re-checked on
" the next file write.
"
" let g:syntastic_c_auto_refresh_includes = 1
"
" Alternatively you can set the buffer local variable b:syntastic_c_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'
"
" In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable
" g:syntastic_c_include_dirs. This list can be used like this:
"
" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ]
"
" Moreover it is possible to add additional compiler options to the syntax
" checking execution via the variable 'g:syntastic_c_compiler_options':
"
" let g:syntastic_c_compiler_options = ' -ansi'
"
" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
" file that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_c_config':
"
" let g:syntastic_c_config_file = '.config'
"
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
" specify whether errors of files included via the g:syntastic_c_include_dirs'
" setting are removed from the result set:
"
" let g:syntastic_c_remove_include_errors = 1
"
" Use the variable 'g:syntastic_c_errorformat' to override the default error
" format:
"
" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m'
if exists('loaded_gcc_syntax_checker')
finish
endif
let loaded_gcc_syntax_checker = 1
if !executable(g:syntastic_c_checker)
finish
endif
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_c_compiler_options')
let g:syntastic_c_compiler_options = '-std=gnu99'
endif
if !exists('g:syntastic_c_config_file')
let g:syntastic_c_config_file = '.syntastic_c_config'
endif
function! SyntaxCheckers_c_GetLocList()
let makeprg = g:syntastic_c_checker . ' -x c -fsyntax-only '
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
\ 'each function it appears%.%#,%-GIn file included%.%#,'.
\ '%-G %#from %f:%l\,,%f:%l:%c: %trror: %m,%f:%l:%c: '.
\ '%tarning: %m,%f:%l:%c: %m,%f:%l: %trror: %m,'.
\ '%f:%l: %tarning: %m,%f:%l: %m'
if exists('g:syntastic_c_errorformat')
let errorformat = g:syntastic_c_errorformat
endif
" add optional user-defined compiler options
let makeprg .= g:syntastic_c_compiler_options
let makeprg .= ' '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
" determine whether to parse header files as well
if expand('%') =~? '.h$'
if exists('g:syntastic_c_check_header')
let makeprg = g:syntastic_c_checker
\ ' -c ' . shellescape(expand('%')) .
\ ' ' . g:syntastic_c_compiler_options .
\ ' ' . syntastic#c#GetNullDevice() .
\ ' ' . syntastic#c#GetIncludeDirs('c')
else
return []
endif
endif
" check if the user manually set some cflags
if !exists('b:syntastic_c_cflags')
" check whether to search for include files at all
if !exists('g:syntastic_c_no_include_search') ||
\ g:syntastic_c_no_include_search != 1
" refresh the include file search if desired
if exists('g:syntastic_c_auto_refresh_includes') &&
\ g:syntastic_c_auto_refresh_includes != 0
let makeprg .= syntastic#c#SearchHeaders()
else
" search for header includes if not cached already
if !exists('b:syntastic_c_includes')
let b:syntastic_c_includes = syntastic#c#SearchHeaders()
endif
let makeprg .= b:syntastic_c_includes
endif
endif
else
" use the user-defined cflags
let makeprg .= b:syntastic_c_cflags
endif
" add optional config file parameters
let makeprg .= ' '.syntastic#c#ReadConfig(g:syntastic_c_config_file)
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_c_remove_include_errors') &&
\ g:syntastic_c_remove_include_errors != 0
return filter(errors,
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
else
return errors
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -0,0 +1,34 @@
"============================================================================
"File: sparse.vim
"Description: Syntax checking plugin for syntastic.vim using sparse.pl
"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists("loaded_sparse_syntax_checker")
finish
endif
let loaded_sparse_syntax_checker = 1
" Bail if the user doesn't have `sparse.pl` or ./scripts/checkpatch.pl installed.
if !executable("sparse")
finish
endif
function! SyntaxCheckers_c_GetLocList()
let makeprg = "sparse "
let makeprg .= ' '.syntastic#c#ReadConfig(g:syntastic_sparse_config_file).' '
let makeprg .= shellescape(expand('%'))
let errorformat = '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,'
let loclist = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")} })
return loclist
endfunction

23
syntax_checkers/co.vim Normal file
View File

@ -0,0 +1,23 @@
"============================================================================
"File: co.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Andrew Kelley <superjoe30@gmail.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"bail if the user doesnt have coco installed
if !executable("coco")
finish
endif
function! SyntaxCheckers_co_GetLocList()
let makeprg = 'coco -c -o /tmp '.shellescape(expand('%'))
let errorformat = '%EFailed at: %f,%ZSyntax%trror: %m on line %l,%EFailed at: %f,%Z%trror: Parse error on line %l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -9,19 +9,37 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_coffee_syntax_checker")
finish
endif
let loaded_coffee_syntax_checker = 1
"bail if the user doesnt have coffee installed "bail if the user doesnt have coffee installed
if !executable("coffee") if !executable("coffee")
finish finish
endif endif
if !exists('g:syntastic_coffee_lint_options')
let g:syntastic_coffee_lint_options = ""
endif
function! SyntaxCheckers_coffee_GetLocList() function! SyntaxCheckers_coffee_GetLocList()
let makeprg = 'coffee -c -l -o /tmp '.shellescape(expand('%')) let makeprg = 'coffee -c -l -o /tmp '.shellescape(expand('%'))
let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#' let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let coffee_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
if !empty(coffee_results)
return coffee_results
endif
if executable("coffeelint")
return s:GetCoffeeLintErrors()
endif
return []
endfunction
function s:GetCoffeeLintErrors()
let coffeelint = 'coffeelint --csv '.g:syntastic_coffee_lint_options.' '.shellescape(expand('%'))
let lint_results = SyntasticMake({ 'makeprg': coffeelint, 'errorformat': '%f\,%l\,%trror\,%m', 'subtype': 'Style' })
return lint_results
endfunction endfunction

View File

@ -11,7 +11,6 @@
"============================================================================ "============================================================================
" in order to also check header files add this to your .vimrc: " in order to also check header files add this to your .vimrc:
" (this usually creates a .gch file in your source directory)
" "
" let g:syntastic_cpp_check_header = 1 " let g:syntastic_cpp_check_header = 1
" "
@ -20,6 +19,11 @@
" "
" let g:syntastic_cpp_no_include_search = 1 " let g:syntastic_cpp_no_include_search = 1
" "
" To disable the include of the default include dirs (such as /usr/include)
" add this line to your .vimrc:
"
" let g:syntastic_cpp_no_default_include_dirs = 1
"
" In order to add some custom include directories that should be added to the " In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable " gcc command line you can add those to the global variable
" g:syntastic_cpp_include_dirs. This list can be used like this: " g:syntastic_cpp_include_dirs. This list can be used like this:
@ -58,13 +62,25 @@
" g:syntastic_cpp_include_dirs' setting are removed from the result set: " g:syntastic_cpp_include_dirs' setting are removed from the result set:
" "
" let g:syntastic_cpp_remove_include_errors = 1 " let g:syntastic_cpp_remove_include_errors = 1
"
" Use the variable 'g:syntastic_cpp_errorformat' to override the default error
" format:
"
" let g:syntastic_cpp_errorformat = '%f:%l:%c: %trror: %m'
"
" Set your compiler executable with e.g. (defaults to g++)
"
" let g:syntastic_cpp_compiler = 'clang++'
if exists('loaded_cpp_syntax_checker') if !exists('g:syntastic_cpp_compiler')
finish let g:syntastic_cpp_compiler = 'g++'
endif endif
let loaded_cpp_syntax_checker = 1
if !executable('g++') if !exists('g:syntastic_cpp_compiler_options')
let g:syntastic_cpp_compiler_options = ''
endif
if !executable(g:syntastic_cpp_compiler)
finish finish
endif endif
@ -76,11 +92,14 @@ if !exists('g:syntastic_cpp_config_file')
endif endif
function! SyntaxCheckers_cpp_GetLocList() function! SyntaxCheckers_cpp_GetLocList()
let makeprg = 'g++ -fsyntax-only ' let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' .
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' \ g:syntastic_cpp_compiler_options
let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '.
\ '%m,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %tarning: %m,'.
\ '%f:%l: %m'
if exists('g:syntastic_cpp_compiler_options') if exists('g:syntastic_cpp_errorformat')
let makeprg .= g:syntastic_cpp_compiler_options let errorformat = g:syntastic_cpp_errorformat
endif endif
let makeprg .= ' ' . shellescape(expand('%')) . let makeprg .= ' ' . shellescape(expand('%')) .
@ -88,7 +107,9 @@ function! SyntaxCheckers_cpp_GetLocList()
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$' if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
if exists('g:syntastic_cpp_check_header') if exists('g:syntastic_cpp_check_header')
let makeprg = 'g++ -c '.shellescape(expand('%')). let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')) .
\ ' ' . g:syntastic_cpp_compiler_options .
\ ' ' . syntastic#c#GetNullDevice() .
\ ' ' . syntastic#c#GetIncludeDirs('cpp') \ ' ' . syntastic#c#GetIncludeDirs('cpp')
else else
return [] return []

25
syntax_checkers/cs.vim Normal file
View File

@ -0,0 +1,25 @@
"============================================================================
"File: cs.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Daniel Walker <dwalker@fifo99.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if !executable('mcs')
finish
endif
function! SyntaxCheckers_cs_GetLocList()
let makeprg = "mcs --parse ".shellescape(expand('%'))
let errorformat = '%f(%l\,%c): %trror %m'
let loclist = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")} })
return loclist
endfunction

View File

@ -8,10 +8,15 @@
" Want To Public License, Version 2, as published by Sam Hocevar. " Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================ "============================================================================
if exists("loaded_css_syntax_checker") "
finish " Specify additional options to csslint with this option. e.g. to disable
" warnings:
"
" let g:syntastic_csslint_options = "--warnings=none"
if !exists('g:syntastic_csslint_options')
let g:syntastic_csslint_options = ""
endif endif
let loaded_css_syntax_checker = 1
" Bail if the user doesn't have `csslint` installed. " Bail if the user doesn't have `csslint` installed.
if !executable("csslint") if !executable("csslint")
@ -19,7 +24,8 @@ if !executable("csslint")
endif endif
function! SyntaxCheckers_css_GetLocList() function! SyntaxCheckers_css_GetLocList()
let makeprg = 'csslint --format=compact '.shellescape(expand('%')) let makeprg = 'csslint --format=compact '.g:syntastic_csslint_options.' '.
\ shellescape(expand('%'))
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines. " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
let errorformat = '%-G,%-G%f: lint free!,%f: line %l\, col %c\, %trror - %m,%f: line %l\, col %c\, %tarning - %m,%f: line %l\, col %c\, %m,' let errorformat = '%-G,%-G%f: lint free!,%f: line %l\, col %c\, %trror - %m,%f: line %l\, col %c\, %tarning - %m,%f: line %l\, col %c\, %m,'

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_cucumber_syntax_checker")
finish
endif
let loaded_cucumber_syntax_checker = 1
"bail if the user doesnt have cucumber installed "bail if the user doesnt have cucumber installed
if !executable("cucumber") if !executable("cucumber")

View File

@ -11,23 +11,30 @@
" "
" let g:syntastic_cuda_check_header = 1 " let g:syntastic_cuda_check_header = 1
if exists('loaded_cuda_syntax_checker') " By default, nvcc and thus syntastic, defaults to the most basic architecture.
finish " This can produce false errors if the developer intends to compile for newer
endif " hardware and use newer features, eg. double precision numbers. To pass a
let loaded_cuda_syntax_checker = 1 " specific target arch to nvcc, e.g. add the following to your .vimrc:
"
" let g:syntastic_cuda_arch = "sm_20"
if !executable('nvcc') if !executable('nvcc')
finish finish
endif endif
function! SyntaxCheckers_cuda_GetLocList() function! SyntaxCheckers_cuda_GetLocList()
let makeprg = 'nvcc --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null' if exists('g:syntastic_cuda_arch')
let arch_flag = '-arch='.g:syntastic_cuda_arch
else
let arch_flag = ''
endif
let makeprg = 'nvcc '.arch_flag.' --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null'
"let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' "let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m' let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m'
if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$' if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$'
if exists('g:syntastic_cuda_check_header') if exists('g:syntastic_cuda_check_header')
let makeprg = 'echo > .syntastic_dummy.cu ; nvcc --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null' let makeprg = 'echo > .syntastic_dummy.cu ; nvcc '.arch_flag.' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null'
else else
return [] return []
endif endif

135
syntax_checkers/d.vim Normal file
View File

@ -0,0 +1,135 @@
"============================================================================
"File: d.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Alfredo Di Napoli <alfredo dot dinapoli at gmail dot com>
"License: Based on the original work of Gregor Uhlenheuer and his
" cpp.vim checker so credits are dued.
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
" HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
" OTHER DEALINGS IN THE SOFTWARE.
"
"============================================================================
" in order to also check header files add this to your .vimrc:
" (this usually creates a .gch file in your source directory)
"
" let g:syntastic_d_check_header = 1
"
" To disable the search of included header files after special
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_d_no_include_search = 1
"
" In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable
" g:syntastic_d_include_dirs. This list can be used like this:
"
" let g:syntastic_d_include_dirs = [ 'includes', 'headers' ]
"
" To enable header files being re-checked on every file write add the
" following line to your .vimrc. Otherwise the header files are checked only
" one time on initially loading the file.
" In order to force syntastic to refresh the header includes simply
" unlet b:syntastic_d_includes. Then the header files are being re-checked
" on the next file write.
"
" let g:syntastic_d_auto_refresh_includes = 1
"
" Alternatively you can set the buffer local variable b:syntastic_d_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_d_cflags = ' -I/usr/include/libsoup-2.4'
"
" Moreover it is possible to add additional compiler options to the syntax
" checking execution via the variable 'g:syntastic_d_compiler_options':
"
" let g:syntastic_d_compiler_options = ' -std=c++0x'
"
" Additionally the setting 'g:syntastic_d_config_file' allows you to define
" a file that contains additional compiler arguments like include directories
" or CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_d_config':
"
" let g:syntastic_d_config_file = '.config'
"
" Using the global variable 'g:syntastic_d_remove_include_errors' you can
" specify whether errors of files included via the
" g:syntastic_d_include_dirs' setting are removed from the result set:
"
" let g:syntastic_d_remove_include_errors = 1
if !executable('dmd')
finish
endif
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_d_config_file')
let g:syntastic_d_config_file = '.syntastic_d_config'
endif
function! SyntaxCheckers_d_GetLocList()
let makeprg = 'dmd -of/dev/null -c '
let errorformat = '%-G%f:%s:,%f(%l): %m,%f:%l: %m'
if exists('g:syntastic_d_compiler_options')
let makeprg .= g:syntastic_d_compiler_options
endif
let makeprg .= ' ' . shellescape(expand('%')) .
\ ' ' . syntastic#c#GetIncludeDirs('d')
if expand('%') =~? '\%(.di\)$'
if exists('g:syntastic_d_check_header')
let makeprg = 'dmd -c '.shellescape(expand('%')).
\ ' ' . syntastic#c#GetIncludeDirs('d')
else
return []
endif
endif
if !exists('b:syntastic_d_cflags')
if !exists('g:syntastic_d_no_include_search') ||
\ g:syntastic_d_no_include_search != 1
if exists('g:syntastic_d_auto_refresh_includes') &&
\ g:syntastic_d_auto_refresh_includes != 0
let makeprg .= syntastic#c#SearchHeaders()
else
if !exists('b:syntastic_d_includes')
let b:syntastic_d_includes = syntastic#c#SearchHeaders()
endif
let makeprg .= b:syntastic_d_includes
endif
endif
else
let makeprg .= b:syntastic_d_cflags
endif
" add optional config file parameters
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_d_config_file)
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_d_remove_include_errors') &&
\ g:syntastic_d_remove_include_errors != 0
return filter(errors,
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
else
return errors
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_docbk_syntax_checker")
finish
endif
let loaded_docbk_syntax_checker = 1
"bail if the user doesnt have tidy or grep installed "bail if the user doesnt have tidy or grep installed
if !executable("xmllint") if !executable("xmllint")
@ -21,7 +17,7 @@ endif
function! SyntaxCheckers_docbk_GetLocList() function! SyntaxCheckers_docbk_GetLocList()
let makeprg="xmllint --xinclude --noout --postvalid ".shellescape(expand(%:p)) let makeprg="xmllint --xinclude --noout --postvalid ".shellescape(expand("%:p"))
let errorformat='%E%f:%l: parser error : %m,%W%f:%l: parser warning : %m,%E%f:%l:%.%# validity error : %m,%W%f:%l:%.%# validity warning : %m,%-Z%p^,%-C%.%#,%-G%.%#' let errorformat='%E%f:%l: parser error : %m,%W%f:%l: parser warning : %m,%E%f:%l:%.%# validity error : %m,%W%f:%l:%.%# validity warning : %m,%-Z%p^,%-C%.%#,%-G%.%#'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })

View File

@ -1,9 +1,9 @@
#!/usr/bin/perl -w #!/usr/bin/perl
# vimparse.pl - Reformats the error messages of the Perl interpreter for use # vimparse.pl - Reformats the error messages of the Perl interpreter for use
# with the quickfix mode of Vim # with the quickfix mode of Vim
# #
# Copyright (©) 2001 by Jörg Ziefle <joerg.ziefle@gmx.de> # Copyright (c) 2001 by Jörg Ziefle <joerg.ziefle@gmx.de>
# Copyright (c) 2012 Eric Harmon <http://eharmon.net>
# You may use and distribute this software under the same terms as Perl itself. # You may use and distribute this software under the same terms as Perl itself.
# #
# Usage: put one of the two configurations below in your ~/.vimrc (without the # Usage: put one of the two configurations below in your ~/.vimrc (without the
@ -13,25 +13,27 @@
# Program is run interactively with 'perl -w': # Program is run interactively with 'perl -w':
# #
# set makeprg=$HOME/bin/vimparse.pl\ %\ $* # set makeprg=$HOME/bin/vimparse.pl\ %\ $*
# set errorformat=%f:%l:%m # set errorformat=%t:%f:%l:%m
# #
# Program is only compiled with 'perl -wc': # Program is only compiled with 'perl -wc':
# #
# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $* # set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
# set errorformat=%f:%l:%m # set errorformat=%t:%f:%l:%m
# #
# Usage: # Usage:
# vimparse.pl [-c] [-f <errorfile>] <programfile> [programargs] # vimparse.pl [-c] [-w] [-f <errorfile>] <programfile> [programargs]
# #
# -c compile only, don't run (perl -wc) # -c compile only, don't run (perl -wc)
# -w output warnings as warnings instead of errors (slightly slower)
# -f write errors to <errorfile> # -f write errors to <errorfile>
# #
# Example usages: # Example usages:
# * From the command line: # * From the command line:
# vimparse.pl program.pl # vimparse.pl program.pl
# #
# vimparse.pl -c -f errorfile program.pl # vimparse.pl -c -w -f errorfile program.pl
# Then run vim -q errorfile to edit the errors with Vim. # Then run vim -q errorfile to edit the errors with Vim.
# This uses the custom errorformat: %t:%f:%l:%m.
# #
# * From Vim: # * From Vim:
# Edit in Vim (and save, if you don't have autowrite on), then # Edit in Vim (and save, if you don't have autowrite on), then
@ -39,6 +41,9 @@
# to error check. # to error check.
# #
# Version history: # Version history:
# 0.3 (05/31/2012):
# * Added support for the seperate display of warnings
# * Switched output format to %t:%f:%l:%m to support error levels
# 0.2 (04/12/2001): # 0.2 (04/12/2001):
# * First public version (sent to Bram) # * First public version (sent to Bram)
# * -c command line option for compiling only # * -c command line option for compiling only
@ -60,15 +65,15 @@
# #
# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for # Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for
# you. # you.
use warnings;
use strict; use strict;
use Getopt::Std; use Getopt::Std;
use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars' use vars qw/$opt_I $opt_c $opt_w $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
use constant VERSION => 0.2; use constant VERSION => 0.2;
getopts('cf:h'); getopts('cwf:hI:');
&usage if $opt_h; # not necessarily needed, but good for further extension &usage if $opt_h; # not necessarily needed, but good for further extension
@ -86,20 +91,34 @@ my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
(my $file = shift) or &usage; # display usage if no filename is supplied (my $file = shift) or &usage; # display usage if no filename is supplied
my $args = (@ARGV ? ' ' . join ' ', @ARGV : ''); my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`; my $libs = join ' ', map {"-I$_"} split ',', $opt_I;
my @error_lines = `perl $libs @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-Mwarnings ']} "$file$args" 2>&1`;
my @lines = map { "E:$_" } @error_lines;
my @warn_lines;
if(defined($opt_w)) {
@warn_lines = `perl $libs @{[defined $opt_c ? '-c ' : '' ]} -Mwarnings "$file$args" 2>&1`;
}
# Any new errors must be warnings
foreach my $line (@warn_lines) {
if(!grep { $_ eq $line } @error_lines) {
push(@lines, "W:$line");
}
}
my $errors = 0; my $errors = 0;
foreach my $line (@lines) { foreach my $line (@lines) {
chomp($line); chomp($line);
my ($file, $lineno, $message, $rest); my ($file, $lineno, $message, $rest, $severity);
if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) { if ($line =~ /^([EW]):(.*)\sat\s(.*)\sline\s(\d+)(.*)$/) {
($severity, $message, $file, $lineno, $rest) = ($1, $2, $3, $4, $5);
($message, $file, $lineno, $rest) = ($1, $2, $3, $4);
$errors++; $errors++;
$message .= $rest if ($rest =~ s/^,//); $message .= $rest if ($rest =~ s/^,//);
print $handle "$file:$lineno:$message\n"; print $handle "$severity:$file:$lineno:$message\n";
} else { next }; } else { next };
@ -129,18 +148,21 @@ sub usage {
(local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
print<<EOT; print<<EOT;
Usage: Usage:
$0 [-c] [-f <errorfile>] <programfile> [programargs] $0 [-c] [-w] [-f <errorfile>] <programfile> [programargs]
-c compile only, don't run (executes 'perl -wc') -c compile only, don't run (executes 'perl -c')
-w output warnings as warnings instead of errors (slightly slower)
-f write errors to <errorfile> -f write errors to <errorfile>
-I specify \@INC/#include directory <perl_lib_path>
Examples: Examples:
* At the command line: * At the command line:
$0 program.pl $0 program.pl
Displays output on STDOUT. Displays output on STDOUT.
$0 -c -f errorfile program.pl $0 -c -w -f errorfile program.pl
Then run 'vim -q errorfile' to edit the errors with Vim. Then run 'vim -q errorfile' to edit the errors with Vim.
This uses the custom errorformat: %t:%f:%l:%m.
* In Vim: * In Vim:
Edit in Vim (and save, if you don't have autowrite on), then Edit in Vim (and save, if you don't have autowrite on), then

View File

@ -0,0 +1,26 @@
"============================================================================
"File: elixir.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Richard Ramsden <rramsden at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if !executable('elixir')
finish
endif
function! SyntaxCheckers_elixir_GetLocList()
let makeprg = 'elixir ' . shellescape(expand('%'))
let errorformat = '** %*[^\ ] %f:%l: %m'
let elixir_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
if !empty(elixir_results)
return elixir_results
endif
endfunction

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_erlang_syntax_checker")
finish
endif
let loaded_erlang_syntax_checker = 1
"bail if the user doesnt have escript installed "bail if the user doesnt have escript installed
if !executable("escript") if !executable("escript")
@ -20,6 +16,10 @@ if !executable("escript")
endif endif
let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl' let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl'
if !exists("g:syntastic_erlc_include_path")
let g:syntastic_erlc_include_path=""
endif
function! SyntaxCheckers_erlang_GetLocList() function! SyntaxCheckers_erlang_GetLocList()
let extension = expand('%:e') let extension = expand('%:e')
@ -31,10 +31,10 @@ function! SyntaxCheckers_erlang_GetLocList()
if match(shebang, 'escript') >= 0 if match(shebang, 'escript') >= 0
let makeprg = 'escript -s '.shellescape(expand('%:p')) let makeprg = 'escript -s '.shellescape(expand('%:p'))
else else
let makeprg = s:check_file . ' '. shellescape(expand('%:p')) let makeprg = s:check_file . ' '. shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path
endif endif
else else
let makeprg = s:check_file . ' ' . shellescape(expand('%:p')) let makeprg = s:check_file . ' ' . shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path
endif endif
let errorformat = '%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m' let errorformat = '%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m'

View File

@ -1,6 +1,10 @@
#!/usr/bin/env escript #!/usr/bin/env escript
-export([main/1]). -export([main/1]).
main([FileName| LibDirs=[_|_]]) ->
code:add_pathsa(LibDirs),
main([FileName]);
main([FileName]) -> main([FileName]) ->
compile:file(FileName, [warn_obsolete_guard, compile:file(FileName, [warn_obsolete_guard,
warn_unused_import, warn_unused_import,
@ -8,5 +12,7 @@ main([FileName]) ->
warn_export_vars, warn_export_vars,
strong_validation, strong_validation,
report, report,
{i, filename:dirname(FileName) ++ "/../include"} {i, filename:dirname(FileName) ++ "/../include"},
{i, filename:dirname(FileName) ++ "/../deps"},
{i, filename:dirname(FileName) ++ "/../../../deps"}
]). ]).

View File

@ -9,26 +9,28 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_eruby_syntax_checker")
finish
endif
let loaded_eruby_syntax_checker = 1
"bail if the user doesnt have ruby or cat installed if !exists("g:syntastic_ruby_exec")
if !executable("ruby") || !executable("cat") let g:syntastic_ruby_exec = "ruby"
endif
"bail if the user doesnt have ruby installed
if !executable(expand(g:syntastic_ruby_exec))
finish finish
endif endif
function! SyntaxCheckers_eruby_GetLocList() function! SyntaxCheckers_eruby_GetLocList()
if has('win32') let ruby_exec=expand(g:syntastic_ruby_exec)
let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c' if !has('win32')
else let ruby_exec='RUBYOPT= ' . ruby_exec
let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= ruby -c'
endif endif
let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#' "gsub fixes issue #7 rails has it's own eruby syntax
return SyntasticMake({ 'makeprg': makeprg, let makeprg=ruby_exec . ' -rerb -e "puts ERB.new(File.read(''' .
\ 'errorformat': errorformat, \ (expand("%")) .
\ 'defaults': {'bufnr': bufnr("")} }) \ ''').gsub(''<\%='',''<\%''), nil, ''-'').src" \| ' . ruby_exec . ' -c'
let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction

View File

@ -18,11 +18,6 @@
" "
"============================================================================ "============================================================================
if exists("loaded_fortran_syntax_checker")
finish
endif
let loaded_fortran_syntax_checker = 1
"bail if the user doesnt have fortran installed "bail if the user doesnt have fortran installed
if !executable("gfortran") if !executable("gfortran")
finish finish

View File

@ -20,11 +20,6 @@
" See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more " See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more
" information. " information.
if exists("loaded_gentoo_metadata_syntax_checker")
finish
endif
let loaded_gentoo_metadata_syntax_checker = 1
"bail if the user doesn't have xmllint installed "bail if the user doesn't have xmllint installed
if !executable("xmllint") if !executable("xmllint")
finish finish

View File

@ -13,10 +13,5 @@
" If g:syntastic_go_checker is not set, just use the first syntax " If g:syntastic_go_checker is not set, just use the first syntax
" checker that we find installed. " checker that we find installed.
"============================================================================ "============================================================================
if exists("loaded_go_syntax_checker")
finish
endif
let loaded_go_syntax_checker = 1
let s:supported_checkers = ["go", "6g", "gofmt"] call SyntasticLoadChecker('go')
call SyntasticLoadChecker(s:supported_checkers, 'go')

View File

@ -1,6 +1,6 @@
"============================================================================ "============================================================================
"File: go.vim "File: go.vim
"Description: Check go syntax using 'go build' "Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]'
"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net> "Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
@ -8,10 +8,44 @@
" Want To Public License, Version 2, as published by Sam Hocevar. " Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
" This syntax checker does not reformat your source code.
" Use a BufWritePre autocommand to that end:
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
"============================================================================ "============================================================================
function! SyntaxCheckers_go_GetLocList() function! SyntaxCheckers_go_GetLocList()
" Check with gofmt first, since `go build` and `go test` might not report
" syntax errors in the current file if another file with syntax error is
" compiled first.
let makeprg = 'gofmt -l % 1>/dev/null'
let errorformat = '%f:%l:%c: %m,%-G%.%#'
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
if !empty(errors)
return errors
endif
" Test files, i.e. files with a name ending in `_test.go`, are not
" compiled by `go build`, therefore `go test` must be called for those.
if match(expand('%'), '_test.go$') == -1
let makeprg = 'go build -o /dev/null' let makeprg = 'go build -o /dev/null'
else
let makeprg = 'go test -c -o /dev/null'
endif
let errorformat = '%f:%l:%c:%m,%f:%l%m,%-G#%.%#' let errorformat = '%f:%l:%c:%m,%f:%l%m,%-G#%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) " The go compiler needs to either be run with an import path as an
" argument or directly from the package directory. Since figuring out
" the poper import path is fickle, just pushd/popd to the package.
let popd = getcwd()
let pushd = expand('%:p:h')
"
" pushd
exec 'lcd ' . fnameescape(pushd)
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
" popd
exec 'lcd ' . fnameescape(popd)
return errors
endfunction endfunction

View File

@ -1,6 +1,6 @@
"============================================================================ "============================================================================
"File: gofmt.vim "File: gofmt.vim
"Description: Check go syntax using gofmt "Description: Check go syntax using 'gofmt -l'
"Maintainer: Brandon Thomson <bt@brandonthomson.com> "Maintainer: Brandon Thomson <bt@brandonthomson.com>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
@ -8,9 +8,12 @@
" Want To Public License, Version 2, as published by Sam Hocevar. " Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
" This syntax checker does not reformat your source code.
" Use a BufWritePre autocommand to that end:
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
"============================================================================ "============================================================================
function! SyntaxCheckers_go_GetLocList() function! SyntaxCheckers_go_GetLocList()
let makeprg = 'gofmt %' let makeprg = 'gofmt -l % 1>/dev/null'
let errorformat = '%f:%l:%c: %m,%-G%.%#' let errorformat = '%f:%l:%c: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
endfunction endfunction

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_haml_syntax_checker")
finish
endif
let loaded_haml_syntax_checker = 1
"bail if the user doesnt have the haml binary installed "bail if the user doesnt have the haml binary installed
if !executable("haml") if !executable("haml")

View File

@ -9,34 +9,19 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_haskell_syntax_checker")
finish if !exists('g:syntastic_haskell_checker')
if executable('hdevtools')
runtime! syntax_checkers/haskell/hdevtools.vim
elseif executable('ghc-mod')
runtime! syntax_checkers/haskell/ghc-mod.vim
endif
elseif g:syntastic_haskell_checker == 'hdevtools'
if executable('hdevtools')
runtime! syntax_checkers/haskell/hdevtools.vim
endif
elseif g:syntastic_haskell_checker == 'ghc-mod'
if executable('ghc-mod')
runtime! syntax_checkers/haskell/ghc-mod.vim
endif
endif endif
let loaded_haskell_syntax_checker = 1
"bail if the user doesnt have ghc-mod installed
if !executable("ghc-mod")
finish
endif
if !exists('g:syntastic_haskell_checker_args')
let g:syntastic_haskell_checker_args = '--hlintOpt="--language=XmlSyntax"'
endif
function! SyntaxCheckers_haskell_GetLocList()
let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
let makeprg =
\ "{ ".
\ ghcmod . " check ". shellescape(expand('%')) . "; " .
\ ghcmod . " lint " . shellescape(expand('%')) . ";" .
\ " }"
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
\ '%E%f:%l:%c:,%Z%m,'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
function! SyntaxCheckers_lhaskell_GetLocList()
return SyntaxCheckers_haskell_GetLocList()
endfunction

View File

@ -0,0 +1,33 @@
"============================================================================
"File: ghc-mod.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if !exists('g:syntastic_haskell_checker_args')
let g:syntastic_haskell_checker_args = '--ghcOpt="-fno-code" --hlintOpt="--language=XmlSyntax"'
endif
function! SyntaxCheckers_haskell_GetLocList()
let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
let makeprg =
\ "{ ".
\ ghcmod . " check ". shellescape(expand('%')) . "; " .
\ ghcmod . " lint " . shellescape(expand('%')) . ";" .
\ " }"
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
\ '%E%f:%l:%c:,%Z%m,'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
function! SyntaxCheckers_lhaskell_GetLocList()
return SyntaxCheckers_haskell_GetLocList()
endfunction

View File

@ -0,0 +1,30 @@
"============================================================================
"File: hdevtools.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
function! SyntaxCheckers_haskell_GetLocList()
let makeprg = 'hdevtools check ' . get(g:, 'hdevtools_options', '') .
\ ' ' . shellescape(expand('%'))
let errorformat= '\%-Z\ %#,'.
\ '%W%f:%l:%c:\ Warning:\ %m,'.
\ '%E%f:%l:%c:\ %m,'.
\ '%E%>%f:%l:%c:,'.
\ '%+C\ \ %#%m,'.
\ '%W%>%f:%l:%c:,'.
\ '%+C\ \ %#%tarning:\ %m,'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
function! SyntaxCheckers_lhaskell_GetLocList()
return SyntaxCheckers_haskell_GetLocList()
endfunction

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_haxe_syntax_checker")
finish
endif
let loaded_haxe_syntax_checker = 1
"bail if the user doesn't have haxe installed "bail if the user doesn't have haxe installed
if !executable("haxe") if !executable("haxe")

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_html_syntax_checker")
finish
endif
let loaded_html_syntax_checker = 1
if !exists('g:syntastic_html_checker') if !exists('g:syntastic_html_checker')
let g:syntastic_html_checker = "tidy" let g:syntastic_html_checker = "tidy"

View File

@ -50,7 +50,7 @@ endfunction
function! SyntaxCheckers_html_GetLocList() function! SyntaxCheckers_html_GetLocList()
let encopt = s:TidyEncOptByFenc() let encopt = s:TidyEncOptByFenc()
let makeprg="tidy ".encopt." --new-blocklevel-tags ".shellescape('section, article, aside, hgroup, header, footer, nav, figure, figcaption')." --new-inline-tags ".shellescape('video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist')." --new-empty-tags ".shellescape('wbr, keygen')." -e ".shellescape(expand('%'))." 2>&1" let makeprg="tidy ".encopt." --new-blocklevel-tags ".shellescape('section, article, aside, hgroup, header, footer, nav, figure, figcaption')." --new-inline-tags ".shellescape('video, audio, source, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist')." --new-empty-tags ".shellescape('wbr, keygen')." -e ".shellescape(expand('%'))." 2>&1"
let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#' let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })

View File

@ -1,28 +1,18 @@
"============================================================================ "============================================================================
"File: java.vim "File: java.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Figures out which java syntax checker (if any) to load
"Maintainer: Jochen Keil <jochen.keil at gmail dot com> " from the java directory.
"Maintainer: Dmitry Geurkov <d.geurkov at gmail dot com>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar. " Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
" Use g:syntastic_java_checker option to specify which java syntax checker
" should be used (see below for a list of supported checkers).
" If g:syntastic_java_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================ "============================================================================
function! SyntaxCheckers_java_GetLocList()
let makeprg = 'javac -Xlint ' call SyntasticLoadChecker('java')
\. expand ( '%:p:h' ) . '/' . expand ( '%:t' )
\. ' 2>&1 \| '
\. 'sed -e "s\|'
\. expand ( '%:t' )
\. '\|'
\. expand ( '%:p:h' ) . '/' . expand ( '%:t' )
\. '\|"'
" unashamedly stolen from *errorformat-javac* (quickfix.txt)
let errorformat = '%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -0,0 +1,33 @@
"============================================================================
"File: checkstyle.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Dmitry Geurkov <d.geurkov at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
" Tested with checkstyle 5.5
"============================================================================
if !exists("g:syntastic_java_checkstyle_classpath")
let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar'
endif
if !exists("g:syntastic_java_checkstyle_conf_file")
let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
endif
function! SyntaxCheckers_java_GetLocList()
let makeprg = 'java -cp ' . g:syntastic_java_checkstyle_classpath . ' com.puppycrawl.tools.checkstyle.Main -c '
\. g:syntastic_java_checkstyle_conf_file . ' '
\. expand ( '%:p:h' ) . '/' . expand ( '%:t' )
\. ' 2>&1 '
" check style format
let errorformat = '%f:%l:%c:\ %m,%f:%l:\ %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -0,0 +1,227 @@
"============================================================================
"File: javac.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Jochen Keil <jochen.keil at gmail dot com>
" Dmitry Geurkov <d.geurkov at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
" Global Options
if !exists("g:syntastic_java_javac_executable")
let g:syntastic_java_javac_executable = 'javac'
endif
if !exists("g:syntastic_java_javac_options")
let g:syntastic_java_javac_options = '-Xlint'
endif
if !exists("g:syntastic_java_javac_classpath")
let g:syntastic_java_javac_classpath = ''
endif
if !exists("g:syntastic_java_javac_delete_output")
let g:syntastic_java_javac_delete_output = 1
endif
if !exists("g:syntastic_java_javac_temp_dir")
if has('win32') || has('win64')
let g:syntastic_java_javac_temp_dir = $TEMP."\\vim-syntastic-javac"
else
let g:syntastic_java_javac_temp_dir = '/tmp/vim-syntastic-javac'
endif
endif
if !exists("g:syntastic_java_javac_autoload_maven_classpath")
let g:syntastic_java_javac_autoload_maven_classpath = 1
endif
if !exists('g:syntastic_java_javac_config_file_enabled')
let g:syntastic_java_javac_config_file_enabled = 0
endif
if !exists('g:syntastic_java_javac_config_file')
let g:syntastic_java_javac_config_file = '.syntastic_javac_config'
endif
" Internal variables, do not ovveride those
if !exists("g:syntastic_java_javac_maven_pom_cwd")
let g:syntastic_java_javac_maven_pom_cwd = ''
endif
if !exists("g:syntastic_java_javac_maven_pom_ftime")
let g:syntastic_java_javac_maven_pom_ftime = 0
endif
if !exists("g:syntastic_java_javac_maven_pom_classpath")
let g:syntastic_java_javac_maven_pom_classpath = ''
endif
" recursively remove directory and all it's sub-directories
function! s:RemoveDir(dir)
if isdirectory(a:dir)
for f in split(globpath(a:dir,'*'),"\n")
call s:RemoveDir(f)
endfor
silent! call system('rmdir '.a:dir)
else
silent! call delete(a:dir)
endif
endfunction
function! s:AddToClasspath(classpath,path)
if a:path == ''
return a:classpath
endif
if a:classpath != '' && a:path != ''
if has('win32') || has('win64')
return a:classpath . ";" . a:path
else
return a:classpath . ":" . a:path
endif
else
return a:path
endif
endfunction
function! s:LoadClasspathFromConfigFile()
if filereadable(g:syntastic_java_javac_config_file)
let path = ''
let lines = readfile(g:syntastic_java_javac_config_file)
for l in lines
if l != ''
let path .= l."\n"
endif
endfor
return path
else
return ''
endif
endfunction
function! s:SaveClasspath()
let path = ''
let lines = getline(1,line('$'))
" save classpath to config file
if g:syntastic_java_javac_config_file_enabled
call writefile(lines,g:syntastic_java_javac_config_file)
endif
for l in lines
if l != ''
let path .= l."\n"
endif
endfor
let g:syntastic_java_javac_classpath = path
let &modified = 0
endfunction
function! s:EditClasspath()
let command = 'syntastic javac classpath'
let winnr = bufwinnr('^' . command . '$')
if winnr < 0
let pathlist = split(g:syntastic_java_javac_classpath,"\n")
execute (len(pathlist)+5) . 'sp ' . fnameescape(command)
au BufWriteCmd <buffer> call s:SaveClasspath() | bwipeout
setlocal buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number
for p in pathlist | call append(line('$')-1,p) | endfor
else
execute winnr . 'wincmd w'
endif
endfunction
command! SyntasticJavacEditClasspath call s:EditClasspath()
function! s:GetMavenClasspath()
if filereadable('pom.xml')
if g:syntastic_java_javac_maven_pom_ftime != getftime('pom.xml') || g:syntastic_java_javac_maven_pom_cwd != getcwd()
let mvn_classpath_output = split(system('mvn dependency:build-classpath'),"\n")
let class_path_next = 0
for line in mvn_classpath_output
if class_path_next == 1
let mvn_classpath = line
break
endif
if match(line,'Dependencies classpath:') >= 0
let class_path_next = 1
endif
endfor
let mvn_classpath = s:AddToClasspath(mvn_classpath,'target/classes')
let g:syntastic_java_javac_maven_pom_cwd = getcwd()
let g:syntastic_java_javac_maven_pom_ftime = getftime('pom.xml')
let g:syntastic_java_javac_maven_pom_classpath = mvn_classpath
endif
return g:syntastic_java_javac_maven_pom_classpath
endif
return ''
endfunction
function! SyntaxCheckers_java_GetLocList()
let javac_opts = g:syntastic_java_javac_options
if g:syntastic_java_javac_delete_output
let output_dir = g:syntastic_java_javac_temp_dir
let javac_opts .= ' -d ' .output_dir
endif
" load classpath from config file
if g:syntastic_java_javac_config_file_enabled
let loaded_classpath = s:LoadClasspathFromConfigFile()
if loaded_classpath != ''
let g:syntastic_java_javac_classpath = loaded_classpath
endif
endif
let javac_classpath = ''
" add classpathes to javac_classpath
for path in split(g:syntastic_java_javac_classpath,"\n")
if path != ''
let ps = glob(path,0,1)
if type(ps) == type([])
for p in ps
if p != '' | let javac_classpath = s:AddToClasspath(javac_classpath,p) | endif
endfor
else
let javac_classpath = s:AddToClasspath(javac_classpath,ps)
endif
endif
endfor
if g:syntastic_java_javac_autoload_maven_classpath
let maven_classpath = s:GetMavenClasspath()
let javac_classpath = s:AddToClasspath(javac_classpath,maven_classpath)
endif
if javac_classpath != ''
let javac_opts .= ' -cp ' . javac_classpath
endif
" path seperator
if has('win32') || has('win64')
let sep = "\\"
else
let sep = '/'
endif
let makeprg = g:syntastic_java_javac_executable . ' '. javac_opts . ' '
\. '"'.expand ( '%:p:h' ) . sep . expand ( '%:t' ).'"'
\. ' 2>&1 '
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
let errorformat = '%E%f:%l:\ error:\ %m,%W%f:%l:\ warning:\ %m,%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#'
if g:syntastic_java_javac_delete_output
silent! call mkdir(output_dir,'p')
endif
let r = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
if g:syntastic_java_javac_delete_output
call s:RemoveDir(output_dir)
endif
return r
endfunction

View File

@ -14,10 +14,5 @@
" If g:syntastic_javascript_checker is not set, just use the first syntax " If g:syntastic_javascript_checker is not set, just use the first syntax
" checker that we find installed. " checker that we find installed.
"============================================================================ "============================================================================
if exists("loaded_javascript_syntax_checker")
finish
endif
let loaded_javascript_syntax_checker = 1
let s:supported_checkers = ["gjslint", "jslint", "jsl", "jshint"] call SyntasticLoadChecker('javascript')
call SyntasticLoadChecker(s:supported_checkers, 'javascript')

View File

@ -0,0 +1,43 @@
"============================================================================
"File: closurecompiler.vim
"Description: Javascript syntax checker - using Google Closure Compiler
"Maintainer: Motohiro Takayama <mootoh at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
"
" To enable this plugin, edit the .vimrc like this:
"
" let g:syntastic_javascript_checker = "closurecompiler"
"
" and set the path to the Google Closure Compiler:
"
" let g:syntastic_javascript_closure_compiler_path = '/path/to/google-closure-compiler.jar'
"
" It takes additional options for Google Closure Compiler with the variable
" g:syntastic_javascript_closure_compiler_options.
"
if !exists("g:syntastic_javascript_closure_compiler_options")
let g:syntastic_javascript_closure_compiler_options = ""
endif
"bail if the user does not specify the path to closure compiler.
if !exists("g:syntastic_javascript_closure_compiler_path")
finish
endif
function! SyntaxCheckers_javascript_GetLocList()
if exists("g:syntastic_javascript_closure_compiler_file_list")
let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ')
else
let file_list = shellescape(expand('%'))
endif
let makeprg = 'java -jar ' . g:syntastic_javascript_closure_compiler_path . ' ' . g:syntastic_javascript_closure_compiler_options . ' --js ' . file_list
let errorformat = '%-GOK,%E%f:%l: ERROR - %m,%Z%p^,%W%f:%l: WARNING - %m,%Z%p^'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -12,8 +12,16 @@ if !exists("g:syntastic_javascript_jsl_conf")
let g:syntastic_javascript_jsl_conf = "" let g:syntastic_javascript_jsl_conf = ""
endif endif
function s:ConfFlag()
if !empty(g:syntastic_javascript_jsl_conf)
return "-conf " . g:syntastic_javascript_jsl_conf
endif
return ""
endfunction
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_GetLocList()
let makeprg = "jsl " . g:syntastic_javascript_jsl_conf . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%')) let makeprg = "jsl " . s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%'))
let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G' let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction

View File

@ -14,10 +14,5 @@
" If g:syntastic_json_checker is not set, just use the first syntax " If g:syntastic_json_checker is not set, just use the first syntax
" checker that we find installed. " checker that we find installed.
"============================================================================ "============================================================================
if exists("loaded_json_syntax_checker")
finish
endif
let loaded_json_syntax_checker = 1
let s:supported_checkers = ["jsonlint", "jsonval"] call SyntasticLoadChecker('json')
call SyntasticLoadChecker(s:supported_checkers, 'json')

View File

@ -0,0 +1,41 @@
#!/usr/bin/env node
fs = require 'fs'
less = require 'less'
args = process.argv.slice(1)
options = {}
args = args.filter (arg) ->
match = arg.match(/^-I(.+)$/)
if match
options.paths.push(match[1]);
return false
match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i)
if match
arg = match[1]
else
return arg
switch arg
when 'strict-imports' then options.strictImports = true
when 'include-path'
options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':')
.map (p) ->
if p
return path.resolve(process.cwd(), p)
when 'O0' then options.optimization = 0
when 'O1' then options.optimization = 1
when 'O2' then options.optimization = 2
options.filename = args[1]
parser = new(less.Parser) options
fs.readFile(options.filename, 'utf-8', (err,data) ->
parser.parse(data, (err, tree) ->
if err
less.writeError err
process.exit(1)
)
)

View File

@ -0,0 +1,57 @@
// Generated by CoffeeScript 1.3.3
(function() {
var args, fs, less, options, parser;
fs = require('fs');
less = require('less');
args = process.argv.slice(1);
options = {};
args = args.filter(function(arg) {
var match;
match = arg.match(/^-I(.+)$/);
if (match) {
options.paths.push(match[1]);
return false;
}
match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i);
if (match) {
arg = match[1];
} else {
return arg;
}
switch (arg) {
case 'strict-imports':
return options.strictImports = true;
case 'include-path':
return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) {
if (p) {
return path.resolve(process.cwd(), p);
}
});
case 'O0':
return options.optimization = 0;
case 'O1':
return options.optimization = 1;
case 'O2':
return options.optimization = 2;
}
});
options.filename = args[1];
parser = new less.Parser(options);
fs.readFile(options.filename, 'utf-8', function(err, data) {
return parser.parse(data, function(err, tree) {
if (err) {
less.writeError(err);
return process.exit(1);
}
});
});
}).call(this);

View File

@ -9,10 +9,13 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_less_syntax_checker")
finish " To send additional options to less use the variable g:syntastic_less_options.
endif " The default is
let loaded_less_syntax_checker = 1 " let g:syntastic_less_options = "--no-color"
"
" To use less-lint instead of less set the variable
" g:syntastic_less_use_less_lint.
"bail if the user doesnt have the lessc binary installed "bail if the user doesnt have the lessc binary installed
if !executable("lessc") if !executable("lessc")
@ -23,13 +26,20 @@ if !exists("g:syntastic_less_options")
let g:syntastic_less_options = "--no-color" let g:syntastic_less_options = "--no-color"
endif endif
function! SyntaxCheckers_less_GetLocList() if !exists("g:syntastic_less_use_less_lint")
let makeprg = 'lessc '. g:syntastic_less_options .' '. shellescape(expand('%')) . ' /dev/null' let g:syntastic_less_use_less_lint = 0
endif
"lessc >= 1.2 if g:syntastic_less_use_less_lint
let s:check_file = 'node ' . expand('<sfile>:p:h') . '/less-lint.js'
else
let s:check_file = 'lessc'
end
function! SyntaxCheckers_less_GetLocList()
let makeprg = s:check_file . ' ' . g:syntastic_less_options . ' ' .
\ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
let errorformat = '%m in %f:%l:%c' let errorformat = '%m in %f:%l:%c'
"lessc < 1.2
let errorformat .= ', Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, return SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,

26
syntax_checkers/lisp.vim Normal file
View File

@ -0,0 +1,26 @@
"============================================================================
"File: lisp.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
" Bail if the user doesnt have clisp installed
if !executable("clisp")
finish
endif
function! SyntaxCheckers_lisp_GetLocList()
let makeprg = 'clisp -c ' . shellescape(expand('%'))
let makeprg .= ' -o /tmp/clisp-vim-compiled-file'
let efm = '%-G;%.%#,'
let efm .= '%W%>WARNING:%.%#line %l : %m,%C %#%m,'
let efm .= '%E%>The following functions were %m,%Z %m,'
let efm .= '%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': efm })
endfunction

View File

@ -10,11 +10,6 @@
" "
"============================================================================ "============================================================================
if exists('loaded_lua_syntax_checker')
finish
endif
let loaded_lua_syntax_checker = 1
" check if the lua compiler is installed " check if the lua compiler is installed
if !executable('luac') if !executable('luac')
finish finish

View File

@ -10,11 +10,6 @@
" "
"============================================================================ "============================================================================
if exists("loaded_matlab_syntax_checker")
finish
endif
let loaded_matlab_syntax_checker = 1
"bail if the user doesn't have mlint installed "bail if the user doesn't have mlint installed
if !executable("mlint") if !executable("mlint")
finish finish

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_nasm_syntax_checker")
finish
endif
let loaded_nasm_syntax_checker = 1
"bail if the user doesnt have nasm installed "bail if the user doesnt have nasm installed
if !executable("nasm") if !executable("nasm")

155
syntax_checkers/objc.vim Normal file
View File

@ -0,0 +1,155 @@
"============================================================================
"File: objc.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
" In order to also check header files add this to your .vimrc:
" (this usually creates a .gch file in your source directory)
"
" let g:syntastic_objc_check_header = 1
"
" To disable the search of included header files after special
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_objc_no_include_search = 1
"
" To enable header files being re-checked on every file write add the
" following line to your .vimrc. Otherwise the header files are checked only
" one time on initially loading the file.
" In order to force syntastic to refresh the header includes simply
" unlet b:syntastic_objc_includes. Then the header files are being re-checked on
" the next file write.
"
" let g:syntastic_objc_auto_refresh_includes = 1
"
" Alternatively you can set the buffer local variable b:syntastic_objc_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_objc_cflags = ' -I/usr/include/libsoup-2.4'
"
" In order to add some custom include directories that should be added to the
" gcc command line you can add those to the global variable
" g:syntastic_objc_include_dirs. This list can be used like this:
"
" let g:syntastic_objc_include_dirs = [ 'includes', 'headers' ]
"
" Moreover it is possible to add additional compiler options to the syntax
" checking execution via the variable 'g:syntastic_objc_compiler_options':
"
" let g:syntastic_objc_compiler_options = ' -ansi'
"
" Additionally the setting 'g:syntastic_objc_config_file' allows you to define a
" file that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_objc_config':
"
" let g:syntastic_objc_config_file = '.config'
"
" Using the global variable 'g:syntastic_objc_remove_include_errors' you can
" specify whether errors of files included via the g:syntastic_objc_include_dirs'
" setting are removed from the result set:
"
" let g:syntastic_objc_remove_include_errors = 1
"
" Use the variable 'g:syntastic_objc_errorformat' to override the default error
" format:
"
" let g:syntastic_objc_errorformat = '%f:%l:%c: %trror: %m'
if !executable('gcc')
finish
endif
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_objc_compiler_options')
let g:syntastic_objc_compiler_options = ''
endif
if !exists('g:syntastic_objc_config_file')
let g:syntastic_objc_config_file = '.syntastic_objc_config'
endif
function! SyntaxCheckers_objc_GetLocList()
let makeprg = 'gcc -fsyntax-only -lobjc'
let errorformat =
\ '%-G%f:%s:,'.
\ '%f:%l:%c: %trror: %m,'.
\ '%f:%l:%c: %tarning: %m,'.
\ '%f:%l:%c: %m,'.
\ '%f:%l: %trror: %m,'.
\ '%f:%l: %tarning: %m,'.
\ '%f:%l: %m'
if exists('g:syntastic_objc_errorformat')
let errorformat = g:syntastic_objc_errorformat
endif
" add optional user-defined compiler options
let makeprg .= g:syntastic_objc_compiler_options
let makeprg .= ' '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
" determine whether to parse header files as well
if expand('%') =~? '.h$'
if exists('g:syntastic_objc_check_header')
let makeprg = 'gcc -c '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
else
return []
endif
endif
" check if the user manually set some cflags
if !exists('b:syntastic_objc_cflags')
" check whether to search for include files at all
if !exists('g:syntastic_objc_no_include_search') ||
\ g:syntastic_objc_no_include_search != 1
" refresh the include file search if desired
if exists('g:syntastic_objc_auto_refresh_includes') &&
\ g:syntastic_objc_auto_refresh_includes != 0
let makeprg .= syntastic#c#SearchHeaders()
else
" search for header includes if not cached already
if !exists('b:syntastic_objc_includes')
let b:syntastic_objc_includes = syntastic#c#SearchHeaders()
endif
let makeprg .= b:syntastic_objc_includes
endif
endif
else
" use the user-defined cflags
let makeprg .= b:syntastic_objc_cflags
endif
" add optional config file parameters
let makeprg .= ' '.syntastic#c#ReadConfig(g:syntastic_objc_config_file)
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
" filter the processed errors if desired
if exists('g:syntastic_objc_remove_include_errors') &&
\ g:syntastic_objc_remove_include_errors != 0
return filter(errors,
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
else
return errors
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -10,6 +10,20 @@
" "
"============================================================================ "============================================================================
" "
" The more reliable way to check for a single .ml file is to use ocamlc.
" You can do that setting this in your .vimrc:
"
" let g:syntastic_ocaml_use_ocamlc = 1
" It's possible to use ocamlc in conjuction with Jane Street's Core. In order
" to do that, you have to specify this in your .vimrc:
"
" let g:syntastic_ocaml_use_janestreet_core = 1
" let g:syntastic_ocaml_janestreet_core_dir = <path>
"
" Where path is the path to your core installation (usually a collection of
" .cmx and .cmxa files).
"
"
" By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files, " By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files,
" ocamllex is used to check .mll files and menhir is used to check .mly files. " ocamllex is used to check .mll files and menhir is used to check .mly files.
" The output is all redirected to /dev/null, nothing is written to the disk. " The output is all redirected to /dev/null, nothing is written to the disk.
@ -34,11 +48,6 @@
" For best results your current directory should be the project root " For best results your current directory should be the project root
" (same situation if you want useful output from :make). " (same situation if you want useful output from :make).
if exists("loaded_ocaml_syntax_checker")
finish
endif
let loaded_ocaml_syntax_checker = 1
if exists('g:syntastic_ocaml_camlp4r') && if exists('g:syntastic_ocaml_camlp4r') &&
\ g:syntastic_ocaml_camlp4r != 0 \ g:syntastic_ocaml_camlp4r != 0
let s:ocamlpp="camlp4r" let s:ocamlpp="camlp4r"
@ -51,30 +60,24 @@ if !executable(s:ocamlpp)
finish finish
endif endif
if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
let g:syntastic_ocaml_use_ocamlc = 0
endif
if !exists('g:syntastic_ocaml_use_janestreet_core')
let g:syntastic_ocaml_use_ocamlc = 0
endif
if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")
let g:syntastic_ocaml_use_ocamlbuild = 0
endif
function! SyntaxCheckers_ocaml_GetLocList() function! SyntaxCheckers_ocaml_GetLocList()
if exists('g:syntastic_ocaml_use_ocamlbuild') && let makeprg = s:GetMakeprg()
\ g:syntastic_ocaml_use_ocamlbuild != 0 && if makeprg == ""
\ executable("ocamlbuild") &&
\ isdirectory('_build')
let makeprg = "ocamlbuild -quiet -no-log -tag annot,". s:ocamlpp. " -no-links -no-hygiene -no-sanitize ".
\ shellescape(expand('%:r')).".cmi"
else
let extension = expand('%:e')
if match(extension, 'mly') >= 0
" ocamlyacc output can't be redirected, so use menhir
if !executable("menhir")
return [] return []
endif endif
let makeprg = "menhir --only-preprocess ".shellescape(expand('%')) . " >/dev/null"
elseif match(extension,'mll') >= 0
if !executable("ocamllex")
return []
endif
let makeprg = "ocamllex -q -o /dev/null ".shellescape(expand('%'))
else
let makeprg = "camlp4o -o /dev/null ".shellescape(expand('%'))
endif
endif
let errorformat = '%AFile "%f"\, line %l\, characters %c-%*\d:,'. let errorformat = '%AFile "%f"\, line %l\, characters %c-%*\d:,'.
\ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'. \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'.
\ '%AFile "%f"\, line %l\, character %c:,'. \ '%AFile "%f"\, line %l\, character %c:,'.
@ -87,3 +90,51 @@ function! SyntaxCheckers_ocaml_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
function s:GetMakeprg()
if g:syntastic_ocaml_use_ocamlc
return s:GetOcamlcMakeprg()
endif
if g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')
return s:GetOcamlBuildMakeprg()
endif
return s:GetOtherMakeprg()
endfunction
function s:GetOcamlcMakeprg()
if g:syntastic_ocaml_use_janestreet_core
let build_cmd = "ocamlc -I "
let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir)
let build_cmd .= " -c ".expand('%')
return build_cmd
else
return "ocamlc -c ". expand('%')
endif
endfunction
function s:GetOcamlBuildMakeprg()
return "ocamlbuild -quiet -no-log -tag annot,". s:ocamlpp. " -no-links -no-hygiene -no-sanitize ".
\ shellescape(expand('%:r')).".cmi"
endfunction
function s:GetOtherMakeprg()
"TODO: give this function a better name?
"
"TODO: should use throw/catch instead of returning an empty makeprg
let extension = expand('%:e')
let makeprg = ""
if match(extension, 'mly') >= 0 && executable("menhir")
" ocamlyacc output can't be redirected, so use menhir
let makeprg = "menhir --only-preprocess ".shellescape(expand('%')) . " >/dev/null"
elseif match(extension,'mll') >= 0 && executable("ocamllex")
let makeprg = "ocamllex -q -o /dev/null ".shellescape(expand('%'))
else
let makeprg = "camlp4o -o /dev/null ".shellescape(expand('%'))
endif
return makeprg
endfunction

View File

@ -1,7 +1,8 @@
"============================================================================ "============================================================================
"File: perl.vim "File: perl.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com> "Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>,
" Eric Harmon <http://eharmon.net>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
@ -9,21 +10,48 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_perl_syntax_checker") "
finish " In order to add some custom lib directories that should be added to the
endif " perl command line you can add those to the global variable
let loaded_perl_syntax_checker = 1 " g:syntastic_perl_lib_path.
"
" let g:syntastic_perl_lib_path = './lib'
"
" To use your own perl error output munger script, use the
" g:syntastic_perl_efm_program option. Any command line parameters should be
" included in the variable declaration. The program should expect a single
" parameter; the fully qualified filename of the file to be checked.
"
" let g:syntastic_perl_efm_program = "foo.pl -o -m -g"
"
"bail if the user doesnt have perl installed "bail if the user doesnt have perl installed
if !executable("perl") if !executable("perl")
finish finish
endif endif
let s:checker = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c' if !exists("g:syntastic_perl_efm_program")
let g:syntastic_perl_efm_program = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c -w'
endif
function! SyntaxCheckers_perl_GetLocList() function! SyntaxCheckers_perl_GetLocList()
let makeprg = s:checker . ' ' . shellescape(expand('%')) if exists("g:syntastic_perl_lib_path")
let errorformat = '%f:%l:%m' let makeprg = g:syntastic_perl_efm_program . ' -I' . g:syntastic_perl_lib_path . ' ' . shellescape(expand('%'))
else
let makeprg = g:syntastic_perl_efm_program . ' ' . shellescape(expand('%'))
endif
let makeprg .= s:ExtraMakeprgArgs()
let errorformat = '%t:%f:%l:%m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
function! s:ExtraMakeprgArgs()
let shebang = syntastic#util#ParseShebang()
if index(shebang['args'], '-T') != -1
return ' -Tc'
endif
return ''
endfunction

View File

@ -9,10 +9,18 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_php_syntax_checker") "
finish "This syntax checker is composed of three checkers:
endif " - php -l
let loaded_php_syntax_checker = 1 " - phpcs (see http://pear.php.net/package/PHP_CodeSniffer)
" - phpmd (see http://phpmd.org)
"
"If any of these checkers are installed then they will be used. Phpcs and
"Phpmd are 'style checkers' and will only be called if `php -l` doesnt find
"any syntax errors.
"
"There are options below to config and disable phpcs and phpmd.
"bail if the user doesnt have php installed "bail if the user doesnt have php installed
if !executable("php") if !executable("php")
@ -24,10 +32,21 @@ if !exists("g:syntastic_phpcs_conf")
let g:syntastic_phpcs_conf = "" let g:syntastic_phpcs_conf = ""
endif endif
if !exists("g:syntastic_phpcs_disable") if !exists("g:syntastic_phpcs_disable") || !executable('phpcs')
let g:syntastic_phpcs_disable = 0 let g:syntastic_phpcs_disable = 0
endif endif
if !exists("g:syntastic_phpmd_disable") || !executable('phpmd')
let g:syntastic_phpmd_disable = 0
endif
"Support passing selected rules to phpmd
if !exists("g:syntastic_phpmd_rules")
let g:syntastic_phpmd_rules = "codesize,design,unusedcode,naming"
endif
function! SyntaxCheckers_php_GetHighlightRegex(item) function! SyntaxCheckers_php_GetHighlightRegex(item)
let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'") let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'")
if len(unexpected) < 1 if len(unexpected) < 1
@ -37,17 +56,20 @@ function! SyntaxCheckers_php_GetHighlightRegex(item)
endfunction endfunction
function! SyntaxCheckers_php_GetLocList() function! SyntaxCheckers_php_GetLocList()
let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 ".shellescape(expand('%'))
let errors = [] let errorformat='%-GNo syntax errors detected in%.%#,Parse error: %#syntax %trror\ , %m in %f on line %l,Parse %trror: %m in %f on line %l,Fatal %trror: %m in %f on line %l,%-G\s%#,%-GErrors parsing %.%#'
let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l,PHP Parse %trror: %m in %f on line %l'
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
if empty(errors) && !g:syntastic_phpcs_disable && executable("phpcs") if empty(errors)
if !g:syntastic_phpcs_disable
let errors = errors + s:GetPHPCSErrors() let errors = errors + s:GetPHPCSErrors()
endif endif
if !g:syntastic_phpmd_disable
let errors = errors + s:GetPHPMDErrors()
endif
end
return errors return errors
endfunction endfunction
@ -56,3 +78,10 @@ function! s:GetPHPCSErrors()
let errorformat = '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]' let errorformat = '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' })
endfunction endfunction
"Helper function. This one runs and parses phpmd tool output.
function! s:GetPHPMDErrors()
let makeprg = "phpmd " . shellescape(expand('%')) . " text " . g:syntastic_phpmd_rules
let errorformat = '%E%f:%l%m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype' : 'Style' })
endfunction

View File

@ -9,16 +9,16 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_puppet_syntax_checker")
finish
endif
let loaded_puppet_syntax_checker = 1
"bail if the user doesnt have puppet installed "bail if the user doesnt have puppet installed
if !executable("puppet") if !executable("puppet")
finish finish
endif endif
if !exists("g:syntastic_puppet_validate_disable")
let g:syntastic_puppet_validate_disable = 0
endif
if !exists("g:syntastic_puppet_lint_disable") if !exists("g:syntastic_puppet_lint_disable")
let g:syntastic_puppet_lint_disable = 0 let g:syntastic_puppet_lint_disable = 0
endif endif
@ -27,60 +27,75 @@ if !executable("puppet-lint")
let g:syntastic_puppet_lint_disable = 1 let g:syntastic_puppet_lint_disable = 1
endif endif
function! s:PuppetExtractVersion() function! s:PuppetVersion()
let output = system("puppet --version") if !exists("s:puppet_version")
let output = system("puppet --version 2>/dev/null")
let output = substitute(output, '\n$', '', '') let output = substitute(output, '\n$', '', '')
return split(output, '\.') let s:puppet_version = split(output, '\.')
endif
return s:puppet_version
endfunction endfunction
function! s:PuppetLintExtractVersion() function! s:PuppetLintVersion()
let output = system("puppet-lint --version") if !exists("s:puppet_lint_version")
let output = system("puppet-lint --version 2>/dev/null")
let output = substitute(output, '\n$', '', '') let output = substitute(output, '\n$', '', '')
let output = substitute(output, '^puppet-lint ', '', 'i') let output = substitute(output, '^puppet-lint ', '', 'i')
return split(output, '\.') let s:puppet_lint_version = split(output, '\.')
endif
return s:puppet_lint_version
endfunction endfunction
let s:puppetVersion = s:PuppetExtractVersion() if !g:syntastic_puppet_lint_disable
let s:lintVersion = s:PuppetLintExtractVersion() if !SyntasticIsVersionAtLeast(s:PuppetLintVersion(), [0,1,10])
if !(s:lintVersion[0] >= '0' && s:lintVersion[1] >= '1' && s:lintVersion[2] >= '10')
let g:syntastic_puppet_lint_disable = 1 let g:syntastic_puppet_lint_disable = 1
endif endif
end
function! s:getPuppetLintErrors() function! s:getPuppetLintErrors()
let makeprg = 'puppet-lint --log-format "\%{KIND} [\%{check}] \%{message} at \%{fullpath}:\%{linenumber}" '.shellescape(expand('%')) if !exists("g:syntastic_puppet_lint_arguments")
let g:syntastic_puppet_lint_arguments = ''
endif
let makeprg = 'puppet-lint --log-format "\%{KIND} [\%{check}] \%{message} at \%{fullpath}:\%{linenumber}" '.g:syntastic_puppet_lint_arguments.shellescape(expand('%'))
let errorformat = '%t%*[a-zA-Z] %m at %f:%l' let errorformat = '%t%*[a-zA-Z] %m at %f:%l'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' })
endfunction endfunction
function! s:getPuppetMakeprg() function! s:getPuppetMakeprg()
"If puppet is >= version 2.7 then use the new executable "If puppet is >= version 2.7 then use the new executable
if s:puppetVersion[0] >= '2' && s:puppetVersion[1] >= '7' if SyntasticIsVersionAtLeast(s:PuppetVersion(), [2,7,0])
let makeprg = 'puppet parser validate ' . let makeprg = 'puppet parser validate ' .
\ shellescape(expand('%')) . \ shellescape(expand('%')) .
\ ' --color=false' \ ' --color=false'
"add --ignoreimport for versions < 2.7.10
if s:puppetVersion[2] < '10'
let makeprg .= ' --ignoreimport'
endif
else else
let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%')) let makeprg = 'puppet --color=false --parseonly '.shellescape(expand('%'))
endif endif
return makeprg return makeprg
endfunction endfunction
function! SyntaxCheckers_puppet_GetLocList() function! s:getPuppetEfm()
let makeprg = s:getPuppetMakeprg()
"some versions of puppet (e.g. 2.7.10) output the message below if there "some versions of puppet (e.g. 2.7.10) output the message below if there
"are any syntax errors "are any syntax errors
let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,' let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l' let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) "Puppet 3.0.0 changes this from "err:" to "Error:"
"reset errorformat in that case
if SyntasticIsVersionAtLeast(s:PuppetVersion(), [3,0,0])
let errorformat = '%-GError: Try ''puppet help parser validate'' for usage,'
let errorformat .= 'Error: Could not parse for environment %*[a-z]: %m at %f:%l'
endif
return errorformat
endfunction
function! SyntaxCheckers_puppet_GetLocList()
let errors = []
if !g:syntastic_puppet_validate_disable
let errors = errors + SyntasticMake({ 'makeprg': s:getPuppetMakeprg(), 'errorformat': s:getPuppetEfm() })
endif
if !g:syntastic_puppet_lint_disable if !g:syntastic_puppet_lint_disable
let errors = errors + s:getPuppetLintErrors() let errors = errors + s:getPuppetLintErrors()

View File

@ -14,14 +14,8 @@
" in your .vimrc. Default is flake8. " in your .vimrc. Default is flake8.
"============================================================================ "============================================================================
if exists("loaded_python_syntax_checker")
finish
endif
let loaded_python_syntax_checker = 1
if !exists('g:syntastic_python_checker_args') if !exists('g:syntastic_python_checker_args')
let g:syntastic_python_checker_args = '' let g:syntastic_python_checker_args = ''
endif endif
let s:supported_checkers = ["flake8", "pyflakes", "pylint"] call SyntasticLoadChecker('python')
call SyntasticLoadChecker(s:supported_checkers, 'python')

View File

@ -23,6 +23,6 @@ endfunction
function! SyntaxCheckers_python_GetLocList() function! SyntaxCheckers_python_GetLocList()
let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%')) let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#' let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction

View File

@ -7,8 +7,8 @@
function! SyntaxCheckers_python_GetLocList() function! SyntaxCheckers_python_GetLocList()
let makeprg = 'pylint '.g:syntastic_python_checker_args.' -f parseable -r n -i y ' . let makeprg = 'pylint '.g:syntastic_python_checker_args.' -f parseable -r n -i y ' .
\ shellescape(expand('%')) . \ shellescape(expand('%')) .
\ ' 2>&1 \| sed ''s_: \[[RC]_: \[W_''' . \ ' 2>&1 \| sed ''s_: \[\([RCW]\)_: \[W] \[\1_''' .
\ ' \| sed ''s_: \[[F]_:\ \[E_''' \ ' \| sed ''s_: \[\([FE]\)_:\ \[E] \[\1_'''
let errorformat = '%f:%l: [%t%n%.%#] %m,%f:%l: [%t%.%#] %m,%Z,%-GNo config%m' let errorformat = '%f:%l: [%t] %m,%Z,%-GNo config %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction

View File

@ -0,0 +1,27 @@
"============================================================================
"File: python.vim
"Description: Syntax checking plugin for syntastic.vim
"Author: Artem Nezvigin <artem at artnez dot com>
"
" `errorformat` derived from:
" http://www.vim.org/scripts/download_script.php?src_id=1392
"
"============================================================================
function! SyntaxCheckers_python_GetLocList()
let l:path = shellescape(expand('%'))
let l:cmd = "compile(open(" . l:path . ").read(), " . l:path . ", 'exec')"
let l:makeprg = 'python -c "' . l:cmd . '"'
let l:errorformat =
\ "\%A\ \ File\ \"%f\"\\\,\ line\ %l\\\,%m," .
\ "\%C\ \ \ \ %.%#," .
\ "\%+Z%.%#Error\:\ %.%#," .
\ "\%A\ \ File\ \"%f\"\\\,\ line\ %l," .
\ "\%+C\ \ %.%#," .
\ "\%-C%p^," .
\ "\%Z%m," .
\ "\%-G%.%#"
return SyntasticMake({ 'makeprg': l:makeprg, 'errorformat': l:errorformat })
endfunction

View File

@ -13,11 +13,6 @@
" We use rst2pseudoxml.py, as it is ever so marginally faster than the other " We use rst2pseudoxml.py, as it is ever so marginally faster than the other
" rst2${x} tools in docutils. " rst2${x} tools in docutils.
if exists("loaded_rst_syntax_checker")
finish
endif
let loaded_rst_syntax_checker = 1
"bail if the user doesn't have rst2pseudoxml.py installed "bail if the user doesn't have rst2pseudoxml.py installed
if !executable("rst2pseudoxml.py") if !executable("rst2pseudoxml.py")
finish finish
@ -25,7 +20,7 @@ endif
function! SyntaxCheckers_rst_GetLocList() function! SyntaxCheckers_rst_GetLocList()
let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' . let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' .
\ shellescape(expand('%')) . ' /dev/null' \ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
let errorformat = '%f:%l:\ (%tNFO/1)\ %m, let errorformat = '%f:%l:\ (%tNFO/1)\ %m,
\%f:%l:\ (%tARNING/2)\ %m, \%f:%l:\ (%tARNING/2)\ %m,

View File

@ -13,15 +13,6 @@
"Use the g:syntastic_ruby_checker option to specify which checker to load - "Use the g:syntastic_ruby_checker option to specify which checker to load -
"set it to "jruby" to load the jruby checker. "set it to "jruby" to load the jruby checker.
"============================================================================ "============================================================================
if exists("loaded_ruby_syntax_checker")
finish
endif
let loaded_ruby_syntax_checker = 1
"bail if the user doesnt have ruby installed
if !executable("ruby")
finish
endif
if !exists("g:syntastic_ruby_checker") if !exists("g:syntastic_ruby_checker")
let g:syntastic_ruby_checker = "mri" let g:syntastic_ruby_checker = "mri"

View File

@ -10,7 +10,12 @@
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_GetLocList()
"let makeprg = '' if has('win32')
"let errorformat = '' let makeprg = 'jruby -W1 -T1 -c '.shellescape(expand('%'))
"return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) else
let makeprg = 'RUBYOPT= jruby -W1 -c '.shellescape(expand('%'))
endif
let errorformat = '%-GSyntax OK for %f,%ESyntaxError in %f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction

View File

@ -9,14 +9,44 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_ruby_GetLocList() function! s:FindRubyExec()
" we cannot set RUBYOPT on windows like that if executable("rvm")
if has('win32') return system("rvm tools identifier")
let makeprg = 'ruby -W1 -T1 -c '.shellescape(expand('%'))
else
let makeprg = 'RUBYOPT= ruby -W1 -c '.shellescape(expand('%'))
endif endif
let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#'
return "ruby"
endfunction
if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = s:FindRubyExec()
endif
"bail if the user doesnt have ruby installed where they said it is
if !executable(expand(g:syntastic_ruby_exec))
finish
endif
function! SyntaxCheckers_ruby_GetLocList()
let makeprg = expand(g:syntastic_ruby_exec).' -w -T1 -c '.shellescape(expand('%'))
if !has('win32')
let makeprg = 'RUBYOPT= ' . makeprg
endif
"this is a hack to filter out a repeated useless warning in rspec files
"containing lines like
"
" foo.should == 'bar'
"
"Which always generate the warning below. Note that ruby >= 1.9.3 includes
"the word "possibly" in the warning
let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context'
" filter out lines starting with ...
" long lines are truncated and wrapped in ... %p then returns the wrong
" column offset
let errorformat .= ',%-G%\%.%\%.%\%.%.%#'
let errorformat .= ',%-GSyntax OK,%E%f:%l: syntax error\, %m'
let errorformat .= ',%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_rust_syntax_checker")
finish
endif
let loaded_rust_syntax_checker = 1
"bail if the user doesnt have rustc installed "bail if the user doesnt have rustc installed
if !executable("rustc") if !executable("rustc")

View File

@ -9,16 +9,21 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_sass_syntax_checker")
finish
endif
let loaded_sass_syntax_checker = 1
"bail if the user doesnt have the sass binary installed "bail if the user doesnt have the sass binary installed
if !executable("sass") if !executable("sass")
finish finish
endif endif
"sass caching for large files drastically speeds up the checking, but store it
"in a temp location otherwise sass puts .sass_cache dirs in the users project
let s:sass_cache_location = tempname()
"By default do not check partials as unknown variables are a syntax error
if !exists("g:syntastic_sass_check_partials")
let g:syntastic_sass_check_partials = 0
endif
"use compass imports if available "use compass imports if available
let s:imports = "" let s:imports = ""
if executable("compass") if executable("compass")
@ -26,7 +31,10 @@ if executable("compass")
endif endif
function! SyntaxCheckers_sass_GetLocList() function! SyntaxCheckers_sass_GetLocList()
let makeprg='sass '.s:imports.' --check '.shellescape(expand('%')) if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_'
return []
end
let makeprg='sass --cache-location '.s:sass_cache_location.' '.s:imports.' --check '.shellescape(expand('%'))
let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#' let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#'
let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m' let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_scala_syntax_checker")
finish
endif
let loaded_scala_syntax_checker = 1
"bail if the user doesnt have the scala binary installed "bail if the user doesnt have the scala binary installed
if !executable("scala") if !executable("scala")

View File

@ -10,10 +10,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_scss_syntax_checker")
finish
endif
let loaded_scss_syntax_checker = 1
"bail if the user doesnt have the sass binary installed "bail if the user doesnt have the sass binary installed
if !executable("sass") if !executable("sass")

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists('loaded_sh_syntax_checker')
finish
endif
let loaded_sh_syntax_checker = 1
function! s:GetShell() function! s:GetShell()
if !exists('b:shell') || b:shell == "" if !exists('b:shell') || b:shell == ""
@ -31,22 +27,29 @@ function! s:GetShell()
return b:shell return b:shell
endfunction endfunction
function! SyntaxCheckers_sh_GetLocList() function! s:ForwardToZshChecker()
if len(s:GetShell()) == 0 || !executable(s:GetShell()) if SyntasticCheckable('zsh')
return SyntaxCheckers_zsh_GetLocList()
else
return [] return []
endif endif
let output = split(system(s:GetShell().' -n '.shellescape(expand('%'))), '\n')
if v:shell_error != 0 endfunction
let result = []
for err_line in output function! s:IsShellValid()
let line = substitute(err_line, '^[^:]*:\D\{-}\(\d\+\):.*', '\1', '') return len(s:GetShell()) > 0 && executable(s:GetShell())
let msg = substitute(err_line, '^[^:]*:\D\{-}\d\+: \(.*\)', '\1', '') endfunction
call add(result, {'lnum' : line,
\ 'text' : msg, function! SyntaxCheckers_sh_GetLocList()
\ 'bufnr': bufnr(''), if s:GetShell() == 'zsh'
\ 'type': 'E' }) return s:ForwardToZshChecker()
endfor endif
return result
endif if !s:IsShellValid()
return [] return []
endif
let makeprg = s:GetShell() . ' -n ' . shellescape(expand('%'))
let errorformat = '%f: line %l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction

36
syntax_checkers/slim.vim Normal file
View File

@ -0,0 +1,36 @@
"============================================================================
"File: slim.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"bail if the user doesnt have the slim binary installed
if !executable("slimrb")
finish
endif
function! s:SlimrbVersion()
if !exists('s:slimrb_version')
let output = system("slimrb --version 2>/dev/null")
let output = substitute(output, '\n$', '', '')
let output = substitute(output, '^slim ', '', 'i')
let s:slimrb_version = split(output, '\.')
end
return s:slimrb_version
endfunction
function! SyntaxCheckers_slim_GetLocList()
let makeprg = "slimrb -c " . shellescape(expand("%"))
if SyntasticIsVersionAtLeast(s:SlimrbVersion(), [1,3,1])
let errorformat = '%C\ %#%f\, Line %l\, Column %c,%-G\ %.%#,%ESlim::Parser::SyntaxError: %m,%+C%.%#'
else
let errorformat = '%C\ %#%f\, Line %l,%-G\ %.%#,%ESlim::Parser::SyntaxError: %m,%+C%.%#'
endif
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -10,11 +10,6 @@
" "
"============================================================================ "============================================================================
if exists("loaded_tcl_syntax_checker")
finish
endif
let loaded_tcl_syntax_checker = 1
"bail if the user doesnt have tclsh installed "bail if the user doesnt have tclsh installed
if !executable("tclsh") if !executable("tclsh")
finish finish

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_tex_syntax_checker")
finish
endif
let loaded_tex_syntax_checker = 1
"bail if the user doesnt have lacheck installed "bail if the user doesnt have lacheck installed
if !executable("lacheck") if !executable("lacheck")

View File

@ -0,0 +1,16 @@
"============================================================================
"File: typescript.vim
"Description: TypeScript syntax checker. For TypeScript v0.8.0
"Maintainer: Bill Casarin <bill@casarin.ca>
"============================================================================
"bail if the user doesnt have tsc installed
if !executable("tsc")
finish
endif
function! SyntaxCheckers_typescript_GetLocList()
let makeprg = 'tsc ' . shellescape(expand("%")) . ' --out ' . syntastic#util#DevNull()
let errorformat = '%f %#(%l\,%c): %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -22,11 +22,6 @@
" "
"============================================================================ "============================================================================
if exists('loaded_vala_syntax_checker')
finish
endif
let loaded_vala_syntax_checker = 1
if !executable('valac') if !executable('valac')
finish finish
endif endif

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_xhtml_syntax_checker")
finish
endif
let loaded_xhtml_syntax_checker = 1
"bail if the user doesnt have tidy or grep installed "bail if the user doesnt have tidy or grep installed
if !executable("tidy") if !executable("tidy")

View File

@ -14,11 +14,6 @@
" and allow you to validate XML data without network access, see xmlcatalog(1) " and allow you to validate XML data without network access, see xmlcatalog(1)
" and http://www.xmlsoft.org/catalog.html for more information. " and http://www.xmlsoft.org/catalog.html for more information.
if exists("loaded_xml_syntax_checker")
finish
endif
let loaded_xml_syntax_checker = 1
"bail if the user doesnt have tidy or grep installed "bail if the user doesnt have tidy or grep installed
if !executable("xmllint") if !executable("xmllint")
finish finish

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_xslt_syntax_checker")
finish
endif
let loaded_xslt_syntax_checker = 1
"bail if the user doesnt have tidy or grep installed "bail if the user doesnt have tidy or grep installed
if !executable("xmllint") if !executable("xmllint")

View File

@ -9,13 +9,9 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
" "
"Installation: $ npm install -g js-yaml.bin "Installation: $ npm install -g js-yaml
" "
"============================================================================ "============================================================================
if exists("loaded_yaml_syntax_checker")
finish
endif
let loaded_yaml_syntax_checker = 1
if !executable("js-yaml") if !executable("js-yaml")
finish finish

View File

@ -9,10 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_z80_syntax_checker")
finish
endif
let loaded_z80_syntax_checker = 1
"bail if the user doesnt have z80_syntax_checker.py installed "bail if the user doesnt have z80_syntax_checker.py installed
"To obtain this application there are two solutions: "To obtain this application there are two solutions:

View File

@ -19,11 +19,6 @@
" Then install the zptlint program, found on pypi: " Then install the zptlint program, found on pypi:
" http://pypi.python.org/pypi/zptlint " http://pypi.python.org/pypi/zptlint
if exists("loaded_zpt_syntax_checker")
finish
endif
let loaded_zpt_syntax_checker = 1
" Bail if the user doesn't have zptlint installed " Bail if the user doesn't have zptlint installed
if !executable("zptlint") if !executable("zptlint")
finish finish

View File

@ -1,7 +1,7 @@
"============================================================================ "============================================================================
"File: 6g.vim "File: zsh.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
"Maintainer: Sam Nguyen <samxnguyen@gmail.com> "Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
@ -9,9 +9,14 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_go_GetLocList()
let makeprg = '6g -o /dev/null %'
let errorformat = '%E%f:%l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) "bail if the user doesnt have zsh installed
if !executable("zsh")
finish
endif
function! SyntaxCheckers_zsh_GetLocList()
let makeprg = 'zsh -n ' . shellescape(expand('%'))
let errorformat = '%f:%l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction