Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Braid: Update mirror '_vim/bundle/syntastic' to 'cb62052'

  • Loading branch information...
commit 5306e85e4efbfd5160037033514295550d02d0ae 1 parent d27ca14
Richard Clamp authored
4 .braids
@@ -134,8 +134,8 @@ _vim/bundle/surround:
134 134 url: git://github.com/tpope/vim-surround.git
135 135 _vim/bundle/syntastic:
136 136 branch: master
137   - remote: braid/-vim/bundle/syntastic
138   - revision: ad1481c2ce7c1859f4d3ca877b5759c5d5689e0c
  137 + remote: master/braid/-vim/bundle/syntastic
  138 + revision: cb6205254eb3f9a236c7619344396317b8e12d33
139 139 squashed: true
140 140 type: git
141 141 url: git://github.com/scrooloose/syntastic.git
2  _vim/bundle/syntastic/autoload/syntastic/c.vim
@@ -145,7 +145,7 @@ function! syntastic#c#CheckPython()
145 145 if executable('python')
146 146 if !exists('s:python_flags')
147 147 let s:python_flags = system('python -c ''from distutils import '
148   - \ . 'sysconfig; print sysconfig.get_python_inc()''')
  148 + \ . 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''')
149 149 let s:python_flags = substitute(s:python_flags, "\n", '', '')
150 150 let s:python_flags = ' -I' . s:python_flags
151 151 endif
44 _vim/bundle/syntastic/doc/syntastic.txt
@@ -203,6 +203,14 @@ detected, but not opened automatically. >
203 203 let g:syntastic_auto_loc_list=2
204 204 <
205 205
  206 + *'syntastic_loc_list_height'*
  207 +Default: 10
  208 +Use this option to specify the height of the location lists that syntastic
  209 +opens. >
  210 + let g:syntastic_loc_list_height=5
  211 +<
  212 +
  213 +
206 214 *'syntastic_mode_map'*
207 215 Default: { "mode": "active",
208 216 "active_filetypes": [],
@@ -348,8 +356,32 @@ The latest dev versions are on github
348 356 7. Changelog *syntastic-changelog*
349 357
350 358 next
351   - - Support for new filetypes:
  359 + - Add syntastic_loc_list_height option
  360 + - Allow errors to have a "subtype" that is signed differently to standard
  361 + errors. Currently geared towards differentiating style errors from
  362 + syntax errors. Currently implemented for phpcs (technosophos).
  363 + - New checkers for:
352 364 - yaml
  365 + - haxe (davidB)
  366 + - ocaml (edwintorok)
  367 + - pylint (parantapa)
  368 +
  369 + - Updates to existing checkers:
  370 + - jslint
  371 + - fortran (bmattern)
  372 + - sass
  373 + - html (darcyparker)
  374 + - coffee (darcyparker)
  375 + - docbk (darcyparker)
  376 + - xml
  377 + - xslt
  378 + - less (irrationalfab)
  379 + - php (AD7six, technosophos)
  380 + - cuda
  381 + - python (mitchellh)
  382 + - perl (Anthony Carapetis)
  383 + - c (naoina, zsprackett)
  384 + - puppet
353 385
354 386 2.2.0
355 387 - only do syntax checks when files are saved (not when first opened) - add
@@ -463,6 +495,16 @@ next
463 495 Thanks to the following people for testing, bug reports, patches etc. They own,
464 496 hard.
465 497
  498 + Naoya INADA (naoina)
  499 + Mitchell Hashimoto (mitchellh)
  500 + irrationalfab
  501 + Andy Dawson (AD7six)
  502 + Parantapa Bhattacharya (parantapa)
  503 + edwintorok
  504 + Darcy Parker (darcyparker)
  505 + bmattern
  506 + David Bernard (davidB)
  507 + Aleksey V. Zapparov (ixti)
466 508 Benji Fisher (benjifisher)
467 509 Lance Fetters (ashikase)
468 510 datanoise
64 _vim/bundle/syntastic/plugin/syntastic.vim
@@ -81,6 +81,10 @@ if !exists("g:syntastic_check_on_open")
81 81 let g:syntastic_check_on_open = 0
82 82 endif
83 83
  84 +if !exists("g:syntastic_loc_list_height")
  85 + let g:syntastic_loc_list_height = 10
  86 +endif
  87 +
84 88 command! SyntasticToggleMode call s:ToggleMode()
85 89 command! SyntasticCheck call s:UpdateErrors(0) <bar> redraw!
86 90 command! Errors call s:ShowLocList()
@@ -264,9 +268,11 @@ function! s:FilterLocList(filters, ...)
264 268 endfunction
265 269
266 270 if g:syntastic_enable_signs
267   - "use >> to display syntax errors in the sign column
  271 + "define the signs used to display syntax and style errors/warns
268 272 sign define SyntasticError text=>> texthl=error
269 273 sign define SyntasticWarning text=>> texthl=todo
  274 + sign define SyntasticStyleError text=S> texthl=error
  275 + sign define SyntasticStyleWarning text=S> texthl=todo
270 276 endif
271 277
272 278 "start counting sign ids at 5000, start here to hopefully avoid conflicting
@@ -281,10 +287,15 @@ function! s:SignErrors()
281 287
282 288 let errors = s:FilterLocList({'bufnr': bufnr('')})
283 289 for i in errors
284   - let sign_type = 'SyntasticError'
285   - if i['type'] ==? 'W'
286   - let sign_type = 'SyntasticWarning'
  290 + let sign_severity = 'Error'
  291 + let sign_subtype = ''
  292 + if has_key(i,'subtype')
  293 + let sign_subtype = i['subtype']
  294 + endif
  295 + if i['type'] ==? 'w'
  296 + let sign_severity = 'Warning'
287 297 endif
  298 + let sign_type = 'Syntastic' . sign_subtype . sign_severity
288 299
289 300 if !s:WarningMasksError(i, errors)
290 301 exec "sign place ". s:next_sign_id ." line=". i['lnum'] ." name=". sign_type ." file=". expand("%:p")
@@ -333,7 +344,7 @@ endfunction
333 344 function! s:ShowLocList()
334 345 if !empty(s:LocList())
335 346 let num = winnr()
336   - lopen
  347 + exec "lopen " . g:syntastic_loc_list_height
337 348 if num != winnr()
338 349 wincmd p
339 350 endif
@@ -413,6 +424,12 @@ function! s:EchoCurrentError()
413 424 endif
414 425 endfunction
415 426
  427 +"load the chosen checker for the current filetype - useful for filetypes like
  428 +"javascript that have more than one syntax checker
  429 +function! s:LoadChecker(checker)
  430 + exec "runtime syntax_checkers/" . &ft . "/" . a:checker . ".vim"
  431 +endfunction
  432 +
416 433 "return a string representing the state of buffer according to
417 434 "g:syntastic_stl_format
418 435 "
@@ -466,6 +483,7 @@ endfunction
466 483 "
467 484 "a:options may also contain:
468 485 " 'defaults' - a dict containing default values for the returned errors
  486 +" 'subtype' - all errors will be assigned the given subtype
469 487 function! SyntasticMake(options)
470 488 let old_loclist = getloclist(0)
471 489 let old_makeprg = &makeprg
@@ -505,6 +523,11 @@ function! SyntasticMake(options)
505 523 call SyntasticAddToErrors(errors, a:options['defaults'])
506 524 endif
507 525
  526 + " Add subtype info if present.
  527 + if has_key(a:options, 'subtype')
  528 + call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']})
  529 + endif
  530 +
508 531 return errors
509 532 endfunction
510 533
@@ -551,7 +574,7 @@ endfunction
551 574 function! SyntasticAddToErrors(errors, options)
552 575 for i in range(0, len(a:errors)-1)
553 576 for key in keys(a:options)
554   - if empty(a:errors[i][key])
  577 + if !has_key(a:errors[i], key) || empty(a:errors[i][key])
555 578 let a:errors[i][key] = a:options[key]
556 579 endif
557 580 endfor
@@ -559,4 +582,33 @@ function! SyntasticAddToErrors(errors, options)
559 582 return a:errors
560 583 endfunction
561 584
  585 +"take a list of syntax checkers for the current filetype and load the right
  586 +"one based on the global settings and checker executable availabity
  587 +"
  588 +"a:checkers should be a list of syntax checker names. These names are assumed
  589 +"to be the names of the vim syntax checker files that should be sourced, as
  590 +"well as the names of the actual syntax checker executables. The checkers
  591 +"should be listed in order of default preference.
  592 +"
  593 +"if a option called 'g:syntastic_[filetype]_checker' exists then attempt to
  594 +"load the checker that it points to
  595 +function! SyntasticLoadChecker(checkers)
  596 + let opt_name = "g:syntastic_" . &ft . "_checker"
  597 +
  598 + if exists(opt_name)
  599 + let opt_val = {opt_name}
  600 + if index(a:checkers, opt_val) != -1 && executable(opt_val)
  601 + call s:LoadChecker(opt_val)
  602 + else
  603 + echoerr &ft . " syntax not supported or not installed."
  604 + endif
  605 + else
  606 + for checker in a:checkers
  607 + if executable(checker)
  608 + return s:LoadChecker(checker)
  609 + endif
  610 + endfor
  611 + endif
  612 +endfunction
  613 +
562 614 " vim: set et sts=4 sw=4:
153 _vim/bundle/syntastic/syntax_checkers/efm_perl.pl
... ... @@ -0,0 +1,153 @@
  1 +#!/usr/bin/perl -w
  2 +
  3 +# vimparse.pl - Reformats the error messages of the Perl interpreter for use
  4 +# with the quickfix mode of Vim
  5 +#
  6 +# Copyright (�) 2001 by J�rg Ziefle <joerg.ziefle@gmx.de>
  7 +# You may use and distribute this software under the same terms as Perl itself.
  8 +#
  9 +# Usage: put one of the two configurations below in your ~/.vimrc (without the
  10 +# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl
  11 +# before):
  12 +#
  13 +# Program is run interactively with 'perl -w':
  14 +#
  15 +# set makeprg=$HOME/bin/vimparse.pl\ %\ $*
  16 +# set errorformat=%f:%l:%m
  17 +#
  18 +# Program is only compiled with 'perl -wc':
  19 +#
  20 +# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
  21 +# set errorformat=%f:%l:%m
  22 +#
  23 +# Usage:
  24 +# vimparse.pl [-c] [-f <errorfile>] <programfile> [programargs]
  25 +#
  26 +# -c compile only, don't run (perl -wc)
  27 +# -f write errors to <errorfile>
  28 +#
  29 +# Example usages:
  30 +# * From the command line:
  31 +# vimparse.pl program.pl
  32 +#
  33 +# vimparse.pl -c -f errorfile program.pl
  34 +# Then run vim -q errorfile to edit the errors with Vim.
  35 +#
  36 +# * From Vim:
  37 +# Edit in Vim (and save, if you don't have autowrite on), then
  38 +# type ':mak' or ':mak args' (args being the program arguments)
  39 +# to error check.
  40 +#
  41 +# Version history:
  42 +# 0.2 (04/12/2001):
  43 +# * First public version (sent to Bram)
  44 +# * -c command line option for compiling only
  45 +# * grammatical fix: 'There was 1 error.'
  46 +# * bug fix for multiple arguments
  47 +# * more error checks
  48 +# * documentation (top of file, &usage)
  49 +# * minor code clean ups
  50 +# 0.1 (02/02/2001):
  51 +# * Initial version
  52 +# * Basic functionality
  53 +#
  54 +# Todo:
  55 +# * test on more systems
  56 +# * use portable way to determine the location of perl ('use Config')
  57 +# * include option that shows perldiag messages for each error
  58 +# * allow to pass in program by STDIN
  59 +# * more intuitive behaviour if no error is found (show message)
  60 +#
  61 +# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for
  62 +# you.
  63 +
  64 +use strict;
  65 +use Getopt::Std;
  66 +
  67 +use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
  68 +
  69 +use constant VERSION => 0.2;
  70 +
  71 +getopts('cf:h');
  72 +
  73 +&usage if $opt_h; # not necessarily needed, but good for further extension
  74 +
  75 +if (defined $opt_f) {
  76 +
  77 + open FILE, "> $opt_f" or do {
  78 + warn "Couldn't open $opt_f: $!. Using STDOUT instead.\n";
  79 + undef $opt_f;
  80 + };
  81 +
  82 +};
  83 +
  84 +my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
  85 +
  86 +(my $file = shift) or &usage; # display usage if no filename is supplied
  87 +my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
  88 +
  89 +my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`;
  90 +
  91 +my $errors = 0;
  92 +foreach my $line (@lines) {
  93 +
  94 + chomp($line);
  95 + my ($file, $lineno, $message, $rest);
  96 +
  97 + if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) {
  98 +
  99 + ($message, $file, $lineno, $rest) = ($1, $2, $3, $4);
  100 + $errors++;
  101 + $message .= $rest if ($rest =~ s/^,//);
  102 + print $handle "$file:$lineno:$message\n";
  103 +
  104 + } else { next };
  105 +
  106 +}
  107 +
  108 +if (defined $opt_f) {
  109 +
  110 + my $msg;
  111 + if ($errors == 1) {
  112 +
  113 + $msg = "There was 1 error.\n";
  114 +
  115 + } else {
  116 +
  117 + $msg = "There were $errors errors.\n";
  118 +
  119 + };
  120 +
  121 + print STDOUT $msg;
  122 + close FILE;
  123 + unlink $opt_f unless $errors;
  124 +
  125 +};
  126 +
  127 +sub usage {
  128 +
  129 + (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
  130 + print<<EOT;
  131 +Usage:
  132 + $0 [-c] [-f <errorfile>] <programfile> [programargs]
  133 +
  134 + -c compile only, don't run (executes 'perl -wc')
  135 + -f write errors to <errorfile>
  136 +
  137 +Examples:
  138 + * At the command line:
  139 + $0 program.pl
  140 + Displays output on STDOUT.
  141 +
  142 + $0 -c -f errorfile program.pl
  143 + Then run 'vim -q errorfile' to edit the errors with Vim.
  144 +
  145 + * In Vim:
  146 + Edit in Vim (and save, if you don't have autowrite on), then
  147 + type ':mak' or ':mak args' (args being the program arguments)
  148 + to error check.
  149 +EOT
  150 +
  151 + exit 0;
  152 +
  153 +};
21 _vim/bundle/syntastic/syntax_checkers/go.vim
... ... @@ -1,27 +1,22 @@
1 1 "============================================================================
2 2 "File: go.vim
3   -"Description: Syntax checking plugin for syntastic.vim
4   -"Maintainer: Sam Nguyen <samxnguyen@gmail.com>
  3 +"Description: Loads a go syntax checker from the go directory
  4 +"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
5 5 "License: This program is free software. It comes without any warranty,
6 6 " to the extent permitted by applicable law. You can redistribute
7 7 " it and/or modify it under the terms of the Do What The Fuck You
8 8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
10 10 "
  11 +" Use g:syntastic_go_checker option to specify which go executable
  12 +" should be used (see below for a list of supported checkers).
  13 +" If g:syntastic_go_checker is not set, just use the first syntax
  14 +" checker that we find installed.
11 15 "============================================================================
12 16 if exists("loaded_go_syntax_checker")
13 17 finish
14 18 endif
15 19 let loaded_go_syntax_checker = 1
16 20
17   -"bail if the user doesnt have 6g installed
18   -if !executable("6g")
19   - finish
20   -endif
21   -
22   -function! SyntaxCheckers_go_GetLocList()
23   - let makeprg = '6g -o /dev/null %'
24   - let errorformat = '%E%f:%l: %m'
25   -
26   - return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
27   -endfunction
  21 +let s:supported_checkers = ["6g", "gofmt"]
  22 +call SyntasticLoadChecker(s:supported_checkers)
17 _vim/bundle/syntastic/syntax_checkers/go/6g.vim
... ... @@ -0,0 +1,17 @@
  1 +"============================================================================
  2 +"File: 6g.vim
  3 +"Description: Syntax checking plugin for syntastic.vim
  4 +"Maintainer: Sam Nguyen <samxnguyen@gmail.com>
  5 +"License: This program is free software. It comes without any warranty,
  6 +" to the extent permitted by applicable law. You can redistribute
  7 +" it and/or modify it under the terms of the Do What The Fuck You
  8 +" Want To Public License, Version 2, as published by Sam Hocevar.
  9 +" See http://sam.zoy.org/wtfpl/COPYING for more details.
  10 +"
  11 +"============================================================================
  12 +function! SyntaxCheckers_go_GetLocList()
  13 + let makeprg = '6g -o /dev/null %'
  14 + let errorformat = '%E%f:%l: %m'
  15 +
  16 + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
  17 +endfunction
16 _vim/bundle/syntastic/syntax_checkers/go/gofmt.vim
... ... @@ -0,0 +1,16 @@
  1 +"============================================================================
  2 +"File: gofmt.vim
  3 +"Description: Check go syntax using gofmt
  4 +"Maintainer: Brandon Thomson <bt@brandonthomson.com>
  5 +"License: This program is free software. It comes without any warranty,
  6 +" to the extent permitted by applicable law. You can redistribute
  7 +" it and/or modify it under the terms of the Do What The Fuck You
  8 +" Want To Public License, Version 2, as published by Sam Hocevar.
  9 +" See http://sam.zoy.org/wtfpl/COPYING for more details.
  10 +"
  11 +"============================================================================
  12 +function! SyntaxCheckers_go_GetLocList()
  13 + let makeprg = 'gofmt %'
  14 + let errorformat = '%f:%l:%c: %m,%-G%.%#'
  15 + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
  16 +endfunction
0  _vim/bundle/syntastic/syntax_checkers/haxe.vim 100755 → 100644
File mode changed
20 _vim/bundle/syntastic/syntax_checkers/javascript.vim
@@ -20,22 +20,4 @@ endif
20 20 let loaded_javascript_syntax_checker = 1
21 21
22 22 let s:supported_checkers = ["gjslint", "jslint", "jsl", "jshint"]
23   -
24   -function! s:load_checker(checker)
25   - exec "runtime syntax_checkers/javascript/" . a:checker . ".vim"
26   -endfunction
27   -
28   -if exists("g:syntastic_javascript_checker")
29   - if index(s:supported_checkers, g:syntastic_javascript_checker) != -1 && executable(g:syntastic_javascript_checker)
30   - call s:load_checker(g:syntastic_javascript_checker)
31   - else
32   - echoerr "Javascript syntax not supported or not installed."
33   - endif
34   -else
35   - for checker in s:supported_checkers
36   - if executable(checker)
37   - call s:load_checker(checker)
38   - break
39   - endif
40   - endfor
41   -endif
  23 +call SyntasticLoadChecker(s:supported_checkers)
2  _vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim
@@ -14,7 +14,7 @@ endif
14 14
15 15 function! SyntaxCheckers_javascript_GetLocList()
16 16 " node-jshint uses .jshintrc as config unless --config arg is present
17   - let args = g:syntastic_javascript_jshint_conf? ' --config ' . g:syntastic_javascript_jshint_conf : ''
  17 + let args = !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : ''
18 18 let makeprg = 'jshint ' . shellescape(expand("%")) . args
19 19 let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#'
20 20 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
20 _vim/bundle/syntastic/syntax_checkers/json.vim
@@ -20,22 +20,4 @@ endif
20 20 let loaded_json_syntax_checker = 1
21 21
22 22 let s:supported_checkers = ["jsonlint", "jsonval"]
23   -
24   -function! s:load_checker(checker)
25   - exec "runtime syntax_checkers/json/" . a:checker . ".vim"
26   -endfunction
27   -
28   -if exists("g:syntastic_json_checker")
29   - if index(s:supported_checkers, g:syntastic_json_checker) != -1 && executable(g:syntastic_json_checker)
30   - call s:load_checker(g:syntastic_json_checker)
31   - else
32   - echoerr "JSON syntax not supported or not installed."
33   - endif
34   -else
35   - for checker in s:supported_checkers
36   - if executable(checker)
37   - call s:load_checker(checker)
38   - break
39   - endif
40   - endfor
41   -endif
  23 +call SyntasticLoadChecker(s:supported_checkers)
11 _vim/bundle/syntastic/syntax_checkers/perl.vim
@@ -9,10 +9,6 @@
9 9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
10 10 "
11 11 "============================================================================
12   -
13   -" This checker requires efm_perl.pl, which is distributed with Vim version
14   -" seven and greater, as far as I know.
15   -
16 12 if exists("loaded_perl_syntax_checker")
17 13 finish
18 14 endif
@@ -23,13 +19,10 @@ if !executable("perl")
23 19 finish
24 20 endif
25 21
26   -
27   -if !exists("g:syntastic_perl_efm_program")
28   - let g:syntastic_perl_efm_program = 'perl '. shellescape($VIMRUNTIME.'/tools/efm_perl.pl').' -c'
29   -endif
  22 +let s:checker = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c'
30 23
31 24 function! SyntaxCheckers_perl_GetLocList()
32   - let makeprg = g:syntastic_perl_efm_program . ' ' . shellescape(expand('%'))
  25 + let makeprg = s:checker . ' ' . shellescape(expand('%'))
33 26 let errorformat = '%f:%l:%m'
34 27
35 28 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
2  _vim/bundle/syntastic/syntax_checkers/php.vim
@@ -54,5 +54,5 @@ endfunction
54 54 function! s:GetPHPCSErrors()
55 55 let makeprg = "phpcs " . g:syntastic_phpcs_conf . " --report=csv ".shellescape(expand('%'))
56 56 let errorformat = '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
57   - return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
  57 + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' })
58 58 endfunction
35 _vim/bundle/syntastic/syntax_checkers/puppet.vim
@@ -19,20 +19,35 @@ if !executable("puppet")
19 19 finish
20 20 endif
21 21
  22 +function! s:ExtractVersion()
  23 + let output = system("puppet --version")
  24 + let output = substitute(output, '\n$', '', '')
  25 + return split(output, '\.')
  26 +endfunction
  27 +
  28 +let s:puppetVersion = s:ExtractVersion()
  29 +
22 30 function! SyntaxCheckers_puppet_GetLocList()
23   - let l:puppetVersion = system("puppet --version")
24   - let l:digits = split(l:puppetVersion, "\\.")
25   - "
26   - " If it is on the 2.7 series... use new executable
27   - if l:digits[0] == '2' && l:digits[1] == '7'
28   - let makeprg = 'puppet parser validate ' .
29   - \ shellescape(expand('%')) .
30   - \ ' --color=false --ignoreimport'
  31 + "If puppet is >= version 2.7 then use the new executable
  32 + if s:puppetVersion[0] >= '2' && s:puppetVersion[1] >= '7'
  33 + let makeprg = 'puppet parser validate ' .
  34 + \ shellescape(expand('%')) .
  35 + \ ' --color=false'
  36 +
  37 + "add --ignoreimport for versions < 2.7.10
  38 + if s:puppetVersion[2] < '10'
  39 + let makeprg .= ' --ignoreimport'
  40 + endif
  41 +
31 42 else
32   - let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%'))
  43 + let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%'))
33 44 endif
34 45
35   - let errorformat = 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
  46 + "some versions of puppet (e.g. 2.7.10) output the message below if there
  47 + "are any syntax errors
  48 + let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
  49 +
  50 + let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
36 51
37 52 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
38 53 endfunction
5 _vim/bundle/syntastic/syntax_checkers/python.vim
@@ -31,6 +31,9 @@ if !exists('g:syntastic_python_checker') || !executable(g:syntastic_python_check
31 31 finish
32 32 endif
33 33 endif
  34 +if !exists('g:syntastic_python_checker_args')
  35 + let g:syntastic_python_checker_args = ''
  36 +endif
34 37
35 38 function! SyntaxCheckers_python_Term(i)
36 39 if a:i['type'] ==# 'E'
@@ -64,7 +67,7 @@ if g:syntastic_python_checker == 'pylint'
64 67 endfunction
65 68 else
66 69 function! SyntaxCheckers_python_GetLocList()
67   - let makeprg = g:syntastic_python_checker.' '.shellescape(expand('%'))
  70 + let makeprg = g:syntastic_python_checker.' '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
68 71 let errorformat =
69 72 \ '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
70 73
33 _vim/bundle/syntastic/syntax_checkers/rust.vim
... ... @@ -0,0 +1,33 @@
  1 +"============================================================================
  2 +"File: rust.vim
  3 +"Description: Syntax checking plugin for syntastic.vim
  4 +"Maintainer: Chad Jablonski <chad.jablonski at gmail dot com>
  5 +"License: This program is free software. It comes without any warranty,
  6 +" to the extent permitted by applicable law. You can redistribute
  7 +" it and/or modify it under the terms of the Do What The Fuck You
  8 +" Want To Public License, Version 2, as published by Sam Hocevar.
  9 +" See http://sam.zoy.org/wtfpl/COPYING for more details.
  10 +"
  11 +"============================================================================
  12 +if exists("loaded_rust_syntax_checker")
  13 + finish
  14 +endif
  15 +let loaded_rust_syntax_checker = 1
  16 +
  17 +"bail if the user doesnt have rustc installed
  18 +if !executable("rustc")
  19 + finish
  20 +endif
  21 +
  22 +function! SyntaxCheckers_rust_GetLocList()
  23 + let makeprg = 'rustc --parse-only '.shellescape(expand('%'))
  24 +
  25 + let errorformat = '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,' .
  26 + \ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' .
  27 + \ '%C%f:%l %m,' .
  28 + \ '%-Z%.%#'
  29 +
  30 + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
  31 +endfunction
  32 +
  33 +

0 comments on commit 5306e85

Please sign in to comment.
Something went wrong with that request. Please try again.