From 3574ac167b88ccd6b5e1932b4f775b7710c5d3b0 Mon Sep 17 00:00:00 2001 From: Andy Duncan Date: Sat, 13 Aug 2011 20:08:04 -0700 Subject: [PATCH 1/2] add google closure linter support --- syntax_checkers/javascript.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/syntax_checkers/javascript.vim b/syntax_checkers/javascript.vim index 336d1c16..b0e30b59 100644 --- a/syntax_checkers/javascript.vim +++ b/syntax_checkers/javascript.vim @@ -16,6 +16,26 @@ if exists("loaded_javascript_syntax_checker") endif let loaded_javascript_syntax_checker = 1 +" Use google's gjslint if the user has it installed +if executable("gjslint") + if !exists("g:syntastic_gjslint_conf") + let g:syntastic_gjslint_conf = "" + endif + + function! SyntaxCheckers_javascript_GetLocList() + if empty(g:syntastic_gjslint_conf) + let gjslintconf = "" + else + let gjslintconf = g:syntastic_gjslint_conf + endif + let makeprg = "gjslint" . gjslintconf . " --nosummary --unix_mode --nodebug_indentation --nobeep " . shellescape(expand('%')) + let errorformat="%f:%l:(%n)\ %m,%-G1 files checked, no errors found.,%-G%.%#" + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + endfunction + " We're using google gjslint, finished. + finish +endif + " Use node jslint if the user has it installed if executable("jslint") if !exists("g:syntastic_jslint_conf") From 313695e2c6d132e4f997922ae258dd28d7fca68e Mon Sep 17 00:00:00 2001 From: Andy Duncan Date: Sat, 13 Aug 2011 21:59:46 -0700 Subject: [PATCH 2/2] Also match 'new' errors --- syntax_checkers/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax_checkers/javascript.vim b/syntax_checkers/javascript.vim index b0e30b59..94c09544 100644 --- a/syntax_checkers/javascript.vim +++ b/syntax_checkers/javascript.vim @@ -29,7 +29,7 @@ if executable("gjslint") let gjslintconf = g:syntastic_gjslint_conf endif let makeprg = "gjslint" . gjslintconf . " --nosummary --unix_mode --nodebug_indentation --nobeep " . shellescape(expand('%')) - let errorformat="%f:%l:(%n)\ %m,%-G1 files checked, no errors found.,%-G%.%#" + let errorformat="%f:%l:(New Error %n) %m,%f:%l:(%n) %m,%-G1 files checked, no errors found.,%-G%.%#" return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) endfunction " We're using google gjslint, finished.