The output of flake8 is ambiguous as to whether results should be
interpreted as warnings or errors. I have changed it to assume errors to
match the python/pyflakes checker.
In future we may want to change this or add items to the errorformat for
some specific warnings if they are annoying.
This fixes#203.
setting it to E_PARSE causes some errors to be missed - e.g.
`$a[$b][] $c;`
will not cause an error to get reported as this is classed as a compile
error, not a parse error.
This should fix#206.
This is needed to handle compound filetypes since we cant imply the
location of the syntax checker file from the filetype.
e.g. we want to load `syntax_checkers/python/pylint.vim`, but the
filetype is `python.django`. Previously this was causing `runtime
syntax_checkers/python.django/pylint.vim` to be executed.
* move the existing ruby checker to syntax_checkers/ruby/mri.vim
* add a skeleton checker for jruby
* load mri by default but add an option to specify which ruby checker to
load
This is in response to #185
* remove the public SyntasticHighlightErrors() function
* shift the above code into s:HighlightErrors(). This is called
automatically if g:syntastic_enable_highlighting is set
* to get the highlight regex we just look for a function called
Syntastic_<filetype>_GetHighlightRegex
* to force this function to be called, each error item must have the
'force_highlight_callback' key set
This code has one important functional change: now errors are *always*
highlighted if possible whereas previously they were only highlighted if
a call to SyntasticHighlightErrors was made.
The error messages that pyflakes outputs dont contain enough information
to classify them as errors or warnings. Apart from checking for all
known warning outputs and classifying the rest as errors (or vice versa)
there is no way classify.
Make the syntax checker class all results as errors. Individual warning
formats can be checked for later if they become a problem.
This addresses #189.
dont refer to g:syntastic_python_checker since - due to a previous
commit - this is not guaranteed to exist any more.
This change should have been done in the aforementioned commit - but I
failed.
display_errors might be turned of for php globally. In this case the
output of php -l does not contain the errors messages. Using this option
will turn the option on for the single call.
The parameter `g:syntastic_python_checker_args` can be used to pass additional
arguments to the Python syntax checker. Example configuration:
let g:syntastic_python_checker = "flake8"
let g:syntastic_python_checker_args = "--ignore=E501 --max-complexity=10"
Replace the color codes these regexes: /.\{-}/
This is needed for portability since, when using tmux, the output is not
colorized. Also, Im not sure that different terminals will
use the same codes for the colors - but Im no expert.
previously we assumed the user had efm_perl.pl installed as part of the
standard vim runtime, but this isnt so for CentOS and possibly for other
distros - see issue #159. Therefore, we now ship it with syntastic
itself.
Note: efm_perl.pl just munges the output of perl into a different
format. It may be worth investigating further and writing our own
errorformat to remove the dependency on efm_perl.
Javascript and json have multiple syntax checkers that can be loaded.
Previously the logic to determine which checker to load was basically
copied and pasted in both. The `go` checker will soon have more
than one option too so remove the duplication by sticking the
common code in the core.
running phpcs on a file which contains a parse error generates a huge
number of warnings from the phpcs library. This can freeze vim for
minutes at a time while it attempts to parse these
notices/warnings/errors.
Therefore - don't run phpcs on files which have parse errors.
* remove some unneeded escaping of spaces and colons from the 1.2
errorformat
* split the pre and post 1.2 errorformats up and comment them for future
clarity
Remove the g:syntastic_nvcc_binary option as this should be in the users
path - or at least symlinked in. Also, the logic was broken in that the
script was hardcoded to only accept '/usr/local/cuda/bin/nvcc' as the
binary anyway.
Enabled with 'let g:syntastic_ocaml_use_ocamlbuild = 1' in .vimrc,
also creates .annot files for <Leader>t.
Not enabled by default because it writes to disk (_build dir).
quotes with shellescape(). cmd.exe on win32/64 does not recognize
single quotes properly. shellescape() correctly wraps arguments with
spaces using double quotes on win32/64.
Move the locaml->lcaml alias function out of the ocaml checker as this
code wont be loaded for locaml files - only syntax checkers for filetype
that are in use get sourced
Only cache the imports when the syntax checker is first loaded. Also,
there was a bug in the logic that was causing the imports to be set to
"" on the second run.
Make the imports var script local since we are not allowing users to
change it.
The jslint guys have changed their error format again. Update the syntax
checker to handle it.
Currently jslint outputs a "use strict" error if a function doesnt have
'use strict' at the top. This is not good for our purposes, so just
filter this out for now.
The js syntax checker was 4 checkers stuffed into 1 file. Now it is
broken down so that each checker is in its own file inside
syntax_checkers/javascript/ while syntax_checkers/javascript.vim just
determines which file to source.
Change the names of the global js checker config variables so that
they all start with "syntastic_javascript_". This is purely for
namespacing.
Remove some unneeded logic around the config variables too. Not sure how
it got in there, but it was more confusing than helpful without offering
any benefits...
I installed the latest version of lessc and they have modified their
output slightly. Update the errorformat for this.
Also, they new output is colorized by default. So I have added an option
to specify args to the checker that currently defaults to "--no-color".
This means that if people want to use an older version of lessc, they
will need to reset this option to an empty string.
Many of the syntax checkers were setting the 'bufnr' key for each
error manually and one was setting 'text' if it didnt exist too.
Add the 'defaults' option to SyntasticMake to set default values in the
returned error list - it only sets values if they are empty.
PHPCS has a wide variety of commandline flags, including
support for various syntaxes. These must be configurable,
otherwise phpcs generates a high number of spurious errors for
code written to any standard other than the PEAR standard.
Previously, if we edited a new bash script then we would have to wipeout
the buffer and recreate it to get syntastic to recognise it as a bash
script. This is because it parsed out a magic number and cached that -
and it trivially fails to find a magic number when you create a new
file.
So recheck for a magic number if it is currently empty.
Also, do a small refactor.
This was missing errors like this:
/tmp/foo.js:1:(-002) Error parsing file at token ")". Unable to check the rest of file.
The reason is because of the minus sign in front of the 002. It is using
%m to match that, which appears to only match positive numbers - so just
ignore the minus sign.
This is in response to #88 where errors like this were getting missed:
SyntaxError: In simpleMapComponent.js.coffee, Reserved word "function" on line 10
at SyntaxError (unknown source)
at Lexer.identifierError (/usr/lib/node_modules/coffee-script/lib/lexer.js:458:13)
at Lexer.identifierToken (/usr/lib/node_modules/coffee-script/lib/lexer.js:80:16)
at Lexer.tokenize (/usr/lib/node_modules/coffee-script/lib/lexer.js:31:19)
at Object.compile (/usr/lib/node_modules/coffee-script/lib/coffee-script.js:29:34)
at /usr/lib/node_modules/coffee-script/lib/command.js:149:33
at /usr/lib/node_modules/coffee-script/lib/command.js:115:26
at [object Object].<anonymous> (fs.js:107:5)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
To fix this I have added another error matcher on the front of the
errorformat and have made a fix to the %-G matcher on the end (i.e. it
wasnt actually matching anything before).
The errorformat may need more updating.
We dont need to manually hack the bufnr for each entry in the loc list
since that the error output includes a file name.
Ignore the last line of the error message since it seems to always just
be "use --trace for a backtrace"
Add the g:syntastic_javascript_checker option so the user can specify
which javascript syntax checker to use. If none is specified then just
use the first syntax checker we find installed.
Define a user-configurable variable g:syntastic_python_checker and
otherwise default to an available checker.
Make the highlighting catch all pyflakes errors
Add a header to the file
Make the errorformat handle columns provided by pep8 through flake8
The previous implementation was crashing the make vim utility, after
saving it was required to use :redraw! in order to keep using the editor.
After a lot of investigation, I realized that the use of && in commands is not
of the like to the :make vim utility.
The use of the && command was updated with "{ commad1; command2 }" approach,
this way we got the result we wanted without any obnoxious side effect.
The current implementation only supports puppet < 2.6, when using
2.7.x it will complain all the time saying that the executable to check
syntax has changed. With this patch, it will work for version <= 2.7.x
some ruby warnings were getting output when "haml -c" was run - these
were not getting handled by the syntax checker
use SyntasticMake instead of custom hax0r to parse the errors - this way
it is trivial to ignore all output that we dont care about
Previously ghc was being used, but this was not good because
ghc would work only on individual files. As soon you included
an external module also developed on the current project, ghc would
barf at you saying that the module couldn't be found. ghc-mod
doesn't check dependencies, just syntax, also it has the lint
utility that is pretty handy.
Added a more specific c syntax checker errorformat before the more
general ones so the jumping is not broken by assuming the line number is
a part of the file.
Signed-off-by: kongo2002 <kongo2002@googlemail.com>