Commit Graph

569 Commits

Author SHA1 Message Date
Martin Grenfell
79564f9847 fix a bug with the checkpatch checker
(introduced in the epic refactor)
2013-01-31 16:41:16 +00:00
Martin Grenfell
f252874a81 remove some, now unused, syntax checker files 2013-01-31 10:48:24 +00:00
Martin Grenfell
a06632a1ac Merge branch 'refactor_checker_structure' into merge-with-refactor
Conflicts:
	syntax_checkers/cpp/gpp.vim
	syntax_checkers/objc/gcc.vim
2013-01-31 10:43:22 +00:00
Martin Grenfell
4552884c6c bugfix for eruby checker 2013-01-30 17:04:45 +00:00
Martin Grenfell
033fb2763a fix a couple of bugs with ruby checkers 2013-01-27 23:59:25 +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
kongo2002
59f7feb046 Merge remote-tracking branch 'valoric/ycm_support' 2013-01-24 21:10:19 +01:00
Jeroen Budts
f144091b59 php: fix phpmd to use post_args
PHP mess detector expects the filename as the first argument, followed
by the output format and the rules. To fix this, use the 'post_args' to
provide the arguments.
Also change the subchecker to 'phpmd' instead of 'phpcs'.
2013-01-24 16:58:08 +01: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
Martin Grenfell
8095909dcc Merge pull request #454 from asm89/twig
Add support for *.twig files
2013-01-23 11:25:38 -08:00
troydm
d4e0c2eee8 javac checker added fix for glob function 2013-01-23 22:26:43 +04:00
Strahinja Val Markovic
0fef368da2 Refactor ycm usage into separate files 2013-01-22 20:29:47 -08:00
Alexander
766c7ba8b1 Add support for *.twig files 2013-01-22 13:11:06 +01:00
Martin Grenfell
c10289fdeb make php checker use syntastic#makeprg#build 2013-01-20 13:48:58 +00:00
Martin Grenfell
5b31495af2 update makeprg builder and update some checkers to use it
update makeprg builder:
* it now accepts `fname`, `tail`, and `post_args` params.
* add some doc above syntastic#makeprg#build
* update a bunch of checkers to use the new params

Still have quite a few checkers that arent using makeprg#build.
Including all c* and a few other c-like checkers. And PHP.

Not to worried about c* as these checkers are complicated and probably
justify having their own logic to build makeprgs.
2013-01-20 12:27:19 +00:00
Martin Grenfell
6a184f0e37 update checkers to use the new syntastic#makeprg#build()
Make all the easy updates. There are still quite a few to do, but in
doing these ones I can see that syntastic#makeprg#build() needs to
accept a few more options. Namely:

* "postargs" that appear after the filename
* "tail" that appears after everything - used for things like
  redirecting output and piping to grep/sed/etc
* the filename itself - only the java checkers needed this since they
  specify the directory of the file to check as well

There are still a few other things to do as well:

* remove the options from the checkers that are now provided by
  syntastic#makeprg#build implicitly - i.e. the checker exe and args.
* also, we need to doc the above implicit checker options
2013-01-20 11:13:01 +00:00
James Pickard
214927789d make note style consistent with other notes 2013-01-16 16:13:08 -05:00
James Pickard
fd797e00f6 Add note about required version and nagelfar homepage 2013-01-16 16:03:32 -05:00
James Pickard
36393cd677 updated to user newer form of SyntasticLoadChecker('tcl') 2013-01-15 18:55:59 -05:00
James Pickard
f5b9c3641f merged upstream 2013-01-15 18:50:28 -05:00
Strahinja Val Markovic
b93e51e260 c, objc and objcpp support 2013-01-14 21:12:53 -08:00
Strahinja Val Markovic
0040afbaf6 Adding support for ycm to the cpp filetype
Conflicts:
	syntax_checkers/cpp.vim
2013-01-14 21:03:24 -08:00
Martin Grenfell
37e8e7d427 Merge pull request #436 from rumblesan/master
Use scala compiler, not interpreter, for syntax checking
2013-01-08 01:42:37 -08:00
Peter Hall
537900d6b2 Fixing puppet-lint syntax check when using
syntastic_puppet_lint_arguments variable
2013-01-08 15:50:43 +11:00
Guy John
850046bc08 Use scala compiler instead of interpreter
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.
2013-01-03 12:35:46 +00: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
Martin Grenfell
5fbe86db7b Merge pull request #428 from powerman/efm_perl
Efm perl: few fixed
2013-01-02 05:02:48 -08:00
Martin Grenfell
ed8ef51f49 Merge pull request #427 from troydm/master
javac checker quotes changed to fnameescape
2013-01-02 04:58:50 -08:00
Martin Grenfell
f5b0abb58a Merge pull request #430 from maksimr/master
Added Dart support
2013-01-02 04:56:24 -08:00
Tom Jakubowski
56d1935dd2 Ignore tidy warning about "search" value for <input> type attribute 2012-12-24 04:30:42 -06:00
Maksim Ryzhikov
62d1da3b8d add support dart 2012-12-21 22:44:58 +04:00
Alex Efros
68c381306e efm_perl: add support for checking - (stdin)
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.
2012-12-19 17:18:25 +02:00
Alex Efros
02a99d0e35 efm_perl: fix warning about uninitialized $opt_I
$ perl syntax_checkers/efm_perl.pl -c -w /dev/null
Use of uninitialized value $opt_I in split at syntax_checkers/efm_perl.pl line 94.
2012-12-19 17:10:58 +02:00
troydm
9f798fa4ef javac quotes changed to fnameescape 2012-12-19 18:20:38 +04:00
troydm
e25a3efa33 javac checker path seperator related bugfix added 2012-12-19 17:43:08 +04:00
troydm
b476114461 added config file support for javac checker and windows os support 2012-12-19 17:23:58 +04:00
Martin Grenfell
7353b32d77 perl: add -Tc to makeprg if the shebang contains -T
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()
2012-12-18 09:38:33 +00:00
Florent Bruneau
29d5b88e27 c/c++: force language in compiler invocation.
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>
2012-12-16 18:44:20 +01:00
Florent Bruneau
4b0b81cddc c/c++: add an option to ignore default include dirs.
Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
2012-12-16 18:44:20 +01:00
Florent Bruneau
91f3af2862 c: allow using clang to check C.
Since clang as a interface compatible with gcc's, use the gcc backend for
both.

Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
2012-12-15 13:41:23 +01:00
Martin Grenfell
163d5fb370 php: add a bit of doc at the top 2012-12-05 23:34:13 +00:00
Adam Fairbrother
c253e3e4d9 Update syntax_checkers/efm_perl.pl
Added a semi colon in that broke perl syntax checking.
2012-12-05 12:57:47 -08:00
Martin Grenfell
fc4ec2533c Merge branch 'load_any_checker' 2012-12-04 09:33:34 +00:00
Martin Grenfell
2c0abf4515 perl: fix some comments that got slightly screwed 2012-12-03 23:55:54 +00:00
notbugger
558de5a58c Update syntax_checkers/efm_perl.pl
Use warnings pragma instead of warnings flag.
2012-12-03 15:42:31 -08:00
Martin Grenfell
42480a01a1 modify SyntasticLoadChecker to load any checkers present
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()`
2012-12-03 21:22:44 +00:00
Martin Grenfell
6d5a604251 Merge pull request #409 from jhickner/master
Add -fno-code to the call to ghc-mod, which speeds up haskell syntax checking
2012-12-03 03:02:39 -08:00
Martin Grenfell
11907f6907 Merge pull request #413 from jgrande/master
docbook checker: added quotes to args in expand() call
2012-12-03 01:59:09 -08:00
Martin Grenfell
d4e74d81d8 typescript: dont need to escape the space inside a string 2012-12-03 09:57:06 +00:00
Martin Grenfell
1b237eba14 Merge pull request #416 from jb55/typescript
Fix TypeScript errorformat for latest version of the compiler
2012-12-03 01:56:27 -08:00