Using the scala compiler instead of the interpreter to check the syntax
means that an error will not be raised if there is a package
decleration.
Also, stopping the compiler after the parser stage stops errors being
raised when importing from other files in your project.
The problem
---
Some people want to change the syntax checker args and/or executable.
Currently they have to create their own checker to do this.
Solution
---
Create a standard API for building a makeprg that allows users to set
global variables to override the exe or args.
This API is in use in the coffee and python/flake8 checkers - as
proofs of concept.
So, if the user wanted to change the args that get passed to `flake8`
they can now set `let g:syntastic_python_flake8_args="--foo --bar"` in
their vimrc. Similarly they could set `let
g:syntastic_python_flake8_exe='python foo.py'`
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`