Commit Graph

20 Commits

Author SHA1 Message Date
LCD 47
3694908d05 Registry cleanup, stage 2.
(1) Checkers now have an _exec attribute, and an accessor getExec().
(2) CreateAndRegisterChecker() initializes _exec from an optional argument
'exec'.  If this argument is missing, 'name' is used instead.
(3) Functions SyntaxCheckers_*_IsAvailable() are now dictionary functions.
(4) Functions SyntaxCheckers_*_IsAvailable() are now optional.  When
they are missing, they are assumed to return executable(expand(self.getExec())).
(5) Argument 'exe' of function syntastic#makeprg#build() is now optional.
If this argument is missing, expand(self.getExec()) is used to set checker
executables.
2013-11-02 10:44:06 +02:00
LCD 47
28bce98a68 Registry cleanup, stage 1.
Make SyntaxCheckers_*_GetLocList() dictionary functions.
Pass a reference to the current checker to syntastic#makeprg#build().
Add an optional 'redirect' argument to CreateAndRegisterChecker().
Change the sh checker to use the new dictionary functions.
Add a new registry method getLocListRaw() (needed for the sh checker).
2013-11-02 10:44:06 +02:00
LCD 47
56864a328c Tune flake8 error levels. 2013-09-20 01:45:58 +03:00
LCD 47
4b9bf4405b Pylama: new checker for Python 2.
Minor refactoring.
2013-07-14 19:13:18 +03:00
LCD 47
d3354f175c Make syntastic#makeprg#build() aware of filetypes. Fixes #667. 2013-05-31 21:05:45 +03:00
Martin Grenfell
602bbe7b24 break down some error format strings
Most errorformats are now expressed 1 "clause" per line.
2013-05-14 17:36:20 +01:00
Martin Grenfell
073eae9884 Revert "python/flake8: add some backwards compat"
This reverts commit 0ef513a0a8.

The cases that I was trying to catch here were already caught further
along in the errorformat
2013-03-18 10:49:39 +00:00
Martin Grenfell
0ef513a0a8 python/flake8: add some backwards compat
make it match E and W for flake < 2.0
2013-03-18 09:42:22 +00:00
Chronial
1315a85aee recognize flake8 2.0 error output 2013-03-17 12:13:39 +01:00
Martin Grenfell
2003c772b0 Merge pull request #465 from chazlever/master
Fix Flake8 Error/Warning Parsing
2013-03-08 07:10:55 -08:00
Martin Grenfell
16424e5761 add guards to all checkers
goddamn I love macros
2013-02-21 15:50:41 +00:00
Martin Grenfell
e0b8e87c93 refactor all the syntax checkers to use the new API and dir layout 2013-01-27 20:08:30 +00:00
Martin Grenfell
58ba8d3161 refactor how we represent and store checkers using python as a demo
Add 2 classes: SyntasticChecker and SyntasticRegistry.

SyntasticChecker represents a checker. It holds funcrefs to the checker
func, the highlight regex func and a new `isAvailable()` func (that
essentially just checks if the checker exe is installed)

SyntasticRegistry is responsible for:
* loading checkers
* storing checkers
* fetching the checkers to use according to availability and the users
  settings

Motivation/benefits:
* in the current system only one checker can be loaded per filetype
* syntax checkers cant be "chained" together
* the system is hard to add features to since fundamental concepts like
  syntax checkers and location lists arent represented explicitly

Things left to do:
* add a call to g:SyntasticRegistry.CreateAndRegisterChecker() to all
  checkers
* add an `isAvailable` function to all checkers
* move all checkers into `syntax_checkers/filetype/checkername.vim` -
  g:SyntasticRegistry assumes this layout, and its a good idea anyway
  for consistency and it makes it easier for users to add their own
  checkers

Things to do after all of the above:
* add a LocationList class and move all the filtering functions onto it
* possibly add an Error class that wraps up each item in a loc list

Random notes:
* with the new system you can select the checkers to use with e.g.
    `let g:syntastic_python_checkers=['flake8', 'pylint']`
  This will try flake8 first, and if no errors are detected it will move
  onto pylint.
2013-01-24 00:19:13 +00:00
Chaz Lever
50561a87f7 Fix flake8 error/warning checking
Error/warning checking did not correctly parse output from flake8. This
resulted in Syntastic incorrectly displaying some warnings as errors.
2013-01-22 15:19:28 -05:00
Martin Grenfell
10c845d1f5 add a makeprg builder
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'`
2013-01-02 13:05:27 +00:00
Jose Jiménez
9504f526d4 The warnings were shown as errors when using flake8 2012-10-26 13:27:03 +02:00
Lee Packham
02e510eec4 Don't shoe horn 'syntax error' everywhere
It hides the actual warning/error from Syntastic - so don't do that.
2012-04-12 06:48:17 +01:00
Martin Grenfell
b4e85a8762 python/flake8: assume all outputs are errors - not warnings
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.
2012-03-27 10:41:37 +01:00
Martin Grenfell
892cc2c232 refactor the error highlighting system
* 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.
2012-03-02 10:05:15 +00:00
Martin Grenfell
d454a00615 split python checker out into 3 files
previously there were 3 checkers in the one file
2012-02-20 10:20:48 +00:00