From 0973ba27b862603646dec212574af88f2b6d3b50 Mon Sep 17 00:00:00 2001 From: Sergey Tatarintsev Date: Fri, 17 Jan 2014 17:39:27 +0200 Subject: [PATCH] Add bemhtml syntax checker --- plugin/syntastic/registry.vim | 1 + syntax_checkers/bemhtml/bemhtmllint.vim | 34 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 syntax_checkers/bemhtml/bemhtmllint.vim diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index d6afe3a5..edfdeba7 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -8,6 +8,7 @@ let s:defaultCheckers = { \ 'ada': ['gcc'], \ 'applescript': ['osacompile'], \ 'asciidoc': ['asciidoc'], + \ 'bemhtml': ['bemhtmllint'], \ 'c': ['gcc'], \ 'chef': ['foodcritic'], \ 'co': ['coco'], diff --git a/syntax_checkers/bemhtml/bemhtmllint.vim b/syntax_checkers/bemhtml/bemhtmllint.vim new file mode 100644 index 00000000..9c8165bd --- /dev/null +++ b/syntax_checkers/bemhtml/bemhtmllint.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: bemhtmllint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sergej Tatarincev +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +if exists("g:loaded_syntastic_bemhtml_bemhtmllint_checker") + finish +endif + +let g:loaded_syntastic_bemhtml_bemhtmllint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function SyntaxCheckers_bemhtml_bemhtmllint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + let errorformat = '%f:%l:%c: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'bemhtml', + \ 'name': 'bemhtmllint', + \ 'exec': 'bemhtml-lint' }) + + +let &cpo = s:save_cpo +unlet s:save_cpo