In simple case it just miss warnings:
$ echo '$a=5;' | perl syntax_checkers/efm_perl.pl -c -w -
(nothing, while it should be this:)
W:-:1:Name "main::a" used only once: possible typo
In complex cases with some other errors it show crazy warnings
in crazy line numbers.
Use case when efm_perl run on STDIN can be found in issue#261.
If the shebang contains -T, then the makeprg looks like:
perl '/path/to/efm_perl.pl' -c -w '/tmp/foo.pl' -Tc
Mods to syntastic#util#ParseMagicNumber
* rename it to ParseShebang (since this name seems more common)
* return an empty result set rather than 0 so callers dont have to
check if empty()
That way, the files are properly treated as C/C++ even when they don't
have the standard file extension
Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
Previously we were only loading "official" checkers that had been added
to syntastic. Now we load any checker that is in the right directory.
This allows anyone to add custom checkers to any filetype that uses
`SyntasticLoadChecker()`
The advantage to this is that no 3rd party modules are required. People
new to Python probably won't have flake8/pyflakes/pylint installed. This
will get them basic syntax checking (no linting) out of the box.
Since we're only using ghc to check and lint the file and not actually create output, we can pass -fno-code which omits code generation and speeds up the check quite a bit.
* only check `executable()` for the sub checkers once - at the top of
the script
* recapitalize `s:getPHPMDErrors` to `s:GetPHPMDErrors` errors for
style consistency
* simplify the logic in `SyntaxCheckers_php_GetLocList`
If no syntax errors are found, `gofmt -l % 1>/dev/null` prints the file
name to STDOUT, which is redirected to /dev/null. Less to parse for
syntastic!
If errors are found, they are written to STDERR.
This invocation does not alter the source code, which has been indicated
in the comments.
Query RVM for the version of ruby that should be used to do the syntax
check.
This wont work if the user has different versions of ruby for different
directories (e.g. if they are using a project rvmrc) as it will only a
single ruby version per vim instance.
I think this should satisfy almost everyone though, so we can wait for
feedback before doing anything more hardcore.
The error message in 'puppet parser validate' changed between Puppet 2.x
and Puppet 3.0.0, preventing syntax errors from being caught.
In addition, the logic to apply --ignoreimport was falsely triggering on
3.0.0, because it was written assuming a major version of "2". The
--ignoreimport flag has been broken since 2.6.1, so I removed all of that
logic. In theory, it could be re-added for 2.6.0 and 0.2x.x, but the
version number checking didn't handle 0.2x.x, so I didn't reach back that
far.
If the line a ruby error occurs on is 'too long' it will truncate the line it
displays in the error output and wrap it in `...`. This breaks %p from finding
the correct column so this patch ignores lines starting with `...`
e.g. %p working
```
ruby -w -T1 -c broken.rb
broken.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end
puts sprintf "%d, %.2f, %.2f, %.2f, %d" k, v
^
```
%p not working
```
ruby -w -T1 -c broken.rb
broken.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end
...tf "%d, %.2f, %.2f, %.2f, %d" k, v[:cost], v[:val], v[:carri...
... ^
```
Sass partials depend on their parents files for context. This patch disables the
syntax checking for partials by default because of this. To enable checking of
partials let g:syntastic_sass_check_partials = 1. Fixes issue #300.
Using lessc to check a less file results in a NameError if the file references a
variable defined in a file that inherits it. This commit adds a new linter that
just calls the less parser instead. The variable g:syntastic_less_use_less_lint
should be set to use the linter over lessc.
The original fix for issue #7 used sed and didn't update the `executable` check
from cat to sed. This patch uses String.gsub when parsing an erb file instead,
as sed isn't neccesarily available.
The HTML5 <source> tag throws an error when using Tidy since exceptions
have been made for audio and video, we should also support the source
tag which can exist inside these calls.
slightly modified version of the C checker. I did a find/replace to make
it use "_objc_" instead of "_c_" . I also modified the errorformat to
look more like the cpp errorformat because I discovered that the entries
added to the C errorformat no longer seem to match anything.
The code to generate the makeprg was an epic jumble. Break it down into
separate methods.
Also, init several options at the top of the script and make some
executable() checks at the same time. This clears up some of the clutter
and means we only check it once - not on every syntax check.
999d3c1b added a filter on the errors list that checks for key/value
valid:1 in each element of the errors list. sh.vim doesn't use
SyntasticMake to check for errors so needs to add {valid:1} to each
result.
The current makeprg doesn't work with php-5.3. display_errors=0 has
disabled error outputting and error_log='' disables the error log. With
php-5.4 error_log='' is causing errors to be logged to stderr.
This patch disables the error_log and enables display_errors.
Theoretically errors are displayed on stdout, however php in mountain
lion seems to insist on outputting to stderr.
As we're now displaying errors rather than logging them to error format
has changed to no longer include 'PHP ' and I've removed duplicates.
This has been tested with PHP 5.3.13 with Suhosin-Patch (cli) (built: Jun 20
2012 17:05:20) (mountain lion) and PHP 5.4.4 (cli) (built: Jul 2 2012
16:33:50) Fedora 17
* move the doc for it to the top of the script to be consistent with
other syntax checkers
* dont define a s:checker var - just use the
g:syntastic_perl_efm_program variable. This simplifies things slightly
On systems where Ruby 1.8.7 is the default Ruby and users use
alternative suffixes (e.g., ruby19) or even rbenv or rvm Rubies, modern
Ruby syntax will be highlighted as an error.
The default behaviour in Syntastic is to run 'ruby' to check the syntax
of the script in question. This patch allows the user to specify a
different binary which may even be a full path. This should work on all
platforms.
let g:syntastic_ruby_exec = 'ruby19'
let g:syntastic_ruby_exec = '~/.rbenv/versions/1.9.2-p318/bin/ruby'
Move the coffeelint code out into its own function.
Init the coffeelint option once, at the top of the script. Change its
name so it begins with "syntastic_" - for namespacing purposes.
Previously we were using "medium verbosity" with `-W1`. The reason for
this is because using full verbosity caused some bogus repeated warnings
to appear in rspec files.
Enable full verbosity again and filter out the bogus warnings.
Closes#290