From 4310146a99e97647a8cb5214a1c1617fc90a2dd9 Mon Sep 17 00:00:00 2001 From: Brendan Erwin Date: Sat, 14 Jul 2012 19:15:38 -0300 Subject: [PATCH] Include CoffeeLint if available. Respects the same options configuration as the vim-coffee-script plugin. --- syntax_checkers/coffee.vim | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/coffee.vim b/syntax_checkers/coffee.vim index 59dca752..679d9857 100644 --- a/syntax_checkers/coffee.vim +++ b/syntax_checkers/coffee.vim @@ -19,9 +19,23 @@ if !executable("coffee") finish endif + function! SyntaxCheckers_coffee_GetLocList() let makeprg = 'coffee -c -l -o /tmp '.shellescape(expand('%')) let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#' - return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + let coffee_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + let lint_results = [] + if executable("coffeelint") + let lint_options = '' + if(exists('g:coffee_lint_options')) + let lint_options = g:coffee_lint_options + endif + let coffeelint = 'coffeelint --csv '.lint_options.' '.shellescape(expand('%')) + echo coffeelint + let lint_results = SyntasticMake({ 'makeprg': coffeelint, 'errorformat': '%f\,%l\,error\,%m' }) + endif + + return coffee_results + lint_results endfunction