Squashed 'vim/bundle/syntastic/' changes from 56e19eb81..89bc82a26

89bc82a26 Manual: add a note about debugging.
b2ad71cd1 Manual: add a clarification about statusline.
d8af5028e Bug fix: Cygwin sets has("unix").
de0106e83 JSCS checker: add "--max-errors -1" option.
cc440f1b4 Checker yamllint: cleanup.
8c4dadc7e New checker for YAML: yamllint (@adrienverge).
972b87ca0 Safer syntastic#util#unique().
d1a179d75 Vim 7.4.1128 can delete directories recursively.
1f4846fec Stylelint checker can also check SCSS files.
2db6f539d Checker scss_lint: use the JSON reporter of scss-lint.
b10c59b21 Manual: clarification about quiet_messages.
c57ba0da9 Asciidoc checker: fix errorformat to allow use as asciidoctor.
e39f636e2 Flow checker: go back to "flow check".
17a4c0123 Checker ghc_mod is on its way out.
189be0ae7 Workaround for a misfeature in Vim 7.4.1013 and later.
3280220e6 JSCS checker bug fix: minor fallouts from 751afea.
91814d672 Manual: bit rot: vim-go now uses loclists.
751afea9e JSCS checker: use JSON reporter.
dbd761006 Minor feature: auto_loc_list == 3.
281b29487 Avoid checking the preview window.
6074c3d39 Stylelint checker: update parser.
48736aa37 Mixedindentlint is a style checker.
ac4541e0e Minor cleanup.
ce8dd364f Add `returns` list to `SyntasticMake`
6be9b4c71 Add mixedindentlint checker redirect for css
a0382253c Add mixedindentlint checker redirect for scss
7d27a3982 Add mixedindentlint checker for JavaScript
60f979393 R linters: minor cleanup.
06a846955 Checker tsc: add guards option.
e60555de7 Registry: cleaner handling of checker redirections.
4725c8616 Lintr checker: cleanup.
bf60b72f3 Attempt support for Rmd files
4078f0db8 Updates for newest syntastic best practices
f92adf3c9 Enable R linting using lintr
2d0bb98cf Allow ESLint to check typescript files.
77e20e22d Bug fix: decouple skip_checks from check_on_wq.
70c723ac1 Back off 6379bd1, this is not safe.
6379bd198 /dev/null should work under win32unix.
dc516ef19 Checker asm/gcc: allow generic overrides.
6d2e406f9 Slim_lint checker: cleanup.
46c692b51 Add slim-lint checker
200cd1d07 Merge remote-tracking branch 'origin/pr/1609'
3f9fde2c1 fix miss test classpath
4f1e3adf3 correct pymode lint variable name in documentation
73dd78548 Dockerfile_lint checker: cleanup.
13456d5a7 Add dockerfile-lint checker
10788ac8d Javac checker: cleanup.
094c3631c fix maven project which has set srcdir or testsrc dir
3593d1697 fix maven project which has set srcdir or testsrc dir
cd40fe975 Ansible-lint checker: make "-p" option mandatory.
13c8e7530 Ansible-lint checker: add version check.
7d627000c Checkers clang_check and clang_tidy: workaround for a regression in Clang.
721a42d5b Ansible-lint checker: cleanup.
f8e638d28 Add ansible-lint syntax checkers
85cde9235 Core: disable autocommand nesting by default.
d79d77fbd Core: allow syntastic commands to be followed by other Vim commands.
ae7e00aad Revert "Javac checker: minor optimisation."
cfdcdfaa9 Javac checker: minor optimisation.
03c058ea5 Typo.
dec5bc73b New checker vcom for VHDL (@jevogel).
9f599a161 Standard checker: allow generic standard frontends.
943923433 Typo.
646124823 Back off a4c3fcc for slimrb.
630169bfc Stylelint checker: typo.
c596b6474 Stylelint checker: cleanup.
1d5a057a0 Add CSS Stylelint checker
a4c3fcc4a Partial workaround for a misfeature of errorformat.
1926693d1 Coqtop checker: fix potentially harmful errorformat.
11ca31582 Iverilog checker: formatting.
d51d5ea51 Merge remote-tracking branch 'origin/pr/1579'
448b6cc61 add MIT license to iverilog.vim
e484ac941 BaseX: allow filenames to contain special characters.
2553f6389 BaseX checker: minor cleanup.
50653f0bc BaseX checker: cleanup.
89ad03b2e conform iverilog to makeprgBuild()
5bf9fa749 Add support for Icarus Verilog compiler
3c524a661 Added support for XQuery using BaseX.exe
f6eaf7e8b README: add links to ghcmod-vim and vim-go.
544acba17 ghc-mod versions 5.4.0 and later are no longer supported.
f57cc9e84 Bump version number.
1b6c70ddc Merge remote-tracking branch 'origin/pr/1573'
160446799 [drafter] Update known status code
72b704e6f Bump version.
d36bc7807 Bump version for release.
7e26d3589 Merge remote-tracking branch 'origin/pr/1567'
ba62f2e68 API Blueprint should use drafter
e1217a888 Manual: cross reference skip_checks from the filtering section.
b3ebf94ac Manual: fix typo.
50d031583 Vimlint checker: add logging.
d3130d6b5 Minor cleanup.
b8aef009b Bug fix: length of composite characters in stl_format.
66f4e9693 Eslint checker: log if called as a generic frontend.
c34ea8955 Eslint checker: allow generic eslint frontends.
e0a3cf753 Add width controls to the new stl_format flags.
d73d7601c New flags for stl_format: %ne, %nw, %N, %pe, %pw, %P.
03c8a7b55 README: add a link to the Merlin project.
1885e867b Checkstyle checker: make checkstyle_classpath an actual classpath.
debcecd5c Checker gometalinter: minor cleanup.
f2084e9e4 Checker gometalinter: fix arguments.
9371aafa8 Minor cleanup: regex optimisation.
8bb535bd2 Checker gometalinter: cleanup.
3db525cac include test files by default. add error type.
aca4d8ea4 add support for setting arguments on gometalinter
f1f7deed3 use package instead of file
61b7dbf9c add gometalinter syntax checker
8164240f6 Hlint: handle hint file parsing errors.
1e7589fe5 Back off "Reset notifiers if skip_checks is set."
6a4262251 Reset notifiers if skip_checks is set.
be111259e js-yaml checker: update errorformat.
1be907716 Javac checker: make checker-specific commands available at startup.
3fb986584 Go checker: option "-buildmode=archive" is new in go 1.5.
703287c76 Checker jade_lint: cleanup.
b5883c80f Add jade-lint
0fe603595 Bug fix: minor shell escape issue.
d077102eb Gotype checker: parse test files (@jonasi).
3c2e7e4ce Go checker: attempt to speed up builds (@gsalgado).
13727dd46 Set the GOGC env var to off to speed up go builds
47c70b3e1 Minor language and grammar fixes.
7014a52ac Manual: update the note about zsh.
1ae5589f9 Javac checker: attempt at fixing errorformat.
3fb8281a6 Bug fix: missing a couple of executable() checks.
748725c77 Tslint checker: version 2.4.0 and later no longer support "-f".
bfc55793e ESLint checker: line numbers are now 1-based.
a01107ffa Bug fix: safer handling of automatic includes.
9d69f4c16 Qmllint checker: cleanup.
6ff7c8934 New checker for qml: qmllint
edde4c5ed New checker for stylus: stylint.
74586ff12 Manual: consistency fixes.
07f2745eb Manual: rephrase description of check_on_wq.
d26c7f78c Bug fix: passive mode UI problem; autocmd cleanup.
a6012f2b4 Move floating point functions to autoload.
bcb4ca6e7 Safety net for enable_*_checker variables.
6929f24e4 Flog checker: cleanup.
5db87b9ec Add ruby flog checker
76ec53f18 Sqlint checker now returns 1 when it detects errors.
aded15691 Bug fix: leftover from JSON cleanup.
1dde81a68 There is no such thing as has('iconv/dyn').
d35396286 Sqlint checker: add highlighting function.
1e475a7df Sqlint checker: cleanup.
125ce327e Add checker for sqlint (https://github.com/purcell/sqlint)
ffcf625fc Minor cleanup.
c44cb15c4 Cleanup: JSON decoding.
eba7ae6d6 Debug: add indicator for modified shell-related options.
83829b766 Minor bug fix.
74fd7e6b9 Show chacker output when whining that we can't parse version string.
2e60dd4af Manual: add a note about Tim Pope's "flagship".
59513edd4 Manual: fix the notice about rvm.
a596ef38b Gfortran checker: fix errorformat for gfortran 5.
b1b79009e Manual: Fix filetype_map example.
4708cdd12 Add a mechanism for handling checkers disabled for security.
d75f3e5e8 Buffer-local security guards for perl/perl, elixirelixir, and r/svtools.
a08221e98 Merge pull request #1463 from lavrin/erlang-rebar-rel-paths
0154e9d09 Translate relative paths from non-root rebar.config files
8e672780e Show checker output along with "checker returned abnormal status".
31cba018b Safety net: avoid suffixesadd interfering with findfile().
176e32ca4 Cleanup.
c9fc0d41e Checker javac: _really_ fix shell escaping in custom_classpath_command.
dc15fa08c Checker javac: fix shell escaping in custom_classpath_command.
c39563d95 Checker javac: cleanup.
ec9da6732 Merge remote-tracking branch 'origin/pr/1456'
dbb28cd84 Ada checker: disable generation of intermediate files.
8269ba278 Basic path substitution for g:syntastic_java_javac_custom_classpath_command

git-subtree-dir: vim/bundle/syntastic
git-subtree-split: 89bc82a2640414be38a22de9ded1994359c56735
main
Buddy Sandidge 9 years ago
parent 347aeab113
commit 3c2c5a76a0

@ -40,8 +40,8 @@ too:
Before you consider adding features to syntastic, _please_ spend a few Before you consider adding features to syntastic, _please_ spend a few
minutes (re-)reading the latest version of the [manual][1]. Syntastic minutes (re-)reading the latest version of the [manual][1]. Syntastic
is changing rapidly at times, and it's quite possible that some of the is changing rapidly at times, and it's quite possible that some features
features you want to add exist already. you want to add exist already.
To submit a patch: To submit a patch:
@ -54,7 +54,7 @@ Small, focused patches are preferred.
Large changes to the code should be discussed with the core team first. Large changes to the code should be discussed with the core team first.
Create an issue and explain your plan and see what we say. Create an issue and explain your plan and see what we say.
Also make sure to update the manual whenever applicable. Nobody can use Also, make sure to update the manual whenever applicable. Nobody can use
features that aren't documented. features that aren't documented.
<a name="generalstyle"></a> <a name="generalstyle"></a>

@ -35,7 +35,7 @@
4.8. [How can I pass additional arguments to a checker?](#faqargs) 4.8. [How can I pass additional arguments to a checker?](#faqargs)
4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) 4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers)
4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle) 4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle)
4.11. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) 4.11. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate)
4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) 4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext)
4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) 4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete)
5. [Resources](#otherresources) 5. [Resources](#otherresources)
@ -53,22 +53,23 @@ are detected, the user is notified and is happy because they didn't have to
compile their code or execute their script to find them. compile their code or execute their script to find them.
At the time of this writing, syntastic has checking plugins for ActionScript, At the time of this writing, syntastic has checking plugins for ActionScript,
Ada, API Blueprint, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, ASM,
C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq,
DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, Erlang,
Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars,
Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, HSS, HTML, Jade, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM
Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C,
Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and
reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, Tcl, iOS property lists, Puppet, Python, QML, R, Racket, Relax NG, reStructuredText,
TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX,
Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery,
YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details
about the corresponding supported checkers. about the corresponding supported checkers.
A number of third-party Vim plugins also provide checkers for syntastic, A number of third-party Vim plugins also provide checkers for syntastic,
for example: [omnisharp-vim][25], [rust.vim][12], [syntastic-extras][26], for example: [merlin][30], [omnisharp-vim][25], [rust.vim][12],
[syntastic-more][27], [vim-crystal][29], [vim-eastwood][28], and [syntastic-extras][26], [syntastic-more][27], [vim-crystal][29],
[vim-swift][24]. [vim-eastwood][28], and [vim-swift][24].
Below is a screenshot showing the methods that Syntastic uses to display syntax Below is a screenshot showing the methods that Syntastic uses to display syntax
errors. Note that, in practise, you will only have a subset of these methods errors. Note that, in practise, you will only have a subset of these methods
@ -159,10 +160,10 @@ following:
## 3\. Recommended settings ## 3\. Recommended settings
Syntastic has a large number of options that can be configured, and the Syntastic has numerous options that can be configured, and the defaults
defaults are not particularly well suitable for new users. It is recommended are not particularly well suitable for new users. It is recommended
that you start by adding the following lines to your `vimrc` file, and return that you start by adding the following lines to your `vimrc` file, and
to them after reading the manual (see `:help syntastic` in Vim): return to them after reading the manual (see `:help syntastic` in Vim):
```vim ```vim
set statusline+=%#warningmsg# set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%{SyntasticStatuslineFlag()}
@ -380,7 +381,7 @@ See `:help syntastic_quiet_messages` for details.
<a name="faqaggregate"></a> <a name="faqaggregate"></a>
__4.11. Q. I have enabled multiple checkers for the current filetype. How can I __4.11. Q. I have enabled multiple checkers for the current filetype. How can I
display all of the errors from all of the checkers together?__ display all errors from all checkers together?__
A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`:
```vim ```vim
@ -427,7 +428,8 @@ There are also a dedicated [google group][5], and a
Syntastic aims to provide a common interface to syntax checkers for as many Syntastic aims to provide a common interface to syntax checkers for as many
languages as possible. For particular languages, there are, of course, other languages as possible. For particular languages, there are, of course, other
plugins that provide more functionality than syntastic. You might want to take plugins that provide more functionality than syntastic. You might want to take
a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. a look at [ghcmod-vim][31], [jedi-vim][7], [python-mode][8], [vim-go][32], or
[YouCompleteMe][9].
[0]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png [0]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png
[1]: https://github.com/tpope/vim-pathogen [1]: https://github.com/tpope/vim-pathogen
@ -459,6 +461,9 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
[27]: https://github.com/roktas/syntastic-more [27]: https://github.com/roktas/syntastic-more
[28]: https://github.com/venantius/vim-eastwood [28]: https://github.com/venantius/vim-eastwood
[29]: https://github.com/rhysd/vim-crystal [29]: https://github.com/rhysd/vim-crystal
[30]: https://github.com/the-lambda-church/merlin
[31]: https://github.com/eagletmt/ghcmod-vim
[32]: https://github.com/fatih/vim-go
<!-- <!--
vim:tw=79:sw=4: vim:tw=79:sw=4:

@ -21,7 +21,7 @@ function! syntastic#c#ReadConfig(file) abort " {{{2
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: looking for', a:file) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: looking for', a:file)
" search upwards from the current file's directory " search upwards from the current file's directory
let config = findfile(a:file, escape(expand('%:p:h', 1), ' ') . ';') let config = syntastic#util#findFileInParent(a:file, expand('%:p:h', 1))
if config ==# '' if config ==# ''
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: file not found') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: file not found')
return '' return ''
@ -223,10 +223,15 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2
" check if the user manually set some cflags " check if the user manually set some cflags
let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '') let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '')
if b_cflags ==# '' if b_cflags !=# ''
if a:ft ==# 'c' || a:ft ==# 'cpp' let flags .= ' ' . b_cflags
" check whether to search for include files at all endif
if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0)
" add optional config file parameters
let config_file = s:_get_checker_var('g', a:ft, a:ck, 'config_file', '.syntastic_' . a:ft . '_config')
let flags .= ' ' . syntastic#c#ReadConfig(config_file)
if b_cflags ==# '' && (a:ft ==# 'c' || a:ft ==# 'cpp') && !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0)
" refresh the include file search if desired " refresh the include file search if desired
if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0) if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0)
let flags .= ' ' . s:_search_headers() let flags .= ' ' . s:_search_headers()
@ -238,15 +243,6 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2
let flags .= ' ' . b:syntastic_{a:ft}_includes let flags .= ' ' . b:syntastic_{a:ft}_includes
endif endif
endif endif
endif
else
" user-defined cflags
let flags .= ' ' . b_cflags
endif
" add optional config file parameters
let config_file = s:_get_checker_var('g', a:ft, a:ck, 'config_file', '.syntastic_' . a:ft . '_config')
let flags .= ' ' . syntastic#c#ReadConfig(config_file)
return flags return flags
endfunction " }}}2 endfunction " }}}2

@ -90,7 +90,7 @@ function! syntastic#log#debugShowOptions(level, names) abort " {{{2
let vlist = copy(type(a:names) == type('') ? [a:names] : a:names) let vlist = copy(type(a:names) == type('') ? [a:names] : a:names)
if !empty(vlist) if !empty(vlist)
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))") call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val))) . (s:_is_modified(v:val) ? ' (!)' : '')")
echomsg leader . join(vlist, ', ') echomsg leader . join(vlist, ', ')
endif endif
call s:_logRedirect(0) call s:_logRedirect(0)
@ -123,6 +123,21 @@ function! syntastic#log#debugDump(level) abort " {{{2
call syntastic#log#debugShowVariables( a:level, sort(keys(g:_SYNTASTIC_DEFAULTS)) ) call syntastic#log#debugShowVariables( a:level, sort(keys(g:_SYNTASTIC_DEFAULTS)) )
endfunction " }}}2 endfunction " }}}2
function! syntastic#log#ndebug(level, title, messages) abort " {{{2
if s:_isDebugEnabled(a:level)
return
endif
call syntastic#log#error(a:title)
if type(a:messages) == type([])
for msg in a:messages
echomsg msg
endfor
else
echomsg a:messages
endif
endfunction " }}}2
" }}}1 " }}}1
" Private functions {{{1 " Private functions {{{1
@ -174,6 +189,20 @@ function! s:_format_variable(name) abort " {{{2
return join(vals, ', ') return join(vals, ', ')
endfunction " }}}2 endfunction " }}}2
function! s:_is_modified(name) abort " {{{2
if !exists('s:option_defaults')
let s:option_defaults = {}
endif
if !has_key(s:option_defaults, a:name)
let opt_save = eval('&' . a:name)
execute 'set ' . a:name . '&'
let s:option_defaults[a:name] = eval('&' . a:name)
execute 'let &' . a:name . ' = ' . string(opt_save)
endif
return s:option_defaults[a:name] !=# eval('&' . a:name)
endfunction " }}}2
" }}}1 " }}}1
let &cpo = s:save_cpo let &cpo = s:save_cpo

@ -59,27 +59,51 @@ function! syntastic#preprocess#cppcheck(errors) abort " {{{2
return map(copy(a:errors), 'substitute(v:val, ''\v^\[[^]]+\]\zs( -\> \[[^]]+\])+\ze:'', "", "")') return map(copy(a:errors), 'substitute(v:val, ''\v^\[[^]]+\]\zs( -\> \[[^]]+\])+\ze:'', "", "")')
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL102, 1, l:true) function! syntastic#preprocess#dockerfile_lint(errors) abort " {{{2
" @vimlint(EVL102, 1, l:false) let out = []
" @vimlint(EVL102, 1, l:null) let json = s:_decode_JSON(join(a:errors, ''))
function! syntastic#preprocess#flow(errors) abort " {{{2
" JSON artifacts if type(json) == type({})
let true = 1 try
let false = 0 let data = json['error']['data'] + json['warn']['data'] + json['info']['data']
let null = '' for e in data
let type = toupper(e['level'][0])
if type ==# 'I'
let type = 'W'
let style = 1
else
let style = 0
endif
let line = get(e, 'line', 1)
let message = e['message']
if has_key(e, 'description') && e['description'] !=# 'None'
let message = message . '. ' . e['description']
endif
let msg =
\ type . ':' .
\ style . ':' .
\ line . ':' .
\ message
call add(out, msg)
endfor
catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
let out = []
endtry
else
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
endif
return out
endfunction " }}}2
function! syntastic#preprocess#flow(errors) abort " {{{2
let idx = 0 let idx = 0
while idx < len(a:errors) && a:errors[idx][0] != '{' while idx < len(a:errors) && a:errors[idx][0] !=# '{'
let idx += 1 let idx += 1
endwhile endwhile
let errs = s:_decode_JSON(join(a:errors[idx :], ''))
" A hat tip to Marc Weber for this trick
" http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763
try
let errs = eval(join(a:errors[idx :], ''))
catch
let errs = {}
endtry
let out = [] let out = []
if type(errs) == type({}) && has_key(errs, 'errors') && type(errs['errors']) == type([]) if type(errs) == type({}) && has_key(errs, 'errors') && type(errs['errors']) == type([])
@ -108,33 +132,61 @@ function! syntastic#preprocess#flow(errors) abort " {{{2
call add(out, msg) call add(out, msg)
catch /\m^Vim\%((\a\+)\)\=:E716/ catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker javascript/flow: unknown error format') call syntastic#log#warn('checker javascript/flow: unrecognized error format')
let out = [] let out = []
break break
endtry endtry
else else
call syntastic#log#warn('checker javascript/flow: unknown error format') call syntastic#log#warn('checker javascript/flow: unrecognized error format')
let out = [] let out = []
break break
endif endif
endfor endfor
else else
call syntastic#log#warn('checker javascript/flow: unknown error format') call syntastic#log#warn('checker javascript/flow: unrecognized error format')
endif endif
return out return out
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL102, 0, l:true)
" @vimlint(EVL102, 0, l:false)
" @vimlint(EVL102, 0, l:null)
function! syntastic#preprocess#iconv(errors) abort " {{{2 function! syntastic#preprocess#iconv(errors) abort " {{{2
return return
\ (has('iconv') || has('iconv/dyn')) && &encoding !=# '' && &encoding !=# 'utf-8' ? \ has('iconv') && &encoding !=# '' && &encoding !=# 'utf-8' ?
\ map(a:errors, 'iconv(v:val, "utf-8", &encoding)') : \ map(a:errors, 'iconv(v:val, "utf-8", &encoding)') :
\ a:errors \ a:errors
endfunction " }}}2 endfunction " }}}2
function! syntastic#preprocess#jscs(errors) abort " {{{2
let errs = join(a:errors, '')
if errs ==# ''
return []
endif
let json = s:_decode_JSON(errs)
let out = []
if type(json) == type({})
for fname in keys(json)
if type(json[fname]) == type([])
for e in json[fname]
try
let e['message'] = substitute(e['message'], "\n", ' ', 'g')
cal add(out, fname . ':' . e['line'] . ':' . e['column'] . ':' . e['message'])
catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker javascript/jscs: unrecognized error item ' . string(e))
let out = []
endtry
endfor
else
call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
endif
endfor
else
call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
endif
return out
endfunction " }}}2
function! syntastic#preprocess#killEmpty(errors) abort " {{{2 function! syntastic#preprocess#killEmpty(errors) abort " {{{2
return filter(copy(a:errors), 'v:val !=# ""') return filter(copy(a:errors), 'v:val !=# ""')
endfunction " }}}2 endfunction " }}}2
@ -152,22 +204,8 @@ function! syntastic#preprocess#perl(errors) abort " {{{2
return syntastic#util#unique(out) return syntastic#util#unique(out)
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL102, 1, l:true)
" @vimlint(EVL102, 1, l:false)
" @vimlint(EVL102, 1, l:null)
function! syntastic#preprocess#prospector(errors) abort " {{{2 function! syntastic#preprocess#prospector(errors) abort " {{{2
" JSON artifacts let errs = s:_decode_JSON(join(a:errors, ''))
let true = 1
let false = 0
let null = ''
" A hat tip to Marc Weber for this trick
" http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763
try
let errs = eval(join(a:errors, ''))
catch
let errs = {}
endtry
let out = [] let out = []
if type(errs) == type({}) && has_key(errs, 'messages') if type(errs) == type({}) && has_key(errs, 'messages')
@ -189,26 +227,23 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2
call add(out, msg) call add(out, msg)
catch /\m^Vim\%((\a\+)\)\=:E716/ catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker python/prospector: unknown error format') call syntastic#log#warn('checker python/prospector: unrecognized error format')
let out = [] let out = []
break break
endtry endtry
else else
call syntastic#log#warn('checker python/prospector: unknown error format') call syntastic#log#warn('checker python/prospector: unrecognized error format')
let out = [] let out = []
break break
endif endif
endfor endfor
else else
call syntastic#log#warn('checker python/prospector: unknown error format') call syntastic#log#warn('checker python/prospector: unrecognized error format')
endif endif
endif endif
return out return out
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL102, 0, l:true)
" @vimlint(EVL102, 0, l:false)
" @vimlint(EVL102, 0, l:null)
function! syntastic#preprocess#rparse(errors) abort " {{{2 function! syntastic#preprocess#rparse(errors) abort " {{{2
let errlist = copy(a:errors) let errlist = copy(a:errors)
@ -249,6 +284,79 @@ function! syntastic#preprocess#rparse(errors) abort " {{{2
return out return out
endfunction " }}}2 endfunction " }}}2
function! syntastic#preprocess#scss_lint(errors) abort " {{{2
let errs = join(a:errors, '')
if errs ==# ''
return []
endif
let json = s:_decode_JSON(errs)
let out = []
if type(json) == type({})
for fname in keys(json)
if type(json[fname]) == type([])
for e in json[fname]
try
cal add(out, fname . ':' .
\ e['severity'][0] . ':' .
\ e['line'] . ':' .
\ e['column'] . ':' .
\ e['length'] . ':' .
\ ( has_key(e, 'linter') ? e['linter'] . ': ' : '' ) .
\ e['reason'])
catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker scss/scss_lint: unrecognized error item ' . string(e))
let out = []
endtry
endfor
else
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
endif
endfor
else
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
endif
return out
endfunction " }}}2
function! syntastic#preprocess#stylelint(errors) abort " {{{2
let out = []
" CssSyntaxError: /path/to/file.css:2:11: Missed semicolon
let parts = matchlist(a:errors[0], '\v^CssSyntaxError: (.{-1,}):(\d+):(\d+): (.+)')
if len(parts) > 4
call add(out, 'E:' . join(parts[1:4], ':'))
else
let errs = s:_decode_JSON(join(a:errors, ''))
let out = []
if type(errs) == type([]) && len(errs) == 1 && type(errs[0]) == type({}) &&
\ has_key(errs[0], 'source') && has_key(errs[0], 'warnings') && type(errs[0]['warnings']) == type([])
for e in errs[0]['warnings']
try
let severity = type(e['severity']) == type(0) ? ['W', 'E'][e['severity']-1] : e['severity'][0]
let msg =
\ severity . ':' .
\ errs[0]['source'] . ':' .
\ e['line'] . ':' .
\ e['column'] . ':' .
\ e['text']
call add(out, msg)
catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker css/stylelint: unrecognized error item ' . string(e))
let out = []
break
endtry
endfor
else
call syntastic#log#warn('checker css/stylelint: unrecognized error format')
endif
endif
return out
endfunction " }}}2
function! syntastic#preprocess#tslint(errors) abort " {{{2 function! syntastic#preprocess#tslint(errors) abort " {{{2
return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")') return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
endfunction " }}}2 endfunction " }}}2
@ -268,22 +376,8 @@ function! syntastic#preprocess#validator(errors) abort " {{{2
return out return out
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL102, 1, l:true)
" @vimlint(EVL102, 1, l:false)
" @vimlint(EVL102, 1, l:null)
function! syntastic#preprocess#vint(errors) abort " {{{2 function! syntastic#preprocess#vint(errors) abort " {{{2
" JSON artifacts let errs = s:_decode_JSON(join(a:errors, ''))
let true = 1
let false = 0
let null = ''
" A hat tip to Marc Weber for this trick
" http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763
try
let errs = eval(join(a:errors, ''))
catch
let errs = []
endtry
let out = [] let out = []
if type(errs) == type([]) if type(errs) == type([])
@ -300,22 +394,166 @@ function! syntastic#preprocess#vint(errors) abort " {{{2
call add(out, msg) call add(out, msg)
catch /\m^Vim\%((\a\+)\)\=:E716/ catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker vim/vint: unknown error format') call syntastic#log#warn('checker vim/vint: unrecognized error format')
let out = [] let out = []
break break
endtry endtry
else else
call syntastic#log#warn('checker vim/vint: unknown error format') call syntastic#log#warn('checker vim/vint: unrecognized error format')
let out = [] let out = []
break break
endif endif
endfor endfor
else else
call syntastic#log#warn('checker vim/vint: unknown error format') call syntastic#log#warn('checker vim/vint: unrecognized error format')
endif endif
return out return out
endfunction " }}}2 endfunction " }}}2
" }}}1
" Workarounds {{{1
" In errorformat, \ or % following %f make it depend on isfname. The default
" setting of isfname is crafted to work with completion, rather than general
" filename matching. The result for syntastic is that filenames containing
" spaces (or a few other special characters) can't be matched.
"
" Fixing isfname to address this problem would depend on the set of legal
" characters for filenames on the filesystem the project's files lives on.
" Inferring the kind of filesystem a file lives on, in advance to parsing the
" file's name, is an interesting problem (think f.i. a file loaded from a VFAT
" partition, mounted on Linux). A problem syntastic is not prepared to solve.
"
" As a result, the functions below exist for the only reason to avoid using
" things like %f\, in errorformat.
"
" References:
" https://groups.google.com/forum/#!topic/vim_dev/pTKmZmouhio
" https://vimhelp.appspot.com/quickfix.txt.html#error-file-format
function! syntastic#preprocess#basex(errors) abort " {{{2
let out = []
let idx = 0
while idx < len(a:errors)
let parts = matchlist(a:errors[idx], '\v^\[\S+\] Stopped at (.+), (\d+)/(\d+):')
if len(parts) > 3
let err = parts[1] . ':' . parts[2] . ':' . parts[3] . ':'
let parts = matchlist(a:errors[idx+1], '\v^\[(.)\D+(\d+)\] (.+)')
if len(parts) > 3
let err .= (parts[1] ==? 'W' || parts[1] ==? 'E' ? parts[1] : 'E') . ':' . parts[2] . ':' . parts[3]
call add(out, err)
let idx +=1
endif
elseif a:errors[idx] =~# '\m^\['
" unparseable errors
call add(out, a:errors[idx])
endif
let idx +=1
endwhile
return out
endfunction " }}}2
function! syntastic#preprocess#bro(errors) abort " {{{2
let out = []
for e in a:errors
let parts = matchlist(e, '\v^%(fatal )?(error|warning) in (.{-1,}), line (\d+): (.+)')
if len(parts) > 4
let parts[1] = parts[1][0]
call add(out, join(parts[1:4], ':'))
endif
endfor
return out
endfunction " }}}2
function! syntastic#preprocess#coffeelint(errors) abort " {{{2
let out = []
for e in a:errors
let parts = matchlist(e, '\v^(.{-1,}),(\d+)%(,\d*)?,(error|warn),(.+)')
if len(parts) > 4
let parts[3] = parts[3][0]
call add(out, join(parts[1:4], ':'))
endif
endfor
return out
endfunction " }}}2
function! syntastic#preprocess#mypy(errors) abort " {{{2
let out = []
for e in a:errors
" new format
let parts = matchlist(e, '\v^(.{-1,}):(\d+): error: (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
continue
endif
" old format
let parts = matchlist(e, '\v^(.{-1,}), line (\d+): (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
endif
endfor
return out
endfunction " }}}2
function! syntastic#preprocess#nix(errors) abort " {{{2
let out = []
for e in a:errors
let parts = matchlist(e, '\v^(.{-1,}), at (.{-1,}):(\d+):(\d+)$')
if len(parts) > 4
call add(out, join(parts[2:4], ':') . ':' . parts[1])
continue
endif
let parts = matchlist(e, '\v^(.{-1,}) at (.{-1,}), line (\d+):')
if len(parts) > 3
call add(out, parts[2] . ':' . parts[3] . ':' . parts[1])
continue
endif
let parts = matchlist(e, '\v^error: (.{-1,}), in (.{-1,})$')
if len(parts) > 2
call add(out, parts[2] . ':' . parts[1])
endif
endfor
return out
endfunction " }}}2
" }}}1
" Private functions {{{1
" @vimlint(EVL102, 1, l:true)
" @vimlint(EVL102, 1, l:false)
" @vimlint(EVL102, 1, l:null)
function! s:_decode_JSON(json) abort " {{{2
if a:json ==# ''
return []
endif
" The following is inspired by https://github.com/MarcWeber/vim-addon-manager and
" http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763
" A hat tip to Marc Weber for this trick
if substitute(a:json, '\v\"%(\\.|[^"\\])*\"|true|false|null|[+-]?\d+%(\.\d+%([Ee][+-]?\d+)?)?', '', 'g') !~# "[^,:{}[\\] \t]"
" JSON artifacts
let true = 1
let false = 0
let null = ''
try
let object = eval(a:json)
catch
" malformed JSON
let object = ''
endtry
else
let object = ''
endif
return object
endfunction " }}}2
" @vimlint(EVL102, 0, l:true) " @vimlint(EVL102, 0, l:true)
" @vimlint(EVL102, 0, l:false) " @vimlint(EVL102, 0, l:false)
" @vimlint(EVL102, 0, l:null) " @vimlint(EVL102, 0, l:null)

@ -51,7 +51,7 @@ endfunction " }}}2
function! syntastic#util#tmpdir() abort " {{{2 function! syntastic#util#tmpdir() abort " {{{2
let tempdir = '' let tempdir = ''
if (has('unix') || has('mac')) && executable('mktemp') if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix')
" TODO: option "-t" to mktemp(1) is not portable " TODO: option "-t" to mktemp(1) is not portable
let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp' let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n") let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
@ -90,33 +90,22 @@ function! syntastic#util#rmrf(what) abort " {{{2
endif endif
if getftype(a:what) ==# 'dir' if getftype(a:what) ==# 'dir'
if !exists('s:rmrf') call s:_delete(a:what, 'rf')
let s:rmrf =
\ has('unix') || has('mac') ? 'rm -rf' :
\ has('win32') || has('win64') ? 'rmdir /S /Q' :
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
endif
if s:rmrf !=# ''
silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
else
call s:_rmrf(a:what)
endif
else else
silent! call delete(a:what) silent! call delete(a:what)
endif endif
endfunction " }}}2 endfunction " }}}2
"search the first 5 lines of the file for a magic number and return a map " Search the first 5 lines of the file for a magic number and return a map
"containing the args and the executable " containing the args and the executable
" "
"e.g. " e.g.
" "
"#!/usr/bin/perl -f -bar " #!/usr/bin/perl -f -bar
" "
"returns " returns
" "
"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} " {'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
function! syntastic#util#parseShebang() abort " {{{2 function! syntastic#util#parseShebang() abort " {{{2
for lnum in range(1, 5) for lnum in range(1, 5)
let line = getline(lnum) let line = getline(lnum)
@ -183,7 +172,7 @@ function! syntastic#util#screenWidth(str, tabstop) abort " {{{2
return width return width
endfunction " }}}2 endfunction " }}}2
"print as much of a:msg as possible without "Press Enter" prompt appearing " Print as much of a:msg as possible without "Press Enter" prompt appearing
function! syntastic#util#wideMsg(msg) abort " {{{2 function! syntastic#util#wideMsg(msg) abort " {{{2
let old_ruler = &ruler let old_ruler = &ruler
let old_showcmd = &showcmd let old_showcmd = &showcmd
@ -226,11 +215,19 @@ function! syntastic#util#bufIsActive(buffer) abort " {{{2
return 0 return 0
endfunction " }}}2 endfunction " }}}2
" start in directory a:where and walk up the parent folders until it finds a " Start in directory a:where and walk up the parent folders until it finds a
" file matching a:what; return path to that file; do NOT use this function if " file named a:what; return path to that file
" a:what doesn't contain wildcards, use findfile(a:what, escape(a:where, ' ') . ';') function! syntastic#util#findFileInParent(what, where) abort " {{{2
" instead let old_suffixesadd = &suffixesadd
function! syntastic#util#findInParent(what, where) abort " {{{2 let &suffixesadd = ''
let file = findfile(a:what, escape(a:where, ' ') . ';')
let &suffixesadd = old_suffixesadd
return file
endfunction " }}}2
" Start in directory a:where and walk up the parent folders until it finds a
" file matching a:what; return path to that file
function! syntastic#util#findGlobInParent(what, where) abort " {{{2
let here = fnamemodify(a:where, ':p') let here = fnamemodify(a:where, ':p')
let root = syntastic#util#Slash() let root = syntastic#util#Slash()
@ -266,8 +263,9 @@ function! syntastic#util#unique(list) abort " {{{2
let seen = {} let seen = {}
let uniques = [] let uniques = []
for e in a:list for e in a:list
if !has_key(seen, e) let k = string(e)
let seen[e] = 1 if !has_key(seen, k)
let seen[k] = 1
call add(uniques, e) call add(uniques, e)
endif endif
endfor endfor
@ -295,7 +293,7 @@ function! syntastic#util#argsescape(opt) abort " {{{2
return [] return []
endfunction " }}}2 endfunction " }}}2
" decode XML entities " Decode XML entities
function! syntastic#util#decodeXMLEntities(string) abort " {{{2 function! syntastic#util#decodeXMLEntities(string) abort " {{{2
let str = a:string let str = a:string
let str = substitute(str, '\m&lt;', '<', 'g') let str = substitute(str, '\m&lt;', '<', 'g')
@ -331,6 +329,87 @@ function! syntastic#util#stamp() abort " {{{2
return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' ) return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' )
endfunction " }}}2 endfunction " }}}2
let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
let s:_wid_pool = 0
" Add unique IDs to windows
function! syntastic#util#setWids() abort " {{{2
for tab in range(1, tabpagenr('$'))
for win in range(1, tabpagewinnr(tab, '$'))
if gettabwinvar(tab, win, 'syntastic_wid') ==# ''
call settabwinvar(tab, win, 'syntastic_wid', s:_wid_base . s:_wid_pool)
let s:_wid_pool += 1
endif
endfor
endfor
endfunction " }}}2
let s:_str2float = function(exists('*str2float') ? 'str2float' : 'str2nr')
lockvar s:_str2float
function! syntastic#util#str2float(val) abort " {{{2
return s:_str2float(a:val)
endfunction " }}}2
function! syntastic#util#float2str(val) abort " {{{2
return s:_float2str(a:val)
endfunction " }}}2
" Crude printf()-like width formatter. Handles wide characters.
function! syntastic#util#wformat(format, str) abort " {{{2
if a:format ==# ''
return a:str
endif
echomsg string(a:format) . ', ' . string(a:str)
let specs = matchlist(a:format, '\v^(-?)(0?)(%([1-9]\d*))?%(\.(\d+))?$')
if len(specs) < 5
return a:str
endif
let flushleft = specs[1] ==# '-'
let lpad = specs[2] ==# '0' ? '0' : ' '
let minlen = str2nr(specs[3])
let maxlen = str2nr(specs[4])
let out = substitute(a:str, "\t", ' ', 'g')
if maxlen && s:_width(out) > maxlen
let chars = filter(split(out, '\zs\ze', 1), 'v:val !=# ""')
let out = ''
if flushleft
for c in chars
if s:_width(out . c) < maxlen
let out .= c
else
let out .= &encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '>'
break
endif
endfor
else
call reverse(chars)
for c in chars
if s:_width(c . out) < maxlen
let out = c . out
else
let out = (&encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '<') . out
break
endif
endfor
endif
endif
if minlen && s:_width(out) < minlen
if flushleft
let out .= repeat(' ', minlen - s:_width(out))
else
let out = repeat(lpad, minlen - s:_width(out)) . out
endif
endif
return out
endfunction " }}}2
" }}}1 " }}}1
" Private functions {{{1 " Private functions {{{1
@ -389,6 +468,27 @@ function! s:_translateElement(key, term) abort " {{{2
return ret return ret
endfunction " }}}2 endfunction " }}}2
" @vimlint(EVL103, 1, a:flags)
function! s:_delete_dumb(what, flags) abort " {{{2
if !exists('s:rmrf')
let s:rmrf =
\ has('unix') || has('mac') ? 'rm -rf' :
\ has('win32') || has('win64') ? 'rmdir /S /Q' :
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
endif
if s:rmrf !=# ''
silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
else
call s:_rmrf(a:what)
endif
endfunction " }}}2
" @vimlint(EVL103, 0, a:flags)
" delete(dir, 'rf') was added in Vim 7.4.1107, but it didn't become usable until 7.4.1128
let s:_delete = function(v:version > 704 || (v:version == 704 && has('patch1128')) ? 'delete' : 's:_delete_dumb')
lockvar s:_delete
function! s:_rmrf(what) abort " {{{2 function! s:_rmrf(what) abort " {{{2
if !exists('s:rmdir') if !exists('s:rmdir')
let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir')) let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir'))
@ -408,6 +508,17 @@ function! s:_rmrf(what) abort " {{{2
endif endif
endfunction " }}}2 endfunction " }}}2
function! s:_float2str_smart(val) abort " {{{2
return printf('%.1f', a:val)
endfunction " }}}2
function! s:_float2str_dumb(val) abort " {{{2
return a:val
endfunction " }}}2
let s:_float2str = function(has('float') ? 's:_float2str_smart' : 's:_float2str_dumb')
lockvar s:_float2str
" }}}1 " }}}1
let &cpo = s:save_cpo let &cpo = s:save_cpo

@ -36,6 +36,7 @@ CONTENTS *syntastic-contents*
5.2.Choosing the executable................|syntastic-config-exec| 5.2.Choosing the executable................|syntastic-config-exec|
5.3.Configuring specific checkers..........|syntastic-config-makeprg| 5.3.Configuring specific checkers..........|syntastic-config-makeprg|
5.4.Sorting errors.........................|syntastic-config-sort| 5.4.Sorting errors.........................|syntastic-config-sort|
5.5.Debugging..............................|syntastic-config-debug|
6.Notes........................................|syntastic-notes| 6.Notes........................................|syntastic-notes|
6.1.Handling of composite filetypes........|syntastic-composite| 6.1.Handling of composite filetypes........|syntastic-composite|
6.2.Editing files over network.............|syntastic-netrw| 6.2.Editing files over network.............|syntastic-netrw|
@ -46,14 +47,15 @@ CONTENTS *syntastic-contents*
7.2.Eclim..................................|syntastic-eclim| 7.2.Eclim..................................|syntastic-eclim|
7.3.The fish shell.........................|syntastic-fish| 7.3.The fish shell.........................|syntastic-fish|
7.4.The fizsh shell........................|syntastic-fizsh| 7.4.The fizsh shell........................|syntastic-fizsh|
7.5.powerline..............................|syntastic-powerline| 7.5.flagship...............................|syntastic-flagship|
7.6.The PowerShell shell...................|syntastic-powershell| 7.6.powerline..............................|syntastic-powerline|
7.7.python-mode............................|syntastic-pymode| 7.7.The PowerShell shell...................|syntastic-powershell|
7.8.vim-auto-save..........................|syntastic-vim-auto-save| 7.8.python-mode............................|syntastic-pymode|
7.9.vim-go.................................|syntastic-vim-go| 7.9.vim-auto-save..........................|syntastic-vim-auto-save|
7.10.vim-virtualenv........................|syntastic-vim-virtualenv| 7.10.vim-go................................|syntastic-vim-go|
7.11.YouCompleteMe.........................|syntastic-ycm| 7.11.vim-virtualenv........................|syntastic-vim-virtualenv|
7.12.The zsh shell and rvm.................|syntastic-zsh| 7.12.YouCompleteMe.........................|syntastic-ycm|
7.13.The zsh shell and MacVim..............|syntastic-zsh|
8.About........................................|syntastic-about| 8.About........................................|syntastic-about|
9.License......................................|syntastic-license| 9.License......................................|syntastic-license|
@ -85,7 +87,7 @@ checker integrations, see the guide on the GitHub wiki:
1.1. Quick start *syntastic-quickstart* 1.1. Quick start *syntastic-quickstart*
Syntastic comes preconfigured with a default list of enabled checkers per Syntastic comes preconfigured with a default list of enabled checkers per
filetype. This list is kept reasonably short to prevent slowing down Vim or |filetype|. This list is kept reasonably short to prevent slowing down Vim or
trying to use conflicting checkers. trying to use conflicting checkers.
You can see the list of checkers available for the current filetype with the You can see the list of checkers available for the current filetype with the
@ -109,10 +111,10 @@ these commands, or perhaps install a plugin such as Tim Pope's 'unimpaired'
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1.2. Recommended settings *syntastic-recommended* 1.2. Recommended settings *syntastic-recommended*
Syntastic has a large number of options that can be configured, and the Syntastic has numerous options that can be configured, and the defaults are
defaults are not particularly well suitable for new users. It is recommended not particularly well suitable for new users. It is recommended that you start
that you start by adding the following lines to your vimrc, and return to them by adding the following lines to your vimrc, and return to them later as
later as needed: > needed: >
set statusline+=%#warningmsg# set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%* set statusline+=%*
@ -157,16 +159,21 @@ Something like this could be more useful: >
When syntax errors are detected a flag will be shown. The content of the flag When syntax errors are detected a flag will be shown. The content of the flag
is derived from the |syntastic_stl_format| option. is derived from the |syntastic_stl_format| option.
Please note that these settings might conflict with other Vim plugins that
change the way statusline works. Refer to these plugins' documentation for
possible solutions. See also |syntastic-powerline| below if you're using the
"powerline" Vim plugin (https://github.com/powerline/powerline).
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2. Error signs *syntastic-error-signs* 2.2. Error signs *syntastic-error-signs*
Syntastic uses the |:sign| commands to mark lines with errors and warnings in Syntastic uses the |:sign| commands (provided that the |+signs| feature is
the sign column. To enable this feature, use the |'syntastic_enable_signs'| compiled in) to mark lines with errors and warnings in the sign column. To
option. enable this feature, use the |'syntastic_enable_signs'| option.
Signs are colored using the Error and Todo syntax highlight groups by default. Signs are colored using the Error and Todo syntax highlight groups by default
If you wish to customize the colors for the signs, you can use the following (see |group-name|). If you wish to customize the colors for the signs, you
groups: can use the following groups:
SyntasticErrorSign - For syntax errors, links to 'error' by default SyntasticErrorSign - For syntax errors, links to 'error' by default
SyntasticWarningSign - For syntax warnings, links to 'todo' by default SyntasticWarningSign - For syntax warnings, links to 'todo' by default
SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign' SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign'
@ -193,17 +200,13 @@ Example: >
You can use the |:Errors| command to display the errors for the current buffer You can use the |:Errors| command to display the errors for the current buffer
in the |location-list|. in the |location-list|.
Note that when you use |:Errors| the current location list is overwritten with
Syntastic's own location list. The location list is also overwritten when
|syntastic_auto_jump| is non-zero and the cursor has to jump to an issue.
By default syntastic doesn't fill the |location-list| with the errors found by By default syntastic doesn't fill the |location-list| with the errors found by
the checkers, in order to reduce clashes with other plugins. Consequently, if the checkers, in order to reduce clashes with other plugins. Consequently, if
you run |:lopen| or |:lwindow| rather than |:Errors| to open the error window you you run |:lopen| or |:lwindow| rather than |:Errors| to open the error window
wouldn't see syntastic's list of errors. If you insist on using |:lopen| or you wouldn't see syntastic's list of errors. If you insist on using |:lopen|
|:lwindow| you should either run |:SyntasticSetLoclist| after running the checks, or |:lwindow| you should either run |:SyntasticSetLoclist| after running the
or set |syntastic_always_populate_loc_list| which tells syntastic to update the checks, or set |syntastic_always_populate_loc_list| which tells syntastic to
|location-list| automatically. update the |location-list| automatically.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.4. Error highlighting *syntastic-highlighting* 2.4. Error highlighting *syntastic-highlighting*
@ -250,7 +253,8 @@ You can selectively disable some of the errors found by checkers either
using |'syntastic_quiet_messages'|, or by specifying a list of patterns in using |'syntastic_quiet_messages'|, or by specifying a list of patterns in
|'syntastic_ignore_files'|. |'syntastic_ignore_files'|.
See also: |'syntastic_<filetype>_<checker>_quiet_messages'|. See also: |'syntastic_<filetype>_<checker>_quiet_messages'| and
|'b:syntastic_skip_checks'|.
============================================================================== ==============================================================================
3. Commands *syntastic-commands* 3. Commands *syntastic-commands*
@ -272,15 +276,15 @@ for more info.
Manually cause a syntax check to be done. By default the checkers in the Manually cause a syntax check to be done. By default the checkers in the
|'g:syntastic_<filetype>_checkers'| or |'b:syntastic_checkers'| lists are run, |'g:syntastic_<filetype>_checkers'| or |'b:syntastic_checkers'| lists are run,
cf. |syntastic-filetype-checkers|. If |syntastic_aggregate_errors| is unset cf. |syntastic-filetype-checkers|. If |'syntastic_aggregate_errors'| is unset
(which is the default), checking stops the first time a checker reports any (which is the default), checking stops the first time a checker reports any
errors; if |syntastic_aggregate_errors| is set, all checkers that apply are run errors; if |'syntastic_aggregate_errors'| is set, all checkers that apply are
in turn, and all errors found are aggregated in a single list. run in turn, and all errors found are aggregated in a single list.
The command may be followed by a (space separated) list of checkers. In this The command may be followed by a (space separated) list of checkers. In this
case |'g:syntastic_<filetype>_checkers'| and |'b:syntastic_checkers'| are case |'g:syntastic_<filetype>_checkers'| and |'b:syntastic_checkers'| are
ignored, and the checkers named by the command's arguments are run instead, in ignored, and the checkers named by the command's arguments are run instead, in
the order specified. The rules of |syntastic_aggregate_errors| still apply. the order specified. The set by |'syntastic_aggregate_errors'| still apply.
Example: > Example: >
:SyntasticCheck flake8 pylint :SyntasticCheck flake8 pylint
@ -306,18 +310,17 @@ the location list explicitly.
============================================================================== ==============================================================================
4. Global Options *syntastic-global-options* 4. Global Options *syntastic-global-options*
*'syntastic_check_on_open'* *'syntastic_check_on_open'*
Default: 0 Default: 0
If enabled, syntastic will do syntax checks when buffers are first loaded as If this variable is enabled, syntastic in active mode will run syntax checks
well as on saving > when buffers are first loaded, as well as on saving: >
let g:syntastic_check_on_open = 1 let g:syntastic_check_on_open = 1
< <
*'syntastic_check_on_wq'* *'syntastic_check_on_wq'*
Default: 1 Default: 1
Normally syntastic runs syntax checks whenever buffers are written to disk. In active mode syntax checks are normally run whenever buffers are written to
If you want to skip these checks when you issue |:wq|, |:x|, and |:ZZ|, set this disk, even when the writes happen just before quitting Vim. If you want to
variable to 0. > skip checks when you issue |:wq|, |:x|, and |:ZZ|, set this variable to 0: >
let g:syntastic_check_on_wq = 0 let g:syntastic_check_on_wq = 0
< <
*'syntastic_aggregate_errors'* *'syntastic_aggregate_errors'*
@ -331,36 +334,37 @@ time a checker finds any errors. >
*'syntastic_id_checkers'* *'syntastic_id_checkers'*
Default: 1 Default: 1
When results from multiple checkers are aggregated in a single error list When results from multiple checkers are aggregated in a single error list
(that is either when |syntastic_aggregate_errors| is enabled, or when checking (that is either when |'syntastic_aggregate_errors'| is enabled, or when
a file with a composite filetype), it might not be immediately obvious which checking a file with a composite filetype), it might not be immediately
checker has produced a given error message. This variable instructs syntastic obvious which checker has produced a given error message. This variable
to label error messages with the names of the checkers that created them. > instructs syntastic to label error messages with the names of the checkers
that created them. >
let g:syntastic_id_checkers = 0 let g:syntastic_id_checkers = 0
< <
*'syntastic_sort_aggregated_errors'* *'syntastic_sort_aggregated_errors'*
Default: 1 Default: 1
By default, when results from multiple checkers are aggregated in a single By default, when results from multiple checkers are aggregated in a single
error list (that is either when |syntastic_aggregate_errors| is enabled, or error list (that is either when |'syntastic_aggregate_errors'| is enabled,
when checking a file with a composite filetype), errors are grouped by file, or when checking a file with a composite filetype), errors are grouped by
then sorted by line number, then grouped by type (namely errors take precedence file, then sorted by line number, then grouped by type (namely errors take
over warnings), then they are sorted by column number. If you want to leave precedence over warnings), then they are sorted by column number. If you want
messages grouped by checker output, set this variable to 0. > to leave messages grouped by checker output, set this variable to 0: >
let g:syntastic_sort_aggregated_errors = 0 let g:syntastic_sort_aggregated_errors = 0
< <
*'syntastic_echo_current_error'* *'syntastic_echo_current_error'*
Default: 1 Default: 1
If enabled, syntastic will echo current error to the command window. If If enabled, syntastic will echo current error to the command window. If
multiple errors are found on the same line, |syntastic_cursor_columns| is used multiple errors are found on the same line, |'syntastic_cursor_columns'| is
to decide which one is shown. > used to decide which one is shown. >
let g:syntastic_echo_current_error = 1 let g:syntastic_echo_current_error = 1
< <
*'syntastic_cursor_columns'* *'syntastic_cursor_columns'*
Default: 1 Default: 1
This option controls which errors are echoed to the command window if This option controls which errors are echoed to the command window if
|syntastic_echo_current_error| is set and multiple errors are found on the same |'syntastic_echo_current_error'| is set and multiple errors are found on the
line. When the option is enabled, the first error corresponding to the current same line. When the option is enabled, the first error corresponding to the
column is show. Otherwise, the first error on the current line is echoed, current column is shown. Otherwise, the first error on the current line is
regardless of the cursor position on the current line. echoed, regardless of the cursor position on the current line.
When dealing with very large lists of errors, disabling this option can speed When dealing with very large lists of errors, disabling this option can speed
up navigation significantly: > up navigation significantly: >
@ -401,10 +405,17 @@ errors (where possible). Highlighting can be turned off with the following >
< <
*'syntastic_always_populate_loc_list'* *'syntastic_always_populate_loc_list'*
Default: 0 Default: 0
Enable this option to tell syntastic to always stick any detected errors into By default syntastic doesn't fill the |location-list| with the errors found
the |location-list|: > by the checkers, in order to reduce clashes with other plugins. Enable this
option to tell syntastic to always stick any detected errors into the
|location-list|: >
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_always_populate_loc_list = 1
< <
Please note that if |'syntastic_auto_jump'| is set to a non-zero value the
location list is overwritten with Syntastic's own list when taking a jump,
regardless of the value of |'syntastic_always_populate_loc_list'|. The
location list is also overwritten when running the |:Errors| command.
*'syntastic_auto_jump'* *'syntastic_auto_jump'*
Default: 0 Default: 0
Enable this option if you want the cursor to jump to the first detected issue Enable this option if you want the cursor to jump to the first detected issue
@ -425,12 +436,17 @@ When set to 3 the cursor will jump to the first error detected, if any. If
all issues detected are warnings, the cursor won't jump. > all issues detected are warnings, the cursor won't jump. >
let g:syntastic_auto_jump = 3 let g:syntastic_auto_jump = 3
< <
Please note that in either situation taking the jump also has the side effect
of the location list being overwritten with Syntastic's own location list,
regardless of the value of |'syntastic_always_populate_loc_list'|.
*'syntastic_auto_loc_list'* *'syntastic_auto_loc_list'*
Default: 2 Default: 2
Use this option to tell syntastic to automatically open and/or close the Use this option to tell syntastic to automatically open and/or close the
|location-list| (see |syntastic-error-window|). |location-list| (see |syntastic-error-window|).
When set to 0 the error window will not be opened or closed automatically. > When set to 0 the error window will be neither opened nor closed
automatically. >
let g:syntastic_auto_loc_list = 0 let g:syntastic_auto_loc_list = 0
< <
When set to 1 the error window will be automatically opened when errors are When set to 1 the error window will be automatically opened when errors are
@ -440,6 +456,10 @@ detected, and closed when none are detected. >
When set to 2 the error window will be automatically closed when no errors are When set to 2 the error window will be automatically closed when no errors are
detected, but not opened automatically. > detected, but not opened automatically. >
let g:syntastic_auto_loc_list = 2 let g:syntastic_auto_loc_list = 2
<
When set to 3 the error window will be automatically opened when errors are
detected, but not closed automatically. >
let g:syntastic_auto_loc_list = 3
< <
*'syntastic_loc_list_height'* *'syntastic_loc_list_height'*
Default: 10 Default: 10
@ -451,8 +471,8 @@ opens. >
Default: [] Default: []
Use this option to specify files that syntastic should never check. It's a Use this option to specify files that syntastic should never check. It's a
list of |regular-expression| patterns. The full paths of files (see |::p|) are list of |regular-expression| patterns. The full paths of files (see |::p|) are
matched against these patterns, and the matches are case sensitive. Use |\c| matched against these patterns, and the matches are case-sensitive. Use |\c|
to specify case insensitive patterns. Example: > to specify case-insensitive patterns. Example: >
let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$'] let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$']
< <
*'syntastic_filetype_map'* *'syntastic_filetype_map'*
@ -461,7 +481,7 @@ Use this option to map non-standard filetypes to standard ones. Corresponding
checkers are mapped accordingly, which allows syntastic to check files with checkers are mapped accordingly, which allows syntastic to check files with
non-standard filetypes: > non-standard filetypes: >
let g:syntastic_filetype_map = { let g:syntastic_filetype_map = {
\ "latex": "tex", \ "plaintex": "tex",
\ "gentoo-metadata": "xml" } \ "gentoo-metadata": "xml" }
< <
Composite filetypes can also be mapped to simple types, which disables the Composite filetypes can also be mapped to simple types, which disables the
@ -527,10 +547,10 @@ overriding filters, cf. |filter-overrides|).
"level" - takes one of two values, "warnings" or "errors" "level" - takes one of two values, "warnings" or "errors"
"type" - can be either "syntax" or "style" "type" - can be either "syntax" or "style"
"regex" - is matched against the messages' text as a case insensitive "regex" - each item in list is matched against the messages' text as a
|regular-expression| case-insensitive |regular-expression|
"file" - is matched against the filenames the messages refer to, as a "file" - each item in list is matched against the filenames the messages
case sensitive |regular-expression|. refer to, as a case-sensitive |regular-expression|.
If a key is prefixed by an exclamation mark "!", the corresponding filter is If a key is prefixed by an exclamation mark "!", the corresponding filter is
negated (i.e. the above example silences all messages that are NOT errors). negated (i.e. the above example silences all messages that are NOT errors).
@ -567,10 +587,23 @@ 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
%ne - filename of file containing first error
%nw - filename of file containing first warning
%N - filename of file containing first warning or error
%pe - filename with path of file containing first error
%pw - filename with path of file containing first warning
%P - filename with path of file containing first warning or error
%fe - line number of first error %fe - line number of first error
%fw - line number of first warning %fw - line number of first warning
%F - line number of first warning or error %F - line number of first warning or error
These flags accept width and alignment controls similar to the ones used by
|'statusline'| flags:
%-0{minwid}.{maxwid}{flag}
All fields except {flag} are optional. A single percent sign can be given as
"%%".
Several additional flags are available to hide text under certain conditions: Several additional flags are available to hide text under certain conditions:
%E{...} - hide the text in the brackets unless there are errors %E{...} - hide the text in the brackets unless there are errors
%W{...} - hide the text in the brackets unless there are warnings %W{...} - hide the text in the brackets unless there are warnings
@ -611,7 +644,6 @@ The above variable can be used to disable exit code checks in syntastic.
*'syntastic_shell'* *'syntastic_shell'*
Default: Vim's 'shell' Default: Vim's 'shell'
This is the (full path to) the shell syntastic will use to run the checkers. This is the (full path to) the shell syntastic will use to run the checkers.
On UNIX and Mac OS-X this shell must accept Bourne-compatible syntax for On UNIX and Mac OS-X this shell must accept Bourne-compatible syntax for
file "stdout" and "stderr" redirections ">file" and "2>file". Examples of file "stdout" and "stderr" redirections ">file" and "2>file". Examples of
@ -623,6 +655,13 @@ operations. It must take care to initialize all environment variables needed
by the checkers you're using. Example: > by the checkers you're using. Example: >
let g:syntastic_shell = "/bin/sh" let g:syntastic_shell = "/bin/sh"
< <
*'syntastic_nested_autocommands'*
Default: 0
Controls whether syntastic's autocommands |BufReadPost| and |BufWritePost|
are called from other |BufReadPost| and |BufWritePost| autocommands (see
|autocmd-nested|). This is known to trigger interoperability problems with
other plugins, so only enable it if you actually need that functionality.
*'syntastic_debug'* *'syntastic_debug'*
Default: 0 Default: 0
Set this to the sum of one or more of the following flags to enable Set this to the sum of one or more of the following flags to enable
@ -779,7 +818,26 @@ this variable, that takes precedence over it in the buffers where it is
defined. defined.
For aggregated lists (see |syntastic-aggregating-errors|) these variables are For aggregated lists (see |syntastic-aggregating-errors|) these variables are
ignored if |syntastic_sort_aggregated_errors| is set (which is the default). ignored if |'syntastic_sort_aggregated_errors'| is set (which is the default).
------------------------------------------------------------------------------
5.5 Debugging *syntastic-config-debug*
Syntastic can log a trace of its working to Vim's |message-history|. To verify
the command line constructed by syntastic to run a checker, set the variable
|'syntastic_debug'| to a non-zero value, run the checker, then run |:mes| to
display the messages, and look for "makeprg" in the output.
From a user's perspective, the useful values for |'syntastic_debug'| are 1, 3,
and 33:
1 - logs syntastic's workflow
3 - logs workflow, checker's output, and |location-list| manipulations
33 - logs workflow and checker-specific details (such as version checks).
Debug logs can be saved to a file; see |'syntastic_debug_file'| for details.
Setting |'syntastic_debug'| to 0 turns off logging.
============================================================================== ==============================================================================
6. Notes *syntastic-notes* 6. Notes *syntastic-notes*
@ -791,7 +849,7 @@ Some Vim plugins use composite filetypes, such as "django.python" or
"handlebars.html". Normally, syntastic deals with this situation by splitting "handlebars.html". Normally, syntastic deals with this situation by splitting
the filetype in its simple components, and calling all checkers that apply. the filetype in its simple components, and calling all checkers that apply.
If this behaviour is not desirable, you can disable it by mapping the If this behaviour is not desirable, you can disable it by mapping the
composite filetypes to a simple ones using |syntastic_filetype_map|, e.g.: > composite filetypes to simple ones using |'syntastic_filetype_map'|, e.g.: >
let g:syntastic_filetype_map = { "handlebars.html": "handlebars" } let g:syntastic_filetype_map = { "handlebars.html": "handlebars" }
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -808,7 +866,7 @@ checkers, without any translation or conversion.
The 'shellslash' option is relevant only on Windows systems. This option The 'shellslash' option is relevant only on Windows systems. This option
determines (among other things) the rules for quoting command lines, and there determines (among other things) the rules for quoting command lines, and there
is no easy way for syntastic to make sure its state is appropriate for your is no easy way for syntastic to make sure its state is appropriate for your
shell. It should be turned off if your 'shell' (or |g:syntastic_shell|) is shell. It should be turned off if your 'shell' (or |'syntastic_shell'|) is
"cmd.exe", and on for shells that expect an UNIX-like syntax, such as Cygwin's "cmd.exe", and on for shells that expect an UNIX-like syntax, such as Cygwin's
"sh". Most checkers will stop working if 'shellslash' is set to the wrong "sh". Most checkers will stop working if 'shellslash' is set to the wrong
value. value.
@ -831,7 +889,7 @@ quickfix windows.
The "csh" and "tcsh" shells are mostly compatible with syntastic. However, The "csh" and "tcsh" shells are mostly compatible with syntastic. However,
some checkers assume Bourne shell syntax for redirecting "stderr". For this some checkers assume Bourne shell syntax for redirecting "stderr". For this
reason, you should point |g:syntastic_shell| to a Bourne-compatible shell, reason, you should point |'syntastic_shell'| to a Bourne-compatible shell,
such as "zsh", "bash", "ksh", or even the original Bourne "sh": > such as "zsh", "bash", "ksh", or even the original Bourne "sh": >
let g:syntastic_shell = "/bin/sh" let g:syntastic_shell = "/bin/sh"
< <
@ -853,7 +911,7 @@ details.
At the time of this writing the "fish" shell (see http://fishshell.com/) At the time of this writing the "fish" shell (see http://fishshell.com/)
doesn't support the standard UNIX syntax for file redirections, and thus it doesn't support the standard UNIX syntax for file redirections, and thus it
can't be used together with syntastic. You can however set |g:syntastic_shell| can't be used together with syntastic. You can however set |'syntastic_shell'|
to a more traditional shell, such as "zsh", "bash", "ksh", or even the to a more traditional shell, such as "zsh", "bash", "ksh", or even the
original Bourne "sh": > original Bourne "sh": >
let g:syntastic_shell = "/bin/sh" let g:syntastic_shell = "/bin/sh"
@ -872,7 +930,17 @@ interactive features of "fizsh". Using a more traditional shell such as "zsh",
let g:syntastic_shell = "/bin/sh" let g:syntastic_shell = "/bin/sh"
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.5. powerline *syntastic-powerline* 7.5 flagship *syntastic-flagship*
The "flagship" Vim plugin (https://github.com/tpope/vim-flagship) has its
own mechanism of showing flags on the |'statusline'|. To allow "flagship"
to manage syntastic's statusline flag add the following |autocommand| to
your vimrc, rather than explicitly adding the flag to your |'statusline'| as
described in the |syntastic-statusline-flag| section above: >
autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag")
<
------------------------------------------------------------------------------
7.6. powerline *syntastic-powerline*
The "powerline" Vim plugin (https://github.com/powerline/powerline) comes The "powerline" Vim plugin (https://github.com/powerline/powerline) comes
packaged with a syntastic segment. To customize this segment create a file packaged with a syntastic segment. To customize this segment create a file
@ -889,7 +957,7 @@ packaged with a syntastic segment. To customize this segment create a file
} }
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.6. The PowerShell shell *syntastic-powershell* 7.7. The PowerShell shell *syntastic-powershell*
At the time of this writing, syntastic is not compatible with using "Windows At the time of this writing, syntastic is not compatible with using "Windows
PowerShell" (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's PowerShell" (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
@ -898,38 +966,36 @@ Vim's 'shell' to a more traditional program, such as "cmd.exe": >
set shell=cmd.exe set shell=cmd.exe
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.7 python-mode *syntastic-pymode* 7.8 python-mode *syntastic-pymode*
Syntastic can be used along with the "python-mode" Vim plugin (see Syntastic can be used along with the "python-mode" Vim plugin (see
https://github.com/klen/python-mode). However, they both run syntax checks by https://github.com/klen/python-mode). However, they both run syntax checks by
default when you save buffers to disk, and this is probably not what you want. default when you save buffers to disk, and this is probably not what you want.
To avoid both plugins opening error windows, you can either set passive mode To avoid both plugins opening error windows, you can either set passive mode
for python in syntastic (see |syntastic_mode_map|), or disable lint checks in for python in syntastic (see |'syntastic_mode_map'|), or disable lint checks in
"python-mode", by setting |pymode_lint_write| to 0. E.g.: > "python-mode", by setting |pymode_lint_on_write| to 0. E.g.: >
let g:pymode_lint_write = 0 let g:pymode_lint_on_write = 0
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.8. vim-auto-save *syntastic-vim-auto-save* 7.9. vim-auto-save *syntastic-vim-auto-save*
Syntastic can be used together with the "vim-auto-save" Vim plugin (see Syntastic can be used together with the "vim-auto-save" Vim plugin (see
https://github.com/907th/vim-auto-save). However, syntastic checks in active https://github.com/907th/vim-auto-save). However, syntastic checks in active
mode only work with "vim-auto-save" version 0.1.7 or later. mode only work with "vim-auto-save" version 0.1.7 or later.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.9. vim-go *syntastic-vim-go* 7.10. vim-go *syntastic-vim-go*
The "vim-go" Vim plugin (https://github.com/fatih/vim-go) uses |quickfix| Syntastic can be used along with the "vim-go" Vim plugin (see
lists, and thus doesn't conflict with syntastic (which uses |location-list| https://github.com/fatih/vim-go). However, both "vim-go" and syntastic run
lists). However, both "vim-go" and syntastic run syntax checks by default syntax checks by default when you save buffers to disk. To avoid conflicts,
when you save buffers to disk, and this can have confusing results. To you have to either set passive mode in syntastic for the go filetype (see
avoid both plugins opening error windows, you can either set passive |syntastic_mode_map|), or prevent "vim-go" from showing a quickfix window when
mode for go in syntastic (see |syntastic_mode_map|), or prevent "vim-go" |g:go_fmt_command| fails, by setting |g:go_fmt_fail_silently| to 1. E.g.: >
from showing a quickfix window when |g:go_fmt_command| fails, by setting
|g:go_fmt_fail_silently| to 1. E.g.: >
let g:go_fmt_fail_silently = 1 let g:go_fmt_fail_silently = 1
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.10. vim-virtualenv *syntastic-vim-virtualenv* 7.11. vim-virtualenv *syntastic-vim-virtualenv*
At the time of this writing, syntastic can't run checkers installed At the time of this writing, syntastic can't run checkers installed
in Python virtual environments activated by "vim-virtualenv" (see in Python virtual environments activated by "vim-virtualenv" (see
@ -937,26 +1003,27 @@ https://github.com/jmcantrell/vim-virtualenv). This is a limitation of
"vim-virtualenv". "vim-virtualenv".
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.11 YouCompleteMe *syntastic-ycm* 7.12 YouCompleteMe *syntastic-ycm*
Syntastic can be used together with the "YouCompleteMe" Vim plugin (see Syntastic can be used together with the "YouCompleteMe" Vim plugin (see
http://valloric.github.io/YouCompleteMe/). However, by default "YouCompleteMe" http://valloric.github.io/YouCompleteMe/). However, by default "YouCompleteMe"
disables syntastic's checkers for the "c", "cpp", "objc", and "objcpp" disables syntastic's checkers for the "c", "cpp", "objc", and "objcpp"
filetypes, in order to allow its own checkers to run. If you want to use YCM's filetypes, in order to allow its own checkers to run. If you want to use YCM's
identifier completer but still run syntastic's checkers for those filetypes you identifier completer but still run syntastic's checkers for those filetypes you
have to set |ycm_show_diagnostics_ui| to 0. E.g.: > have to set |g:ycm_show_diagnostics_ui| to 0. E.g.: >
let g:ycm_show_diagnostics_ui = 0 let g:ycm_show_diagnostics_ui = 0
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7.12 The zsh shell and rvm *syntastic-zsh* 7.13 The zsh shell and MacVim *syntastic-zsh*
If you're running MacVim together with the "zsh" shell (http://www.zsh.org/) If you're running MacVim together with the "zsh" shell (http://www.zsh.org/)
and "rvm" (https://rvm.io/), you need to be aware that MacVim does not source you need to be aware that MacVim does not source your .zshrc file, but will
the .zshrc file, but will source a .zshenv file. Consequently you have to source a .zshenv file. Consequently you have to move any setup steps relevant
either source the "rvm" scripts from within .zshenv, or just set your shell to to the checkers you're using from .zshrc to .zshenv, otherwise your checkers
"sh": > will misbehave when run by syntastic. This is particularly important for
let g:syntastic_shell = "/bin/sh" programs such as "rvm" (https://rvm.io/) or "rbenv" (http://rbenv.org/), that
< rely on setting environment variables.
============================================================================== ==============================================================================
8. About *syntastic-about* 8. About *syntastic-about*

@ -9,7 +9,7 @@
" "
"============================================================================ "============================================================================
if exists('g:loaded_syntastic_plugin') if exists('g:loaded_syntastic_plugin') || &compatible
finish finish
endif endif
let g:loaded_syntastic_plugin = 1 let g:loaded_syntastic_plugin = 1
@ -19,11 +19,16 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.6.0-102' let g:_SYNTASTIC_VERSION = '3.7.0-83'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1
if v:version < 700 || (v:version == 700 && !has('patch175'))
call syntastic#log#error('need Vim version 7.0.175 or later')
finish
endif
for s:feature in [ for s:feature in [
\ 'autocmd', \ 'autocmd',
\ 'eval', \ 'eval',
@ -87,6 +92,7 @@ let g:_SYNTASTIC_DEFAULTS = {
\ 'ignore_extensions': '\c\v^([gx]?z|lzma|bz2)$', \ 'ignore_extensions': '\c\v^([gx]?z|lzma|bz2)$',
\ 'ignore_files': [], \ 'ignore_files': [],
\ 'loc_list_height': 10, \ 'loc_list_height': 10,
\ 'nested_autocommands': 0,
\ 'quiet_messages': {}, \ 'quiet_messages': {},
\ 'reuse_loc_lists': 0, \ 'reuse_loc_lists': 0,
\ 'shell': &shell, \ 'shell': &shell,
@ -130,7 +136,7 @@ let s:_DEBUG_DUMP_OPTIONS = [
\ 'shelltemp', \ 'shelltemp',
\ 'shellxquote' \ 'shellxquote'
\ ] \ ]
if v:version > 703 || (v:version == 703 && has('patch446')) if exists('+shellxescape')
call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape') call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape')
endif endif
lockvar! s:_DEBUG_DUMP_OPTIONS lockvar! s:_DEBUG_DUMP_OPTIONS
@ -157,6 +163,8 @@ let s:registry = g:SyntasticRegistry.Instance()
let s:notifiers = g:SyntasticNotifiers.Instance() let s:notifiers = g:SyntasticNotifiers.Instance()
let s:modemap = g:SyntasticModeMap.Instance() let s:modemap = g:SyntasticModeMap.Instance()
let s:_quit_pre = []
" Commands {{{1 " Commands {{{1
" @vimlint(EVL103, 1, a:cursorPos) " @vimlint(EVL103, 1, a:cursorPos)
@ -184,12 +192,15 @@ endfunction " }}}2
" @vimlint(EVL103, 0, a:cmdLine) " @vimlint(EVL103, 0, a:cmdLine)
" @vimlint(EVL103, 0, a:argLead) " @vimlint(EVL103, 0, a:argLead)
command! -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck call SyntasticCheck(<f-args>) command! -bar -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck call SyntasticCheck(<f-args>)
command! -nargs=? -complete=custom,s:CompleteFiletypes SyntasticInfo call SyntasticInfo(<f-args>) command! -bar -nargs=? -complete=custom,s:CompleteFiletypes SyntasticInfo call SyntasticInfo(<f-args>)
command! Errors call SyntasticErrors() command! -bar Errors call SyntasticErrors()
command! SyntasticReset call SyntasticReset() command! -bar SyntasticReset call SyntasticReset()
command! SyntasticToggleMode call SyntasticToggleMode() command! -bar SyntasticToggleMode call SyntasticToggleMode()
command! SyntasticSetLoclist call SyntasticSetLoclist() command! -bar SyntasticSetLoclist call SyntasticSetLoclist()
command! SyntasticJavacEditClasspath runtime! syntax_checkers/java/*.vim | SyntasticJavacEditClasspath
command! SyntasticJavacEditConfig runtime! syntax_checkers/java/*.vim | SyntasticJavacEditConfig
" }}}1 " }}}1
@ -231,15 +242,26 @@ endfunction " }}}2
" Autocommands {{{1 " Autocommands {{{1
augroup syntastic augroup syntastic
autocmd BufReadPost * call s:BufReadPostHook() autocmd!
autocmd BufWritePost * call s:BufWritePostHook()
autocmd BufEnter * call s:BufEnterHook() autocmd BufEnter * call s:BufEnterHook()
augroup END augroup END
if v:version > 703 || (v:version == 703 && has('patch544')) if g:syntastic_nested_autocommands
augroup syntastic
autocmd BufReadPost * nested call s:BufReadPostHook()
autocmd BufWritePost * nested call s:BufWritePostHook()
augroup END
else
augroup syntastic
autocmd BufReadPost * call s:BufReadPostHook()
autocmd BufWritePost * call s:BufWritePostHook()
augroup END
endif
if exists('##QuitPre')
" QuitPre was added in Vim 7.3.544 " QuitPre was added in Vim 7.3.544
augroup syntastic augroup syntastic
autocmd QuitPre * call s:QuitPreHook() autocmd QuitPre * call s:QuitPreHook(expand('<amatch>', 1))
augroup END augroup END
endif endif
@ -276,10 +298,15 @@ function! s:BufEnterHook() abort " {{{2
endif endif
endfunction " }}}2 endfunction " }}}2
function! s:QuitPreHook() abort " {{{2 function! s:QuitPreHook(fname) abort " {{{2
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, let buf = bufnr(fnameescape(a:fname))
\ 'autocmd: QuitPre, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr(''))))) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, 'autocmd: QuitPre, buffer ' . buf . ' = ' . string(a:fname))
let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq')
if !syntastic#util#var('check_on_wq')
call syntastic#util#setWids()
call add(s:_quit_pre, buf . '_' . getbufvar(buf, 'changetick') . '_' . w:syntastic_wid)
endif
if get(w:, 'syntastic_loclist_set', 0) if get(w:, 'syntastic_loclist_set', 0)
call SyntasticLoclistHide() call SyntasticLoclistHide()
endif endif
@ -296,17 +323,23 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2
call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES) call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES)
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') . call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') .
\ ': ' . (len(a:checker_names) ? join(a:checker_names) : 'default checkers')) \ ': ' . (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
call s:modemap.synch()
if s:_skip_file() if s:_skip_file()
return return
endif endif
call s:modemap.synch()
let run_checks = !a:auto_invoked || s:modemap.doAutoChecking() let run_checks = !a:auto_invoked || s:modemap.doAutoChecking()
if run_checks if run_checks
call s:CacheErrors(a:checker_names) call s:CacheErrors(a:checker_names)
unlockvar! b:syntastic_changedtick unlockvar! b:syntastic_changedtick
let b:syntastic_changedtick = b:changedtick let b:syntastic_changedtick = b:changedtick
lockvar! b:syntastic_changedtick lockvar! b:syntastic_changedtick
else
if a:auto_invoked
return
endif
endif endif
let loclist = g:SyntasticLoclist.current() let loclist = g:SyntasticLoclist.current()
@ -477,6 +510,7 @@ function! SyntasticMake(options) abort " {{{2
if has_key(a:options, 'errorformat') if has_key(a:options, 'errorformat')
let &errorformat = a:options['errorformat'] let &errorformat = a:options['errorformat']
set errorformat<
endif endif
if has_key(a:options, 'cwd') if has_key(a:options, 'cwd')
@ -552,6 +586,7 @@ function! SyntasticMake(options) abort " {{{2
endif endif
if bailout if bailout
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', err_lines)
throw 'Syntastic: checker error' throw 'Syntastic: checker error'
endif endif
@ -609,11 +644,26 @@ function! s:_ignore_file(filename) abort " {{{2
return 0 return 0
endfunction " }}}2 endfunction " }}}2
function! s:_is_quitting(buf) abort " {{{2
let quitting = 0
if exists('w:syntastic_wid')
let key = a:buf . '_' . getbufvar(a:buf, 'changetick') . '_' . w:syntastic_wid
let idx = index(s:_quit_pre, key)
if idx >= 0
call remove(s:_quit_pre, idx)
let quitting = 1
endif
endif
return quitting
endfunction " }}}2
" Skip running in special buffers " Skip running in special buffers
function! s:_skip_file() abort " {{{2 function! s:_skip_file() abort " {{{2
let fname = expand('%', 1) let fname = expand('%', 1)
let skip = get(b:, 'syntastic_skip_checks', 0) || (&buftype !=# '') || let skip = s:_is_quitting(bufnr('%')) || get(b:, 'syntastic_skip_checks', 0) ||
\ !filereadable(fname) || getwinvar(0, '&diff') || s:_ignore_file(fname) || \ (&buftype !=# '') || !filereadable(fname) || getwinvar(0, '&diff') ||
\ getwinvar(0, '&previewwindow') || s:_ignore_file(fname) ||
\ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions \ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
if skip if skip
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, '_skip_file: skipping checks') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, '_skip_file: skipping checks')
@ -627,6 +677,9 @@ function! s:_explain_skip(filetypes) abort " {{{2
let why = [] let why = []
let fname = expand('%', 1) let fname = expand('%', 1)
if s:_is_quitting(bufnr('%'))
call add(why, 'quitting buffer')
endif
if get(b:, 'syntastic_skip_checks', 0) if get(b:, 'syntastic_skip_checks', 0)
call add(why, 'b:syntastic_skip_checks set') call add(why, 'b:syntastic_skip_checks set')
endif endif
@ -639,6 +692,9 @@ function! s:_explain_skip(filetypes) abort " {{{2
if getwinvar(0, '&diff') if getwinvar(0, '&diff')
call add(why, 'diff mode') call add(why, 'diff mode')
endif endif
if getwinvar(0, '&previewwindow')
call add(why, 'preview window')
endif
if s:_ignore_file(fname) if s:_ignore_file(fname)
call add(why, 'filename matching g:syntastic_ignore_files') call add(why, 'filename matching g:syntastic_ignore_files')
endif endif

@ -19,13 +19,13 @@ endfunction " }}}2
function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2 function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle')
let auto_loc_list = syntastic#util#var('auto_loc_list')
if !a:loclist.isEmpty() if !a:loclist.isEmpty()
if syntastic#util#var('auto_loc_list') == 1 if auto_loc_list == 1 || auto_loc_list == 3
call a:loclist.show() call a:loclist.show()
endif endif
else else
if syntastic#util#var('auto_loc_list') > 0 if auto_loc_list == 1 || auto_loc_list == 2
"TODO: this will close the loc list window if one was opened by "TODO: this will close the loc list window if one was opened by
"something other than syntastic "something other than syntastic
lclose lclose

@ -7,22 +7,36 @@ let g:SyntasticChecker = {}
" Public methods {{{1 " Public methods {{{1
function! g:SyntasticChecker.New(args) abort " {{{2 function! g:SyntasticChecker.New(args, ...) abort " {{{2
let newObj = copy(self) let newObj = copy(self)
let newObj._filetype = a:args['filetype'] let newObj._filetype = a:args['filetype']
let newObj._name = a:args['name'] let newObj._name = a:args['name']
let newObj._exec = get(a:args, 'exec', newObj._name)
if has_key(a:args, 'redirect') if a:0
let [filetype, name] = split(a:args['redirect'], '/') " redirected checker
let newObj._exec = get(a:args, 'exec', a:1['_exec'])
let filetype = a:1['_filetype']
let name = a:1['_name']
let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_' let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_'
if exists('g:syntastic_' . filetype . '_' . name . '_sort') && !exists('g:syntastic_' . newObj._filetype . '_' . newObj._name . '_sort') if exists('g:syntastic_' . filetype . '_' . name . '_sort') && !exists('g:syntastic_' . newObj._filetype . '_' . newObj._name . '_sort')
let g:syntastic_{newObj._filetype}_{newObj._name}_sort = g:syntastic_{filetype}_{name}_sort let g:syntastic_{newObj._filetype}_{newObj._name}_sort = g:syntastic_{filetype}_{name}_sort
endif endif
if has_key(a:args, 'enable')
let newObj._enable = a:args['enable']
elseif has_key(a:1, '_enable')
let newObj._enable = a:1['_enable']
endif
else else
let newObj._exec = get(a:args, 'exec', newObj._name)
let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_' let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
if has_key(a:args, 'enable')
let newObj._enable = a:args['enable']
endif
endif endif
let newObj._locListFunc = function(prefix . 'GetLocList') let newObj._locListFunc = function(prefix . 'GetLocList')
@ -54,7 +68,7 @@ endfunction " }}}2
" getExec() or getExecEscaped(). Normally isAvailable() does that for you " getExec() or getExecEscaped(). Normally isAvailable() does that for you
" automatically, but you should keep still this in mind if you change the " automatically, but you should keep still this in mind if you change the
" current checker workflow. " current checker workflow.
function! g:SyntasticChecker.syncExec() dict " {{{2 function! g:SyntasticChecker.syncExec() abort " {{{2
let user_exec = let user_exec =
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec : \ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec'), 1 ) \ syntastic#util#var(self._filetype . '_' . self._name . '_exec'), 1 )
@ -78,6 +92,26 @@ endfunction " }}}2
function! g:SyntasticChecker.getLocListRaw() abort " {{{2 function! g:SyntasticChecker.getLocListRaw() abort " {{{2
let name = self._filetype . '/' . self._name let name = self._filetype . '/' . self._name
if has_key(self, '_enable')
let status = syntastic#util#var(self._enable, -1)
if type(status) != type(0)
call syntastic#log#error('checker ' . name . ': invalid value ' . strtrans(string(status)) .
\ ' for g:syntastic_' . self._enable . '; try 0 or 1 instead')
return []
endif
if status < 0
call syntastic#log#error('checker ' . name . ': checks disabled for security reasons; ' .
\ 'set g:syntastic_' . self._enable . ' to 1 to override')
endif
if status <= 0
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' enabled but not forced')
return []
else
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' forced')
endif
endif
try try
let list = self._locListFunc() let list = self._locListFunc()
if self._exec !=# '' if self._exec !=# ''
@ -108,7 +142,13 @@ function! g:SyntasticChecker.getVersion(...) abort " {{{2
call self.log('getVersion: ' . string(command) . ': ' . call self.log('getVersion: ' . string(command) . ': ' .
\ string(split(version_output, "\n", 1)) . \ string(split(version_output, "\n", 1)) .
\ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') ) \ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') )
call self.setVersion(syntastic#util#parseVersion(version_output)) let parsed_ver = syntastic#util#parseVersion(version_output)
if len(parsed_ver)
call self.setVersion(parsed_ver)
else
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
call syntastic#log#error("checker " . self._filetype . "/" . self._name . ": can't parse version string (abnormal termination?)")
endif
endif endif
return get(self, '_version', []) return get(self, '_version', [])
endfunction " }}}2 endfunction " }}}2
@ -117,8 +157,6 @@ function! g:SyntasticChecker.setVersion(version) abort " {{{2
if len(a:version) if len(a:version)
let self._version = copy(a:version) let self._version = copy(a:version)
call self.log(self.getExec() . ' version =', a:version) call self.log(self.getExec() . ' version =', a:version)
else
call syntastic#log#error("checker " . self._filetype . "/" . self._name . ": can't parse version string (abnormal termination?)")
endif endif
endfunction " }}}2 endfunction " }}}2
@ -152,6 +190,10 @@ function! g:SyntasticChecker.isAvailable() abort " {{{2
return self._available return self._available
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticChecker.isDisabled() abort " {{{2
return has_key(self, '_enable') && syntastic#util#var(self._enable, -1) <= 0
endfunction " }}}2
function! g:SyntasticChecker.wantSort() abort " {{{2 function! g:SyntasticChecker.wantSort() abort " {{{2
return syntastic#util#var(self._filetype . '_' . self._name . '_sort', 0) return syntastic#util#var(self._filetype . '_' . self._name . '_sort', 0)
endfunction " }}}2 endfunction " }}}2

@ -110,19 +110,21 @@ function! g:SyntasticLoclist.getStatuslineFlag() abort " {{{2
"hide stuff wrapped in %B(...) unless there are both errors and warnings "hide stuff wrapped in %B(...) unless there are both errors and warnings
let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g') let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
"sub in the total errors/warnings/both let flags = {
let output = substitute(output, '\m\C%w', num_warnings, 'g') \ '%': '%',
let output = substitute(output, '\m\C%e', num_errors, 'g') \ 't': num_issues,
let output = substitute(output, '\m\C%t', num_issues, 'g') \ 'e': num_errors,
\ 'w': num_warnings,
"first error/warning line num \ 'N': (num_issues ? fnamemodify( bufname(self._rawLoclist[0]['bufnr']), ':t') : ''),
let output = substitute(output, '\m\C%F', num_issues ? self._rawLoclist[0]['lnum'] : '', 'g') \ 'P': (num_issues ? fnamemodify( bufname(self._rawLoclist[0]['bufnr']), ':p:~:.') : ''),
\ 'F': (num_issues ? self._rawLoclist[0]['lnum'] : ''),
"first error line num \ 'ne': (num_errors ? fnamemodify( bufname(errors[0]['bufnr']), ':t') : ''),
let output = substitute(output, '\m\C%fe', num_errors ? errors[0]['lnum'] : '', 'g') \ 'pe': (num_errors ? fnamemodify( bufname(errors[0]['bufnr']), ':p:~:.') : ''),
\ 'fe': (num_errors ? errors[0]['lnum'] : ''),
"first warning line num \ 'nw': (num_warnings ? fnamemodify( bufname(warnings[0]['bufnr']), ':t') : ''),
let output = substitute(output, '\m\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g') \ 'pw': (num_warnings ? fnamemodify( bufname(warnings[0]['bufnr']), ':p:~:.') : ''),
\ 'fw': (num_warnings ? warnings[0]['lnum'] : '') }
let output = substitute(output, '\v\C\%(-?\d*%(\.\d+)?)([npf][ew]|[NPFtew%])', '\=syntastic#util#wformat(submatch(1), flags[submatch(2)])', 'g')
let self._stl_flag = output let self._stl_flag = output
else else

@ -8,7 +8,8 @@ let g:loaded_syntastic_registry = 1
let s:_DEFAULT_CHECKERS = { let s:_DEFAULT_CHECKERS = {
\ 'actionscript': ['mxmlc'], \ 'actionscript': ['mxmlc'],
\ 'ada': ['gcc'], \ 'ada': ['gcc'],
\ 'apiblueprint': ['snowcrash'], \ 'ansible': ['ansible_lint'],
\ 'apiblueprint': ['drafter'],
\ 'applescript': ['osacompile'], \ 'applescript': ['osacompile'],
\ 'asciidoc': ['asciidoc'], \ 'asciidoc': ['asciidoc'],
\ 'asm': ['gcc'], \ 'asm': ['gcc'],
@ -29,6 +30,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'd': ['dmd'], \ 'd': ['dmd'],
\ 'dart': ['dartanalyzer'], \ 'dart': ['dartanalyzer'],
\ 'docbk': ['xmllint'], \ 'docbk': ['xmllint'],
\ 'dockerfile': ['dockerfile_lint'],
\ 'dustjs': ['swiffer'], \ 'dustjs': ['swiffer'],
\ 'elixir': [], \ 'elixir': [],
\ 'erlang': ['escript'], \ 'erlang': ['escript'],
@ -38,10 +40,11 @@ let s:_DEFAULT_CHECKERS = {
\ 'go': ['go'], \ 'go': ['go'],
\ 'haml': ['haml'], \ 'haml': ['haml'],
\ 'handlebars': ['handlebars'], \ 'handlebars': ['handlebars'],
\ 'haskell': ['ghc_mod', 'hdevtools', 'hlint'], \ 'haskell': ['hdevtools', 'hlint'],
\ 'haxe': ['haxe'], \ 'haxe': ['haxe'],
\ 'hss': ['hss'], \ 'hss': ['hss'],
\ 'html': ['tidy'], \ 'html': ['tidy'],
\ 'jade': ['jade_lint'],
\ 'java': ['javac'], \ 'java': ['javac'],
\ 'javascript': ['jshint', 'jslint'], \ 'javascript': ['jshint', 'jslint'],
\ 'json': ['jsonlint', 'jsonval'], \ 'json': ['jsonlint', 'jsonval'],
@ -66,7 +69,9 @@ let s:_DEFAULT_CHECKERS = {
\ 'pod': ['podchecker'], \ 'pod': ['podchecker'],
\ 'puppet': ['puppet', 'puppetlint'], \ 'puppet': ['puppet', 'puppetlint'],
\ 'python': ['python', 'flake8', 'pylint'], \ 'python': ['python', 'flake8', 'pylint'],
\ 'qml': ['qmllint'],
\ 'r': [], \ 'r': [],
\ 'rmd': [],
\ 'racket': ['racket'], \ 'racket': ['racket'],
\ 'rnc': ['rnv'], \ 'rnc': ['rnv'],
\ 'rst': ['rst2pseudoxml'], \ 'rst': ['rst2pseudoxml'],
@ -78,6 +83,8 @@ let s:_DEFAULT_CHECKERS = {
\ 'slim': ['slimrb'], \ 'slim': ['slimrb'],
\ 'sml': ['smlnj'], \ 'sml': ['smlnj'],
\ 'spec': ['rpmlint'], \ 'spec': ['rpmlint'],
\ 'sql': ['sqlint'],
\ 'stylus': ['stylint'],
\ 'tcl': ['nagelfar'], \ 'tcl': ['nagelfar'],
\ 'tex': ['lacheck', 'chktex'], \ 'tex': ['lacheck', 'chktex'],
\ 'texinfo': ['makeinfo'], \ 'texinfo': ['makeinfo'],
@ -91,6 +98,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'xhtml': ['tidy'], \ 'xhtml': ['tidy'],
\ 'xml': ['xmllint'], \ 'xml': ['xmllint'],
\ 'xslt': ['xmllint'], \ 'xslt': ['xmllint'],
\ 'xquery': ['basex'],
\ 'yacc': ['bison'], \ 'yacc': ['bison'],
\ 'yaml': ['jsyaml'], \ 'yaml': ['jsyaml'],
\ 'z80': ['z80syntaxchecker'], \ 'z80': ['z80syntaxchecker'],
@ -151,8 +159,21 @@ function! g:SyntasticRegistry.Instance() abort " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticRegistry.CreateAndRegisterChecker(args) abort " {{{2 function! g:SyntasticRegistry.CreateAndRegisterChecker(args) abort " {{{2
let checker = g:SyntasticChecker.New(a:args)
let registry = g:SyntasticRegistry.Instance() let registry = g:SyntasticRegistry.Instance()
if has_key(a:args, 'redirect')
let [ft, name] = split(a:args['redirect'], '/')
call registry._loadCheckersFor(ft)
let clone = get(registry._checkerMap[ft], name, {})
if empty(clone)
throw 'Syntastic: Checker ' . a:args['redirect'] . ' redirects to unregistered checker ' . ft . '/' . name
endif
let checker = g:SyntasticChecker.New(a:args, clone)
else
let checker = g:SyntasticChecker.New(a:args)
endif
call registry._registerChecker(checker) call registry._registerChecker(checker)
endfunction " }}}2 endfunction " }}}2
@ -181,12 +202,18 @@ function! g:SyntasticRegistry.getCheckers(ftalias, hints_list) abort " {{{2
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]] \ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
endfunction " }}}2 endfunction " }}}2
" Same as getCheckers(), but keep only the checkers available. This runs the " Same as getCheckers(), but keep only the available checkers. This runs the
" corresponding IsAvailable() functions for all checkers. " corresponding IsAvailable() functions for all checkers.
function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) abort " {{{2 function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) abort " {{{2
return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isAvailable()') return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isAvailable()')
endfunction " }}}2 endfunction " }}}2
" Same as getCheckers(), but keep only the checkers that are available and
" disabled. This runs the corresponding IsAvailable() functions for all checkers.
function! g:SyntasticRegistry.getCheckersDisabled(ftalias, hints_list) abort " {{{2
return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isDisabled() && v:val.isAvailable()')
endfunction " }}}2
function! g:SyntasticRegistry.getKnownFiletypes() abort " {{{2 function! g:SyntasticRegistry.getKnownFiletypes() abort " {{{2
let types = keys(s:_DEFAULT_CHECKERS) let types = keys(s:_DEFAULT_CHECKERS)
@ -214,15 +241,18 @@ function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
if len(ft_list) != 1 if len(ft_list) != 1
let available = [] let available = []
let active = [] let active = []
let disabled = []
for ft in ft_list for ft in ft_list
call extend(available, map( self.getNamesOfAvailableCheckers(ft), 'ft . "/" . v:val' )) call extend(available, map( self.getNamesOfAvailableCheckers(ft), 'ft . "/" . v:val' ))
call extend(active, map( self.getCheckersAvailable(ft, []), 'ft . "/" . v:val.getName()' )) call extend(active, map( self.getCheckersAvailable(ft, []), 'ft . "/" . v:val.getName()' ))
call extend(disabled, map( self.getCheckersDisabled(ft, []), 'ft . "/" . v:val.getName()' ))
endfor endfor
else else
let ft = ft_list[0] let ft = ft_list[0]
let available = self.getNamesOfAvailableCheckers(ft) let available = self.getNamesOfAvailableCheckers(ft)
let active = map(self.getCheckersAvailable(ft, []), 'v:val.getName()') let active = map(self.getCheckersAvailable(ft, []), 'v:val.getName()')
let disabled = map(self.getCheckersDisabled(ft, []), 'v:val.getName()')
endif endif
let cnt = len(available) let cnt = len(available)
@ -235,6 +265,13 @@ function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
let cklist = cnt ? join(active) : '-' let cklist = cnt ? join(active) : '-'
echomsg 'Currently enabled checker' . plural . ': ' . cklist echomsg 'Currently enabled checker' . plural . ': ' . cklist
let cnt = len(disabled)
let plural = cnt != 1 ? 's' : ''
if len(disabled)
let cklist = join(sort(disabled))
echomsg 'Checker' . plural . ' disabled for security reasons: ' . cklist
endif
" Eclim feels entitled to mess with syntastic's variables {{{3 " Eclim feels entitled to mess with syntastic's variables {{{3
if exists(':EclimValidate') && get(g:, 'EclimFileTypeValidate', 1) if exists(':EclimValidate') && get(g:, 'EclimFileTypeValidate', 1)
let disabled = filter(copy(ft_list), 's:_disabled_by_eclim(v:val)') let disabled = filter(copy(ft_list), 's:_disabled_by_eclim(v:val)')

@ -32,8 +32,8 @@ function! SyntaxCheckers_ada_gcc_GetLocList() dict
\ '%-G%f:%s:,' . \ '%-G%f:%s:,' .
\ '%f:%l:%c: %m,' . \ '%f:%l:%c: %m,' .
\ '%f:%l: %m', \ '%f:%l: %m',
\ 'main_flags': '-c -x ada -fsyntax-only', \ 'main_flags': '-c -x ada -gnats',
\ 'header_flags': '-x ada', \ 'header_flags': '-x ada -gnats',
\ 'header_names': '\.ads$' }) \ 'header_names': '\.ads$' })
endfunction endfunction

@ -0,0 +1,52 @@
"============================================================================
"File: ansible_lint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Erik Zaadi <erik.zaadi at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_ansible_ansible_lint_checker')
finish
endif
let g:loaded_syntastic_ansible_ansible_lint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ansible_ansible_lint_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 0, 4])
endfunction
function! SyntaxCheckers_ansible_ansible_lint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-p' })
let errorformat = '%f:%l: [ANSIBLE%n] %m'
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'env': env,
\ 'defaults': {'type': 'E'},
\ 'subtype': 'Style',
\ 'returns': [0, 2] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ansible',
\ 'name': 'ansible_lint',
\ 'exec': 'ansible-lint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -1,5 +1,5 @@
"============================================================================ "============================================================================
"File: snowcrash.vim "File: drafter.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot com> "Maintainer: LCD 47 <lcd047 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,
@ -10,19 +10,19 @@
" "
"============================================================================ "============================================================================
if exists('g:loaded_syntastic_apiblueprint_snowcrash_checker') if exists('g:loaded_syntastic_apiblueprint_drafter_checker')
finish finish
endif endif
let g:loaded_syntastic_apiblueprint_snowcrash_checker = 1 let g:loaded_syntastic_apiblueprint_drafter_checker = 1
if !exists('g:syntastic_apiblueprint_snowcrash_sort') if !exists('g:syntastic_apiblueprint_drafter_sort')
let g:syntastic_apiblueprint_snowcrash_sort = 1 let g:syntastic_apiblueprint_drafter_sort = 1
endif endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_apiblueprint_snowcrash_GetLocList() dict function! SyntaxCheckers_apiblueprint_drafter_GetLocList() dict
let makeprg = self.makeprgBuild({ 'post_args': '-u -l' }) let makeprg = self.makeprgBuild({ 'post_args': '-u -l' })
let errorformat = let errorformat =
@ -34,7 +34,7 @@ function! SyntaxCheckers_apiblueprint_snowcrash_GetLocList() dict
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr('')}, \ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 2] }) \ 'returns': [0, 2, 3, 4] })
for e in loclist for e in loclist
let matches = matchlist(e['text'], '\v^(.+); line (\d+), column (\d+) - line (\d+), column (\d+)$') let matches = matchlist(e['text'], '\v^(.+); line (\d+), column (\d+) - line (\d+), column (\d+)$')
@ -58,7 +58,7 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'apiblueprint', \ 'filetype': 'apiblueprint',
\ 'name': 'snowcrash'}) \ 'name': 'drafter'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

@ -22,14 +22,14 @@ function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() }) let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() })
let errorformat = let errorformat =
\ '%Easciidoc: %tRROR: %f: line %l: %m,' . \ '%E%\w%\+: %tRROR: %f: line %l: %m,' .
\ '%Easciidoc: %tRROR: %f: %m,' . \ '%E%\w%\+: %tRROR: %f: %m,' .
\ '%Easciidoc: FAILED: %f: line %l: %m,' . \ '%E%\w%\+: FAILED: %f: line %l: %m,' .
\ '%Easciidoc: FAILED: %f: %m,' . \ '%E%\w%\+: FAILED: %f: %m,' .
\ '%Wasciidoc: %tARNING: %f: line %l: %m,' . \ '%W%\w%\+: %tARNING: %f: line %l: %m,' .
\ '%Wasciidoc: %tARNING: %f: %m,' . \ '%W%\w%\+: %tARNING: %f: %m,' .
\ '%Wasciidoc: DEPRECATED: %f: line %l: %m,' . \ '%W%\w%\+: DEPRECATED: %f: line %l: %m,' .
\ '%Wasciidoc: DEPRECATED: %f: %m' \ '%W%\w%\+: DEPRECATED: %f: %m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,

@ -19,6 +19,10 @@ if !exists('g:syntastic_asm_compiler_options')
let g:syntastic_asm_compiler_options = '' let g:syntastic_asm_compiler_options = ''
endif endif
if !exists('g:syntastic_asm_generic')
let g:syntastic_asm_generic = 0
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
@ -36,14 +40,13 @@ function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1
\ '%f:%l:%c: %trror: %m,' . \ '%f:%l:%c: %trror: %m,' .
\ '%f:%l:%c: %tarning: %m,' . \ '%f:%l:%c: %tarning: %m,' .
\ '%f:%l: %m', \ '%f:%l: %m',
\ 'main_flags': '-x assembler -fsyntax-only -masm=' . s:GetDialect() }) \ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect()) })
endfunction " }}}1 endfunction " }}}1
" Utilities {{{1 " Utilities {{{1
function! s:GetDialect() " {{{2 function! s:GetDialect() " {{{2
return exists('g:syntastic_asm_dialect') ? g:syntastic_asm_dialect : return syntastic#util#var('asm_dialect', expand('%:e', 1) ==? 'asm' ? 'intel' : 'att')
\ expand('%:e', 1) ==? 'asm' ? 'intel' : 'att'
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1

@ -40,14 +40,12 @@ function! SyntaxCheckers_bro_bro_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' }) let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' })
"example: error in ./foo.bro, line 3: unknown identifier banana, at or near "banana" "example: error in ./foo.bro, line 3: unknown identifier banana, at or near "banana"
let errorformat = let errorformat = '%t:%f:%l:%m'
\ 'fatal %trror in %f\, line %l: %m,' .
\ '%trror in %f\, line %l: %m,' .
\ '%tarning in %f\, line %l: %m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat }) \ 'errorformat': errorformat,
\ 'preprocess': 'bro' })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

@ -43,9 +43,12 @@ function! SyntaxCheckers_c_clang_check_GetLocList() dict
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' . \ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
\ '%E%m' \ '%E%m'
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'env': env,
\ 'defaults': {'bufnr': bufnr('')}, \ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1] }) \ 'returns': [0, 1] })
endfunction endfunction

@ -43,9 +43,12 @@ function! SyntaxCheckers_c_clang_tidy_GetLocList() dict
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' . \ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
\ '%E%m' \ '%E%m'
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'env': env,
\ 'defaults': {'bufnr': bufnr('')}, \ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1] }) \ 'returns': [0, 1] })
endfunction endfunction

@ -23,7 +23,7 @@ if !exists('g:syntastic_pc_lint_config_file')
endif endif
function! SyntaxCheckers_c_pc_lint_GetLocList() dict function! SyntaxCheckers_c_pc_lint_GetLocList() dict
let config = findfile(g:syntastic_pc_lint_config_file, escape(expand('%:p:h', 1), ' ') . ';') let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, expand('%:p:h', 1))
call self.log('config =', config) call self.log('config =', config)
" -hFs1 - show filename, add space after messages, try to make message 1 line " -hFs1 - show filename, add space after messages, try to make message 1 line

@ -24,17 +24,14 @@ function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
endif endif
let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') }) let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') })
let errorformat = let errorformat = '%f:%l:%t:%m'
\ '%f\,%l\,%\d%#\,%trror\,%m,' .
\ '%f\,%l\,%trror\,%m,' .
\ '%f\,%l\,%\d%#\,%tarn\,%m,' .
\ '%f\,%l\,%tarn\,%m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'subtype': 'Style', \ 'subtype': 'Style',
\ 'returns': [0, 1] }) \ 'returns': [0, 1],
\ 'preprocess': 'coffeelint' })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

@ -22,7 +22,7 @@ function! SyntaxCheckers_coq_coqtop_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-noglob -batch -load-vernac-source' }) let makeprg = self.makeprgBuild({ 'args_after': '-noglob -batch -load-vernac-source' })
let errorformat = let errorformat =
\ '%AFile \"%f\"\, line %l\, characters %c\-%.%#\:,'. \ '%AFile "%f"\, line %l\, characters %c-%.%#\:,'.
\ '%C%m' \ '%C%m'
return SyntasticMake({ return SyntasticMake({

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_clang_check_checker')
endif endif
let g:loaded_syntastic_cpp_clang_check_checker = 1 let g:loaded_syntastic_cpp_clang_check_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'clang_check', \ 'name': 'clang_check',

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_clang_tidy_checker')
endif endif
let g:loaded_syntastic_cpp_clang_tidy_checker = 1 let g:loaded_syntastic_cpp_clang_tidy_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'clang_tidy', \ 'name': 'clang_tidy',

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_cppcheck_checker')
endif endif
let g:loaded_syntastic_cpp_cppcheck_checker = 1 let g:loaded_syntastic_cpp_cppcheck_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'cppcheck', \ 'name': 'cppcheck',

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_oclint_checker')
endif endif
let g:loaded_syntastic_cpp_oclint_checker = 1 let g:loaded_syntastic_cpp_oclint_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'oclint', \ 'name': 'oclint',

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_cpp_pc_lint_checker')
endif endif
let g:loaded_syntastic_cpp_pc_lint_checker = 1 let g:loaded_syntastic_cpp_pc_lint_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'pc_lint', \ 'name': 'pc_lint',

@ -0,0 +1,22 @@
"============================================================================
"File: mixedindentlint.vim
"Description: Mixed indentation linter for vim
"Maintainer: Payton Swick <payton@foolord.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_css_mixedindentlint_checker')
finish
endif
let g:loaded_syntastic_css_mixedindentlint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css',
\ 'name': 'mixedindentlint',
\ 'redirect': 'javascript/mixedindentlint'})
" vim: set et sts=4 sw=4:

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_css_phpcs_checker')
endif endif
let g:loaded_syntastic_css_phpcs_checker = 1 let g:loaded_syntastic_css_phpcs_checker = 1
runtime! syntax_checkers/php/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css', \ 'filetype': 'css',
\ 'name': 'phpcs', \ 'name': 'phpcs',

@ -16,8 +16,6 @@ if exists('g:loaded_syntastic_css_recess_checker')
endif endif
let g:loaded_syntastic_css_recess_checker = 1 let g:loaded_syntastic_css_recess_checker = 1
runtime! syntax_checkers/less/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css', \ 'filetype': 'css',
\ 'name': 'recess', \ 'name': 'recess',

@ -0,0 +1,47 @@
"============================================================================
"File: stylelint.vim
"Description: Syntax checking plugin for syntastic.vim using `stylelint`
" (https://github.com/stylelint/stylelint).
"Maintainer: Tim Carry <tim at pixelastic dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_css_stylelint_checker')
finish
endif
let g:loaded_syntastic_css_stylelint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
let s:args_after = {
\ 'css': '-f json',
\ 'scss': '-f json -s scss' }
function! SyntaxCheckers_css_stylelint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': get(s:args_after, self.getFiletype(), '') })
let errorformat = '%t:%f:%l:%c:%m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'preprocess': 'stylelint',
\ 'returns': [0, 1, 2] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css',
\ 'name': 'stylelint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_docbk_xmllint_checker')
endif endif
let g:loaded_syntastic_docbk_xmllint_checker = 1 let g:loaded_syntastic_docbk_xmllint_checker = 1
runtime! syntax_checkers/xml/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'docbk', \ 'filetype': 'docbk',
\ 'name': 'xmllint', \ 'name': 'xmllint',

@ -0,0 +1,53 @@
"============================================================================
"File: dockerfile_lint.vim
"Description: Syntax checking plugin for syntastic.vim using dockerfile-lint
" (https://github.com/projectatomic/dockerfile-lint).
"Maintainer: Tim Carry <tim at pixelastic dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_dockerfile_dockerfile_lint_checker')
finish
endif
let g:loaded_syntastic_dockerfile_dockerfile_lint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_dockerfile_dockerfile_lint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-j',
\ 'fname_before': '-f' })
let errorformat = '%t:%n:%l:%m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'preprocess': 'dockerfile_lint',
\ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1] })
for e in loclist
if e['nr']
let e['subtype'] = 'Style'
endif
call remove(e, 'nr')
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'dockerfile',
\ 'name': 'dockerfile_lint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -27,15 +27,9 @@ function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_elixir_elixir_GetLocList() dict function! SyntaxCheckers_elixir_elixir_GetLocList() dict
if !exists('g:syntastic_enable_elixir_checker') || !g:syntastic_enable_elixir_checker
call syntastic#log#error('checker elixir/elixir: checks disabled for security reasons; ' .
\ 'set g:syntastic_enable_elixir_checker to 1 to override')
return []
endif
let make_options = {} let make_options = {}
let compile_command = 'elixir' let compile_command = 'elixir'
let mix_file = findfile('mix.exs', escape(expand('%:p:h', 1), ' ') . ';') let mix_file = syntastic#util#findFileInParent('mix.exs', expand('%:p:h', 1))
if filereadable(mix_file) if filereadable(mix_file)
let compile_command = 'mix compile' let compile_command = 'mix compile'
@ -53,7 +47,8 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'elixir', \ 'filetype': 'elixir',
\ 'name': 'elixir'}) \ 'name': 'elixir',
\ 'enable': 'enable_elixir_checker'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

@ -10,10 +10,17 @@ main([File]) ->
warn_unused_import, warn_unused_import,
report, report,
{i, Dir ++ "/include"}], {i, Dir ++ "/include"}],
%% `rebar.config` is looked for,
%% but it is not necessarily the one in the project root.
%% I.e. it may be one deeper in the project file hierarchy.
RebarFile = rebar_file(Dir), RebarFile = rebar_file(Dir),
%% `rebar.config` might contain relative paths.
%% They are relative to the file! Not to the project root.
RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile), RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile),
code:add_patha(filename:absname("ebin")), code:add_patha(filename:absname("ebin")),
compile:file(File, Defs ++ RebarOpts); %% `compile:file/2` requires the `{i, Path}` to be relative
%% to CWD - no surprise here.
compile:file(File, Defs ++ translate_paths(Dir, RebarOpts));
main(_) -> main(_) ->
io:format("Usage: ~s <file>~n", [escript:script_name()]), io:format("Usage: ~s <file>~n", [escript:script_name()]),
@ -74,3 +81,15 @@ get_root(["test" | Tail], _Path) ->
lists:reverse(Tail); lists:reverse(Tail);
get_root([_ | Tail], Path) -> get_root([_ | Tail], Path) ->
get_root(Tail, Path). get_root(Tail, Path).
translate_paths(Dir, RebarOpts) ->
[ translate_path(Dir, Opt) || Opt <- RebarOpts ].
translate_path(Dir, {i, Path}) ->
case Path of
%% absolute
"/" ++ _ -> {i, Path};
%% relative -> make absolute taking rebar.config location into account
_ -> {i, filename:join([Dir, Path])}
end;
translate_path(_, Other) -> Other.

@ -44,8 +44,8 @@ function! SyntaxCheckers_fortran_gfortran_GetLocList() dict " {{{1
let errorformat = let errorformat =
\ '%-C %#,'. \ '%-C %#,'.
\ '%-C %#%.%#,'. \ '%-C %#%.%#,'.
\ '%A%f:%l.%c:,'. \ '%A%f:%l%[.:]%c:,'.
\ '%Z%trror: %m,'. \ '%Z%\m%\%%(Fatal %\)%\?%trror: %m,'.
\ '%Z%tarning: %m,'. \ '%Z%tarning: %m,'.
\ '%-G%.%#' \ '%-G%.%#'
if !exists('g:syntastic_fortran_gfortran_sort') if !exists('g:syntastic_fortran_gfortran_sort')

@ -27,6 +27,10 @@ function! SyntaxCheckers_go_go_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_go_go_GetLocList() dict function! SyntaxCheckers_go_go_GetLocList() dict
if !exists('s:go_new')
let s:go_new = syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [1, 5])
endif
" Check with gofmt first, since `go build` and `go test` might not report " 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 " syntax errors in the current file if another file with syntax error is
" compiled first. " compiled first.
@ -51,15 +55,15 @@ function! SyntaxCheckers_go_go_GetLocList() dict
" compiled by `go build`, therefore `go test` must be called for those. " compiled by `go build`, therefore `go test` must be called for those.
if match(expand('%', 1), '\m_test\.go$') == -1 if match(expand('%', 1), '\m_test\.go$') == -1
let cmd = 'build' let cmd = 'build'
let opts = syntastic#util#var('go_go_build_args') let opts = syntastic#util#var('go_go_build_args', s:go_new ? '-buildmode=archive' : '')
let cleanup = 0 let cleanup = 0
else else
let cmd = 'test -c' let cmd = 'test -c'
let opts = syntastic#util#var('go_go_test_args') let opts = syntastic#util#var('go_go_test_args', s:go_new ? '-buildmode=archive' : '')
let cleanup = 1 let cleanup = 1
endif endif
let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts
let makeprg = self.getExec() . ' ' . cmd . ' ' . opt_str let makeprg = self.getExecEscaped() . ' ' . cmd . ' ' . opt_str
" The first pattern is for warnings from C compilers. " The first pattern is for warnings from C compilers.
let errorformat = let errorformat =
@ -67,6 +71,8 @@ function! SyntaxCheckers_go_go_GetLocList() dict
\ '%E%f:%l:%c:%m,' . \ '%E%f:%l:%c:%m,' .
\ '%E%f:%l:%m,' . \ '%E%f:%l:%m,' .
\ '%C%\s%\+%m,' . \ '%C%\s%\+%m,' .
\ '%+Ecan''t load package: %m,' .
\ '%+Einternal error: %m,' .
\ '%-G#%.%#' \ '%-G#%.%#'
" The go compiler needs to either be run with an import path as an " The go compiler needs to either be run with an import path as an
@ -77,6 +83,7 @@ function! SyntaxCheckers_go_go_GetLocList() dict
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'cwd': expand('%:p:h', 1), \ 'cwd': expand('%:p:h', 1),
\ 'env': {'GOGC': 'off'},
\ 'defaults': {'type': 'e'} }) \ 'defaults': {'type': 'e'} })
if cleanup if cleanup

@ -0,0 +1,53 @@
"============================================================================
"File: gometalinter.vim
"Description: Check go syntax using 'gometalint'
"Maintainer: Joshua Rubin <joshua@rubixconsulting.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_go_gometalinter_checker')
finish
endif
let g:loaded_syntastic_go_gometalinter_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_go_gometalinter_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': '-t',
\ 'fname': syntastic#util#shexpand('%:p:h') })
let errorformat =
\ '%f:%l:%c:%trror: %m,' .
\ '%f:%l:%c:%tarning: %m,' .
\ '%f:%l::%trror: %m,' .
\ '%f:%l::%tarning: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0, 1] })
for e in loclist
if e['text'] =~# '\v\(%(deadcode|gocyclo|golint|defercheck|varcheck|structcheck|errcheck|dupl)\)$'
let e['subtype'] = 'Style'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'go',
\ 'name': 'gometalinter'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -19,7 +19,9 @@ let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_go_gotype_GetLocList() dict function! SyntaxCheckers_go_gotype_GetLocList() dict
let makeprg = self.getExecEscaped() . ' .' let makeprg = self.makeprgBuild({
\ 'args': (expand('%', 1) =~# '\m_test\.go$' ? '-a' : ''),
\ 'fname': '.' })
let errorformat = let errorformat =
\ '%f:%l:%c: %m,' . \ '%f:%l:%c: %m,' .

@ -23,7 +23,7 @@ function! SyntaxCheckers_go_govet_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_go_govet_GetLocList() dict function! SyntaxCheckers_go_govet_GetLocList() dict
let makeprg = self.getExec() . ' vet' let makeprg = self.getExecEscaped() . ' vet'
let errorformat = let errorformat =
\ '%Evet: %.%\+: %f:%l:%c: %m,' . \ '%Evet: %.%\+: %f:%l:%c: %m,' .

@ -30,25 +30,35 @@ function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict
" know the version in order to know how to find out the version. :) " know the version in order to know how to find out the version. :)
" Try "ghc-mod version". " Try "ghc-mod version".
let ver = filter(split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n'), 'v:val =~# ''\m\sversion''') let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1)
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
if !len(ver) if !len(ver)
" That didn't work. Try "ghc-mod" alone. " That didn't work. Try "ghc-mod" alone.
let ver = filter(split(syntastic#util#system(self.getExecEscaped()), '\n'), 'v:val =~# ''\m\sversion''') let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1)
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
endif endif
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : []
if len(ver) if len(parsed_ver)
" Encouraged by the great success in finding out the version, now we " Encouraged by the great success in finding out the version, now we
" need either a Vim that can handle NULs in system() output, or a " need either a Vim that can handle NULs in system() output, or a
" ghc-mod that has the "--boundary" option. " ghc-mod that has the "--boundary" option.
let parsed_ver = syntastic#util#parseVersion(ver[0])
call self.setVersion(parsed_ver) call self.setVersion(parsed_ver)
let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2]) let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
else else
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)") call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
let s:ghc_mod_new = -1 let s:ghc_mod_new = -1
endif endif
return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) " ghc-mod 5.4.0 wants to run in the root directory of the project;
" syntastic can't cope with the resulting complications
"
" References:
" https://hackage.haskell.org/package/ghc-mod-5.4.0.0/changelog
let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4])
return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout
endfunction endfunction
function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict

@ -18,6 +18,7 @@ function! SyntaxCheckers_haskell_hlint_GetLocList() dict
\ 'fname': syntastic#util#shexpand('%:p')}) \ 'fname': syntastic#util#shexpand('%:p')})
let errorformat = let errorformat =
\ '%E%f:%l:%v: Error while reading hint file\, %m,' .
\ '%E%f:%l:%v: Error: %m,' . \ '%E%f:%l:%v: Error: %m,' .
\ '%W%f:%l:%v: Warning: %m,' . \ '%W%f:%l:%v: Warning: %m,' .
\ '%C%m' \ '%C%m'

@ -24,7 +24,7 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
elseif exists('g:vaxe_hxml') elseif exists('g:vaxe_hxml')
let hxml = g:vaxe_hxml let hxml = g:vaxe_hxml
else else
let hxml = syntastic#util#findInParent('*.hxml', expand('%:p:h', 1)) let hxml = syntastic#util#findGlobInParent('*.hxml', expand('%:p:h', 1))
endif endif
let hxml = fnamemodify(hxml, ':p') let hxml = fnamemodify(hxml, ':p')

@ -0,0 +1,40 @@
"============================================================================
"File: jade_lint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Ben Parnell <benjaminparnell.94@gmail.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_jade_jade_lint_checker')
finish
endif
let g:loaded_syntastic_jade_jade_lint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_jade_jade_lint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-r inline' })
let errorformat = '%f:%l:%c %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0, 2] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'jade',
\ 'name': 'jade_lint',
\ 'exec': 'jade-lint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -17,7 +17,7 @@ endif
let g:loaded_syntastic_java_checkstyle_checker = 1 let g:loaded_syntastic_java_checkstyle_checker = 1
if !exists('g:syntastic_java_checkstyle_classpath') if !exists('g:syntastic_java_checkstyle_classpath')
let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar' let g:syntastic_java_checkstyle_classpath = 'checkstyle-6.10.1-all.jar'
endif endif
if !exists('g:syntastic_java_checkstyle_conf_file') if !exists('g:syntastic_java_checkstyle_conf_file')
@ -32,30 +32,38 @@ function! SyntaxCheckers_java_checkstyle_IsAvailable() dict
return 0 return 0
endif endif
let classpath = expand(g:syntastic_java_checkstyle_classpath, 1)
let conf_file = expand(g:syntastic_java_checkstyle_conf_file, 1) let conf_file = expand(g:syntastic_java_checkstyle_conf_file, 1)
call self.log( call self.log('filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
\ 'filereadable(' . string(classpath) . ') = ' . filereadable(classpath) . ', ' .
\ 'filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
return filereadable(classpath) && filereadable(conf_file) return filereadable(conf_file)
endfunction endfunction
function! SyntaxCheckers_java_checkstyle_GetLocList() dict function! SyntaxCheckers_java_checkstyle_GetLocList() dict
let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) ) " classpath
if !exists('s:sep')
let s:sep = syntastic#util#isRunningWindows() || has('win32unix') ? ';' : ':'
endif
let classpath = join(map( split(g:syntastic_java_checkstyle_classpath, s:sep, 1), 'expand(v:val, 1)' ), s:sep)
call self.log('classpath =', classpath)
" forced options
let opts = []
if classpath !=# ''
call extend(opts, ['-cp', classpath])
endif
call extend(opts, [
\ 'com.puppycrawl.tools.checkstyle.Main',
\ '-c', expand(g:syntastic_java_checkstyle_conf_file, 1),
\ '-f', 'xml' ])
" filename
let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) )
if has('win32unix') if has('win32unix')
let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g') let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g')
endif endif
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({ 'args_after': opts, 'fname': fname })
\ 'args_after': [
\ '-cp', expand(g:syntastic_java_checkstyle_classpath, 1),
\ 'com.puppycrawl.tools.checkstyle.Main',
\ '-c', expand(g:syntastic_java_checkstyle_conf_file, 1),
\ '-f', 'xml'],
\ 'fname': fname })
let errorformat = '%f:%t:%l:%c:%m' let errorformat = '%f:%t:%l:%c:%m'

@ -73,11 +73,23 @@ endif
" }}}1 " }}}1
" Constants {{{1
let s:_FILE_SHORTCUTS = {
\ '%FILE_PATH%': '%:p',
\ '%FILE_NAME%': '%:t',
\ '%FILE_DIR%': '%:p:h',
\ }
lockvar! s:_FILE_SHORTCUTS
" }}}1
" Commands {{{1
command! SyntasticJavacEditClasspath call s:EditClasspath() command! SyntasticJavacEditClasspath call s:EditClasspath()
command! SyntasticJavacEditConfig call s:EditConfig()
if g:syntastic_java_javac_config_file_enabled " }}}1
command! SyntasticJavacEditConfig call s:EditConfig()
endif
function! SyntaxCheckers_java_javac_IsAvailable() dict " {{{1 function! SyntaxCheckers_java_javac_IsAvailable() dict " {{{1
let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1)) let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1))
@ -129,7 +141,12 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
" load custom classpath {{{2 " load custom classpath {{{2
if g:syntastic_java_javac_custom_classpath_command !=# '' if g:syntastic_java_javac_custom_classpath_command !=# ''
let lines = syntastic#util#system(g:syntastic_java_javac_custom_classpath_command) " Pre-process the classpath command string a little.
let classpath_command = g:syntastic_java_javac_custom_classpath_command
for [key, val] in items(s:_FILE_SHORTCUTS)
let classpath_command = substitute(classpath_command, '\V' . key, syntastic#util#shexpand(val), 'g')
endfor
let lines = syntastic#util#system(classpath_command)
if syntastic#util#isRunningWindows() || has('win32unix') if syntastic#util#isRunningWindows() || has('win32unix')
let lines = substitute(lines, "\r\n", "\n", 'g') let lines = substitute(lines, "\r\n", "\n", 'g')
endif endif
@ -157,9 +174,8 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
let errorformat = let errorformat =
\ '%E%f:%l: error: %m,'. \ '%E%f:%l: error: %m,'.
\ '%W%f:%l: warning: %m,'. \ '%W%f:%l: warning: %m,'.
\ '%A%f:%l: %m,'. \ '%E%f:%l: %m,'.
\ '%+Z%p^,'. \ '%Z%p^,'.
\ '%+C%.%#,'.
\ '%-G%.%#' \ '%-G%.%#'
if output_dir !=# '' if output_dir !=# ''
@ -274,6 +290,10 @@ function! s:SaveConfig() " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:EditConfig() " {{{2 function! s:EditConfig() " {{{2
if !g:syntastic_java_javac_config_file_enabled
return
endif
let command = 'syntastic javac config' let command = 'syntastic javac config'
let winnr = bufwinnr('^' . command . '$') let winnr = bufwinnr('^' . command . '$')
if winnr < 0 if winnr < 0
@ -299,7 +319,7 @@ endfunction " }}}2
function! s:GetMavenProperties() " {{{2 function! s:GetMavenProperties() " {{{2
let mvn_properties = {} let mvn_properties = {}
let pom = findfile('pom.xml', escape(expand('%:p:h', 1), ' ') . ';') let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom) if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
@ -334,13 +354,13 @@ function! s:GetMavenProperties() " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:GetMavenClasspath() " {{{2 function! s:GetMavenClasspath() " {{{2
let pom = findfile('pom.xml', escape(expand('%:p:h', 1), ' ') . ';') let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom) if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
\ ' -f ' . syntastic#util#shescape(pom) . \ ' -f ' . syntastic#util#shescape(pom) .
\ ' ' . g:syntastic_java_maven_options \ ' ' . g:syntastic_java_maven_options
let mvn_classpath_output = split(syntastic#util#system(mvn_cmd . ' dependency:build-classpath'), "\n") let mvn_classpath_output = split(syntastic#util#system(mvn_cmd . ' dependency:build-classpath -DincludeScope=test'), "\n")
let mvn_classpath = '' let mvn_classpath = ''
let class_path_next = 0 let class_path_next = 0
@ -357,16 +377,10 @@ function! s:GetMavenClasspath() " {{{2
let mvn_properties = s:GetMavenProperties() let mvn_properties = s:GetMavenProperties()
let sep = syntastic#util#Slash() let sep = syntastic#util#Slash()
let output_dir = join(['target', 'classes'], sep) let output_dir = get(mvn_properties, 'project.build.outputDirectory', join(['target', 'classes'], sep))
if has_key(mvn_properties, 'project.build.outputDirectory')
let output_dir = mvn_properties['project.build.outputDirectory']
endif
let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir) let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir)
let test_output_dir = join(['target', 'test-classes'], sep) let test_output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join(['target', 'test-classes'], sep))
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let test_output_dir = mvn_properties['project.build.testOutputDirectory']
endif
let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir) let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir)
let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom) let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom)
@ -378,26 +392,19 @@ function! s:GetMavenClasspath() " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:MavenOutputDirectory() " {{{2 function! s:MavenOutputDirectory() " {{{2
let pom = findfile('pom.xml', escape(expand('%:p:h', 1), ' ') . ';') let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
let mvn_properties = s:GetMavenProperties() let mvn_properties = s:GetMavenProperties()
let output_dir = getcwd() let output_dir = get(mvn_properties, 'project.properties.build.dir', getcwd())
if has_key(mvn_properties, 'project.properties.build.dir')
let output_dir = mvn_properties['project.properties.build.dir']
endif
let sep = syntastic#util#Slash() let sep = syntastic#util#Slash()
if stridx(expand('%:p:h', 1), join(['src', 'main', 'java'], sep)) >= 0 let src_main_dir = get(mvn_properties, 'project.build.sourceDirectory', join(['src', 'main', 'java'], sep))
let output_dir = join ([output_dir, 'target', 'classes'], sep) let src_test_dir = get(mvn_properties, 'project.build.testsourceDirectory', join(['src', 'test', 'java'], sep))
if has_key(mvn_properties, 'project.build.outputDirectory') if stridx(expand('%:p:h', 1), src_main_dir) >= 0
let output_dir = mvn_properties['project.build.outputDirectory'] let output_dir = get(mvn_properties, 'project.build.outputDirectory', join ([output_dir, 'target', 'classes'], sep))
endif
endif
if stridx(expand('%:p:h', 1), join(['src', 'test', 'java'], sep)) >= 0
let output_dir = join([output_dir, 'target', 'test-classes'], sep)
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let output_dir = mvn_properties['project.build.testOutputDirectory']
endif endif
if stridx(expand('%:p:h', 1), src_test_dir) >= 0
let output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join([output_dir, 'target', 'test-classes'], sep))
endif endif
if has('win32unix') if has('win32unix')

@ -18,21 +18,31 @@ if !exists('g:syntastic_javascript_eslint_sort')
let g:syntastic_javascript_eslint_sort = 1 let g:syntastic_javascript_eslint_sort = 1
endif endif
if !exists('g:syntastic_javascript_eslint_generic')
let g:syntastic_javascript_eslint_generic = 0
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_javascript_eslint_IsAvailable() dict function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
if g:syntastic_javascript_eslint_generic
call self.log('generic eslint, exec =', self.getExec())
endif
if !executable(self.getExec()) if !executable(self.getExec())
return 0 return 0
endif endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1]) return g:syntastic_javascript_eslint_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1])
endfunction endfunction
function! SyntaxCheckers_javascript_eslint_GetLocList() dict function! SyntaxCheckers_javascript_eslint_GetLocList() dict
if !g:syntastic_javascript_eslint_generic
call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args', call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)") \ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
endif
let makeprg = self.makeprgBuild({ 'args_before': '-f compact' }) let makeprg = self.makeprgBuild({ 'args_before': (g:syntastic_javascript_eslint_generic ? '' : '-f compact') })
let errorformat = let errorformat =
\ '%E%f: line %l\, col %c\, Error - %m,' . \ '%E%f: line %l\, col %c\, Error - %m,' .
@ -43,9 +53,17 @@ function! SyntaxCheckers_javascript_eslint_GetLocList() dict
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'postprocess': ['guards'] }) \ 'postprocess': ['guards'] })
if !g:syntastic_javascript_eslint_generic
if !exists('s:eslint_new')
let s:eslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
endif
if !s:eslint_new
for e in loclist for e in loclist
let e['col'] += 1 let e['col'] += 1
endfor endfor
endif
endif
return loclist return loclist
endfunction endfunction

@ -29,12 +29,12 @@ function! SyntaxCheckers_javascript_flow_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_javascript_flow_GetLocList() dict function! SyntaxCheckers_javascript_flow_GetLocList() dict
if findfile('.flowconfig', escape(expand('%:p:h', 1), ' ') . ';') ==# '' if syntastic#util#findFileInParent('.flowconfig', expand('%:p:h', 1)) ==# ''
return [] return []
endif endif
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({
\ 'exe': self.getExecEscaped() . ' status', \ 'exe': self.getExecEscaped() . ' check',
\ 'args_after': '--show-all-errors --json' }) \ 'args_after': '--show-all-errors --json' })
let errorformat = let errorformat =

@ -21,16 +21,25 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_javascript_jscs_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 1])
endfunction
function! SyntaxCheckers_javascript_jscs_GetLocList() dict function! SyntaxCheckers_javascript_jscs_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--no-colors --reporter checkstyle' }) let makeprg = self.makeprgBuild({
\ 'args_after': '--no-colors --max-errors -1 --reporter json' })
let errorformat = '%f:%t:%l:%c:%m' let errorformat = '%f:%l:%c:%m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'subtype': 'Style', \ 'subtype': 'Style',
\ 'preprocess': 'checkstyle', \ 'preprocess': 'jscs',
\ 'defaults': {'type': 'E'},
\ 'returns': [0, 2] }) \ 'returns': [0, 2] })
endfunction endfunction

@ -18,15 +18,20 @@ let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
let jsxhint_version = syntastic#util#system(self.getExecEscaped() . ' --version') if !executable(self.getExec())
if v:shell_error || (jsxhint_version !~# '\m^JSXHint\>')
return 0 return 0
endif endif
let ver = syntastic#util#parseVersion(jsxhint_version) let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
call self.setVersion(ver) let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : []
if len(parsed_ver)
call self.setVersion(parsed_ver)
else
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
call syntastic#log#error("checker javascript/jsxhint: can't parse version string (abnormal termination?)")
endif
return syntastic#util#versionIsAtLeast(ver, [0, 4, 1]) return syntastic#util#versionIsAtLeast(parsed_ver, [0, 4, 1])
endfunction endfunction
function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict

@ -0,0 +1,40 @@
"============================================================================
"File: mixedindentlint.vim
"Description: Mixed indentation linter for vim
"Maintainer: Payton Swick <payton@foolord.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_javascript_mixedindentlint_checker')
finish
endif
let g:loaded_syntastic_javascript_mixedindentlint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_mixedindentlint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = 'Line %l in "%f" %.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'defaults': { 'text': 'Indentation differs from rest of file' },
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'mixedindentlint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -14,14 +14,22 @@ if exists('g:loaded_syntastic_javascript_standard_checker')
endif endif
let g:loaded_syntastic_javascript_standard_checker = 1 let g:loaded_syntastic_javascript_standard_checker = 1
if !exists('g:syntastic_javascript_standard_generic')
let g:syntastic_javascript_standard_generic = 0
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_javascript_standard_IsAvailable() dict function! SyntaxCheckers_javascript_standard_IsAvailable() dict
if g:syntastic_javascript_standard_generic
call self.log('generic standard, exec =', self.getExec())
endif
if !executable(self.getExec()) if !executable(self.getExec())
return 0 return 0
endif endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1]) return g:syntastic_javascript_standard_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1])
endfunction endfunction
function! SyntaxCheckers_javascript_standard_GetLocList() dict function! SyntaxCheckers_javascript_standard_GetLocList() dict

@ -23,14 +23,15 @@ function! SyntaxCheckers_nix_nix_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--parse-only' }) let makeprg = self.makeprgBuild({ 'args_after': '--parse-only' })
let errorformat = let errorformat =
\ '%m\, at %f:%l:%c,' . \ '%f:%l:%c:%m,' .
\ '%m at %f\, line %l:,' . \ '%f:%l:%m,' .
\ 'error: %m\, in %f' \ '%f:%m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': {'type': 'e'} }) \ 'defaults': {'type': 'e'},
\ 'preprocess': 'nix' })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_nroff_igor_checker')
endif endif
let g:loaded_syntastic_nroff_igor_checker = 1 let g:loaded_syntastic_nroff_igor_checker = 1
runtime! syntax_checkers/docbk/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'nroff', \ 'filetype': 'nroff',
\ 'name': 'igor', \ 'name': 'igor',

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_objc_oclint_checker')
endif endif
let g:loaded_syntastic_objc_oclint_checker = 1 let g:loaded_syntastic_objc_oclint_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'objc', \ 'filetype': 'objc',
\ 'name': 'oclint', \ 'name': 'oclint',

@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_objcpp_oclint_checker')
endif endif
let g:loaded_syntastic_objcpp_oclint_checker = 1 let g:loaded_syntastic_objcpp_oclint_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'objcpp', \ 'filetype': 'objcpp',
\ 'name': 'oclint', \ 'name': 'oclint',

@ -51,12 +51,6 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_perl_perl_GetLocList() dict function! SyntaxCheckers_perl_perl_GetLocList() dict
if !exists('g:syntastic_enable_perl_checker') || !g:syntastic_enable_perl_checker
call syntastic#log#error('checker perl/perl: checks disabled for security reasons; ' .
\ 'set g:syntastic_enable_perl_checker to 1 to override')
return []
endif
if type(g:syntastic_perl_lib_path) == type('') if type(g:syntastic_perl_lib_path) == type('')
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list') call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
let includes = split(g:syntastic_perl_lib_path, ',') let includes = split(g:syntastic_perl_lib_path, ',')
@ -91,7 +85,8 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'perl', \ 'filetype': 'perl',
\ 'name': 'perl'}) \ 'name': 'perl',
\ 'enable': 'enable_perl_checker'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_perl_podchecker_checker')
endif endif
let g:loaded_syntastic_perl_podchecker_checker = 1 let g:loaded_syntastic_perl_podchecker_checker = 1
runtime! syntax_checkers/pod/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'perl', \ 'filetype': 'perl',
\ 'name': 'podchecker', \ 'name': 'podchecker',

@ -16,13 +16,14 @@ set cpo&vim
function! SyntaxCheckers_python_mypy_GetLocList() dict function! SyntaxCheckers_python_mypy_GetLocList() dict
let makeprg = self.makeprgBuild({}) let makeprg = self.makeprgBuild({})
let errorformat = '%f\, line %l: %m' let errorformat = '%f:%l:%m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': { 'type': 'E' }, \ 'defaults': { 'type': 'E' },
\ 'returns': [0, 1] }) \ 'returns': [0, 1],
\ 'preprocess': 'mypy' })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

@ -1,7 +1,7 @@
"============================================================================ "============================================================================
"File: pylint.vim "File: pylint.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
"Author: Parantapa Bhattacharya <parantapa at gmail dot com> "Maintainer: Parantapa Bhattacharya <parantapa at gmail dot com>
" "
"============================================================================ "============================================================================
@ -32,13 +32,14 @@ function! SyntaxCheckers_python_pylint_IsAvailable() dict
" On new-ish Fedora it's "python3-pylint 1.2.0". " On new-ish Fedora it's "python3-pylint 1.2.0".
" Have you guys considered switching to creative writing yet? ;) " Have you guys considered switching to creative writing yet? ;)
let pylint_version = filter( split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\m, \=\|\n'), let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
\ 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0] let pylint_version = filter( split(version_output, '\m, \=\|\n'), 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
let ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', '')) let parsed_ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
call self.setVersion(ver) call self.setVersion(parsed_ver)
let s:pylint_new = syntastic#util#versionIsAtLeast(ver, [1]) let s:pylint_new = syntastic#util#versionIsAtLeast(parsed_ver, [1])
catch /\m^Vim\%((\a\+)\)\=:E684/ catch /\m^Vim\%((\a\+)\)\=:E684/
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)") call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
let s:pylint_new = -1 let s:pylint_new = -1
endtry endtry

@ -0,0 +1,39 @@
"============================================================================
"File: qmllint.vim
"Description: Syntax checking plugin for syntastic.vim using qmllint
"Maintainer: Peter Wu <peter@lekensteyn.nl>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_qml_qmllint_checker')
finish
endif
let g:loaded_syntastic_qml_qmllint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_qml_qmllint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f:%l : %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['guards'],
\ 'returns': [0, 255] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'qml',
\ 'name': 'qmllint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -44,7 +44,6 @@ endfunction
function! SyntaxCheckers_r_lint_GetLocList() dict function! SyntaxCheckers_r_lint_GetLocList() dict
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : '' let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
let setwd = 'setwd("' . escape(getcwd(), '"\') . '"); '
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' . let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' . \ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' .
\ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') . \ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .

@ -0,0 +1,81 @@
"============================================================================
"File: lintr.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Jim Hester <james.f.hester at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"
" Security:
"
" This checker runs the code in your file. This is probably fine if you
" wrote the file yourself, but it can be a problem if you're trying to
" check third party files. If you are 100% willing to let Vim run the
" code in your file, set g:syntastic_enable_r_lintr_checker to 1 in
" your vimrc to enable this checker:
"
" let g:syntastic_enable_r_lintr_checker = 1
if exists("g:loaded_syntastic_r_lintr_checker")
finish
endif
let g:loaded_syntastic_r_lintr_checker = 1
if !exists('g:syntastic_r_lintr_linters')
let g:syntastic_r_lintr_linters = 'default_linters'
endif
if !exists('g:syntastic_r_lintr_cache')
let g:syntastic_r_lintr_cache = 'FALSE'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_r_lintr_GetHighlightRegex(item)
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
return term != '' ? '\V' . escape(term, '\') : ''
endfunction
function! SyntaxCheckers_r_lintr_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
call system(self.getExecEscaped() . ' --slave --no-restore --no-save -e ' . syntastic#util#shescape('library(lintr)'))
return v:shell_error == 0
endfunction
function! SyntaxCheckers_r_lintr_GetLocList() dict
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
let makeprg = self.getExecEscaped() . ' --slave --no-restore --no-save' .
\ ' -e ' . syntastic#util#shescape(setwd . 'suppressPackageStartupMessages(library(lintr)); ' .
\ 'lint(cache = ' . g:syntastic_r_lintr_cache . ', commandArgs(TRUE), ' . g:syntastic_r_lintr_linters . ')') .
\ ' --args ' . syntastic#util#shexpand('%')
let errorformat =
\ '%W%f:%l:%c: style: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%E%f:%l:%c: error: %m,'
call self.setWantSort(1)
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'r',
\ 'name': 'lintr',
\ 'exec': 'R',
\ 'enable': 'enable_r_lintr_checker'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -46,11 +46,6 @@ function! SyntaxCheckers_r_svtools_IsAvailable() dict
endfunction endfunction
function! SyntaxCheckers_r_svtools_GetLocList() dict function! SyntaxCheckers_r_svtools_GetLocList() dict
if !exists('g:syntastic_enable_r_svtools_checker') || !g:syntastic_enable_r_svtools_checker
call syntastic#log#error('checker r/svtools: checks disabled for security reasons; set g:syntastic_enable_r_svtools_checker to 1 to override')
return []
endif
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : '' let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' . let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' . \ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' .
@ -70,7 +65,8 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'r', \ 'filetype': 'r',
\ 'name': 'svtools', \ 'name': 'svtools',
\ 'exec': 'R' }) \ 'exec': 'R',
\ 'enable': 'enable_r_svtools_checker'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

@ -0,0 +1,23 @@
"============================================================================
"File: lintr.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Jim Hester <james.f.hester at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_rmd_lintr_checker')
finish
endif
let g:loaded_syntastic_rmd_lintr_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rmd',
\ 'name': 'lintr',
\ 'redirect': 'r/lintr'})
" vim: set sw=4 sts=4 et fdm=marker:

@ -29,9 +29,9 @@ function! SyntaxCheckers_rst_sphinx_GetLocList() dict
let srcdir = syntastic#util#var('rst_sphinx_source_dir') let srcdir = syntastic#util#var('rst_sphinx_source_dir')
call self.log('g:syntastic_rst_sphinx_source_dir =', srcdir) call self.log('g:syntastic_rst_sphinx_source_dir =', srcdir)
if srcdir == '' if srcdir ==# ''
let config = findfile('conf.py', escape(expand('%:p:h', 1), ' ') . ';') let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
if config == '' || !filereadable(config) if config ==# '' || !filereadable(config)
call self.log('conf.py file not found') call self.log('conf.py file not found')
return [] return []
endif endif
@ -40,9 +40,9 @@ function! SyntaxCheckers_rst_sphinx_GetLocList() dict
let confdir = syntastic#util#var('rst_sphinx_config_dir') let confdir = syntastic#util#var('rst_sphinx_config_dir')
call self.log('g:syntastic_rst_sphinx_config_dir =', confdir) call self.log('g:syntastic_rst_sphinx_config_dir =', confdir)
if confdir == '' if confdir ==# ''
let config = findfile('conf.py', escape(expand('%:p:h', 1), ' ') . ';') let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
let confdir = (config != '' && filereadable(config)) ? fnamemodify(config, ':p:h') : srcdir let confdir = (config !=# '' && filereadable(config)) ? fnamemodify(config, ':p:h') : srcdir
endif endif
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({

@ -0,0 +1,72 @@
"============================================================================
"File: flog.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Tim Carry <tim at pixelastic dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_ruby_flog_checker')
finish
endif
let g:loaded_syntastic_ruby_flog_checker = 1
if !exists('g:syntastic_ruby_flog_threshold_warning')
let g:syntastic_ruby_flog_threshold_warning = 45
endif
if !exists('g:syntastic_ruby_flog_threshold_error')
let g:syntastic_ruby_flog_threshold_error = 90
endif
if !exists('g:syntastic_ruby_flog_sort')
let g:syntastic_ruby_flog_sort = 1
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ruby_flog_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '-a' })
" Example output:
" 93.25: MyClass::my_method my_file:42
let errorformat = '%\m%\s%#%m: %.%# %f:%l'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
let trail_w = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_warning) . ')'
let trail_e = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_error) . ')'
for e in loclist
let score = syntastic#util#str2float(e['text'])
let e['text'] = 'Complexity is too high (' . syntastic#util#float2str(score) . '/'
if score < g:syntastic_ruby_flog_threshold_warning
let e['valid'] = 0
elseif score < g:syntastic_ruby_flog_threshold_error
let e['type'] = 'W'
let e['text'] .= trail_w
else
let e['type'] = 'E'
let e['text'] .= trail_e
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'flog'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -0,0 +1,22 @@
"============================================================================
"File: mixedindentlint.vim
"Description: Mixed indentation linter for vim
"Maintainer: Payton Swick <payton@foolord.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_scss_mixedindentlint_checker')
finish
endif
let g:loaded_syntastic_scss_mixedindentlint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss',
\ 'name': 'mixedindentlint',
\ 'redirect': 'javascript/mixedindentlint'})
" vim: set et sts=4 sw=4:

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_scss_sass_checker')
endif endif
let g:loaded_syntastic_scss_sass_checker = 1 let g:loaded_syntastic_scss_sass_checker = 1
runtime! syntax_checkers/sass/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss', \ 'filetype': 'scss',
\ 'name': 'sass', \ 'name': 'sass',

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_scss_sassc_checker')
endif endif
let g:loaded_syntastic_scss_sassc_checker = 1 let g:loaded_syntastic_scss_sassc_checker = 1
runtime! syntax_checkers/sass/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss', \ 'filetype': 'scss',
\ 'name': 'sassc', \ 'name': 'sassc',

@ -21,21 +21,28 @@ function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
if !executable(self.getExec()) if !executable(self.getExec())
return 0 return 0
endif endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12]) return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 29])
endfunction endfunction
function! SyntaxCheckers_scss_scss_lint_GetLocList() dict function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
let makeprg = self.makeprgBuild({}) let makeprg = self.makeprgBuild({ 'args_after': '-f JSON' })
let errorformat = '%f:%l [%t] %m' let errorformat = '%f:%t:%l:%c:%n:%m'
let loclist = SyntasticMake({ let loclist = SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'preprocess': 'scss_lint',
\ 'postprocess': ['guards'],
\ 'returns': [0, 1, 2, 65, 66] }) \ 'returns': [0, 1, 2, 65, 66] })
let cutoff = strlen('Syntax Error: ') let cutoff = strlen('Syntax Error: ')
for e in loclist for e in loclist
if e['nr'] > 1
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['col'] + e['nr']) . 'c'
endif
let e['nr'] = 0
if e['text'][: cutoff-1] ==# 'Syntax Error: ' if e['text'][: cutoff-1] ==# 'Syntax Error: '
let e['text'] = e['text'][cutoff :] let e['text'] = e['text'][cutoff :]
else else

@ -0,0 +1,23 @@
"============================================================================
"File: stylelint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_scss_stylelint_checker')
finish
endif
let g:loaded_syntastic_scss_stylelint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss',
\ 'name': 'stylelint',
\ 'redirect': 'css/stylelint'})
" vim: set sw=4 sts=4 et fdm=marker:

@ -0,0 +1,39 @@
"============================================================================
"File: slim_lint.vim
"Description: Slim style and syntax checker plugin for Syntastic
"Maintainer: Vasily Kolesnikov <re.vkolesnikov@gmail.com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_slim_slim_lint_checker')
finish
endif
let g:loaded_syntastic_slim_slim_lint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_slim_slim_lint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f:%l [%t] %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style'})
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'slim',
\ 'name': 'slim_lint',
\ 'exec': 'slim-lint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -0,0 +1,50 @@
"============================================================================
"File: sqlint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Steve Purcell <steve@sanityinc.com>
"License: MIT
"============================================================================
if exists('g:loaded_syntastic_sql_sqlint_checker')
finish
endif
let g:loaded_syntastic_sql_sqlint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_sql_sqlint_GetHighlightRegex(i)
let term = matchstr(a:i['text'], '\m at or near "\zs[^"]\+\ze"')
return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
endfunction
function! SyntaxCheckers_sql_sqlint_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 0, 3])
endfunction
function! SyntaxCheckers_sql_sqlint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat =
\ '%E%f:%l:%c:ERROR %m,' .
\ '%W%f:%l:%c:WARNING %m,' .
\ '%C %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sql',
\ 'name': 'sqlint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -0,0 +1,43 @@
"============================================================================
"File: stylint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_stylus_stylint_checker')
finish
endif
let g:loaded_syntastic_stylus_stylint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_stylus_stylint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat =
\ '%WWarning: %m,' .
\ '%EError: %m,' .
\ '%CFile: %f,' .
\ '%CLine: %l:%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'stylus',
\ 'name': 'stylint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_text_igor_checker')
endif endif
let g:loaded_syntastic_text_igor_checker = 1 let g:loaded_syntastic_text_igor_checker = 1
runtime! syntax_checkers/docbk/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'text', \ 'filetype': 'text',
\ 'name': 'igor', \ 'name': 'igor',

@ -0,0 +1,23 @@
"============================================================================
"File: eslint.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_typescript_eslint_checker')
finish
endif
let g:loaded_syntastic_typescript_eslint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'typescript',
\ 'name': 'eslint',
\ 'redirect': 'javascript/eslint'})
" vim: set sw=4 sts=4 et fdm=marker:

@ -2,6 +2,7 @@
"File: tsc.vim "File: tsc.vim
"Description: TypeScript syntax checker "Description: TypeScript syntax checker
"Maintainer: Bill Casarin <bill@casarin.ca> "Maintainer: Bill Casarin <bill@casarin.ca>
"
"============================================================================ "============================================================================
if exists('g:loaded_syntastic_typescript_tsc_checker') if exists('g:loaded_syntastic_typescript_tsc_checker')
@ -16,24 +17,28 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_typescript_tsc_GetLocList() dict function! SyntaxCheckers_typescript_tsc_IsAvailable() dict
if !exists('s:tsc_new') if !executable(self.getExec())
let s:tsc_new = -1 return 0
try endif
let tsc_version = filter(split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n'), 'v:val =~# ''\m\<Version ''')[0]
let ver = syntastic#util#parseVersion(tsc_version, '\v<Version \zs\d+(\.\d+)\ze') let version_output = split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n', 1)
call self.setVersion(ver) let ver = filter(copy(version_output), 'v:val =~# ''\m\<Version ''')
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0], '\v<Version \zs\d+(\.\d+)\ze') : []
let s:tsc_new = syntastic#util#versionIsAtLeast(ver, [1, 5]) if len(parsed_ver)
catch /\m^Vim\%((\a\+)\)\=:E684/ call self.setVersion(parsed_ver)
let s:tsc_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 5])
else
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)") call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
endtry let s:tsc_new = -1
endif endif
if s:tsc_new < 0 return s:tsc_new >= 0
return [] endfunction
endif
function! SyntaxCheckers_typescript_tsc_GetLocList() dict
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({
\ 'args': '--module commonjs', \ 'args': '--module commonjs',
\ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) }) \ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) })
@ -47,6 +52,7 @@ function! SyntaxCheckers_typescript_tsc_GetLocList() dict
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'postprocess': ['guards'],
\ 'defaults': {'bufnr': bufnr('')} }) \ 'defaults': {'bufnr': bufnr('')} })
endfunction endfunction

@ -22,9 +22,13 @@ function! SyntaxCheckers_typescript_tslint_GetHighlightRegex(item)
endfunction endfunction
function! SyntaxCheckers_typescript_tslint_GetLocList() dict function! SyntaxCheckers_typescript_tslint_GetLocList() dict
if !exists('s:tslint_new')
let s:tslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4])
endif
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({
\ 'args_after': '--format verbose', \ 'args_after': '--format verbose',
\ 'fname_before': '-f' }) \ 'fname_before': (s:tslint_new ? '' : '-f') })
" (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter " (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter
let errorformat = '%f[%l\, %c]: %m' let errorformat = '%f[%l\, %c]: %m'

@ -0,0 +1,38 @@
"============================================================================
"File: iverilog.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Psidium <psiidium at gmail dot com>
"License: The MIT License
"============================================================================
if exists('g:loaded_syntastic_verilog_iverilog_checker')
finish
endif
let g:loaded_syntastic_verilog_iverilog_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_verilog_iverilog_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_before': '-t null',
\ 'args': '-Wall' })
let errorformat =
\ '%f:%l: %trror: %m,' .
\ '%f:%l: %tarning: %m,' .
\ '%E%f:%l: : %m,' .
\ '%W%f:%l: : %m,' .
\ '%f:%l: %m'
return SyntasticMake({'makeprg': makeprg, 'errorformat': errorformat})
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'verilog',
\ 'name': 'iverilog'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -0,0 +1,55 @@
"============================================================================
"File: vcom.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Jim Vogel <jim dot e dot vogel at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_vhdl_vcom_checker')
finish
endif
let g:loaded_syntastic_vhdl_vcom_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_vhdl_vcom_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_before': '-lint' })
let errorformat =
\ '** %tRROR: %f(%l): %m,' .
\ '** %tRROR: %m,' .
\ '** %tARNING: %f(%l): %m,' .
\ '** %tARNING: %m,' .
\ '** %tOTE: %m,' .
\ '%tRROR: %f(%l): %m,' .
\ '%tARNING[%*[0-9]]: %f(%l): %m,' .
\ '%tRROR: %m,' .
\ '%tARNING[%*[0-9]]: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
for e in loclist
if e['type'] !=? 'E' && e['type'] !=? 'W'
let e['type'] = 'W'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vhdl',
\ 'name': 'vcom'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -74,6 +74,8 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1
endif endif
endif endif
call self.log('options =', param)
return vimlint#vimlint(expand('%', 1), param) return vimlint#vimlint(expand('%', 1), param)
endfunction " }}}1 endfunction " }}}1

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_xhtml_jshint_checker')
endif endif
let g:loaded_syntastic_xhtml_jshint_checker = 1 let g:loaded_syntastic_xhtml_jshint_checker = 1
runtime! syntax_checkers/html/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xhtml', \ 'filetype': 'xhtml',
\ 'name': 'jshint', \ 'name': 'jshint',

@ -0,0 +1,51 @@
"============================================================================
"File: basex.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: James Wright <james dot jw at hotmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
"
"============================================================================
if exists('g:loaded_syntastic_xquery_basex_checker')
finish
endif
let g:loaded_syntastic_xquery_basex_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_xquery_basex_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-z',
\ 'fname_before': '-q',
\ 'fname': syntastic#util#shescape('inspect:module("' . escape(expand('%:p', 1), '"') . '")') })
let errorformat =
\ '%f:%l:%c:%t:%n:%m,' .
\ '%m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'preprocess': 'basex' })
for e in loclist
if e['type'] !=# 'W' && e['type'] !=# 'E'
let e['type'] = 'E'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xquery',
\ 'name': 'basex'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_xslt_xmllint_checker')
endif endif
let g:loaded_syntastic_xslt_xmllint_checker = 1 let g:loaded_syntastic_xslt_xmllint_checker = 1
runtime! syntax_checkers/xml/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xslt', \ 'filetype': 'xslt',
\ 'name': 'xmllint', \ 'name': 'xmllint',

@ -28,6 +28,7 @@ function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict
let errorformat = let errorformat =
\ 'Error on line %l\, col %c:%m,' . \ 'Error on line %l\, col %c:%m,' .
\ 'JS-YAML: %m at line %l\, column %c:,' . \ 'JS-YAML: %m at line %l\, column %c:,' .
\ 'YAMLException: %m at line %l\, column %c:,' .
\ '%-G%.%#' \ '%-G%.%#'
return SyntasticMake({ return SyntasticMake({

@ -0,0 +1,52 @@
"============================================================================
"File: yamllint.vim
"Description: YAML files linting for syntastic.vim
"Maintainer: Adrien Vergé
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_yaml_yamllint_checker')
finish
endif
let g:loaded_syntastic_yaml_yamllint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_yaml_yamllint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-f parsable' })
let errorformat =
\ '%f:%l:%c: [%trror] %m,' .
\ '%f:%l:%c: [%tarning] %m'
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'env': env,
\ 'returns': [0, 1] })
for e in loclist
if e['type'] ==? 'W'
let e['subtype'] = 'Style'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'yaml',
\ 'name': 'yamllint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:
Loading…
Cancel
Save