From 9839d9bb910fb9ca331fa107f643758600931366 Mon Sep 17 00:00:00 2001 From: jmbeach Date: Fri, 15 Sep 2017 12:34:41 -0500 Subject: [PATCH 1/2] new T-SQL linter --- syntax_checkers/sql/tsqllint.vim | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 syntax_checkers/sql/tsqllint.vim diff --git a/syntax_checkers/sql/tsqllint.vim b/syntax_checkers/sql/tsqllint.vim new file mode 100644 index 00000000..53725bd5 --- /dev/null +++ b/syntax_checkers/sql/tsqllint.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: tsqllint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Daniel Walker +"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_sql_tsqllint_checker') + finish +endif + +let g:loaded_syntastic_sql_tsqllint_checker = 1 + +if exists('g:syntastic_sql_tsqllint_sort') + let g:syntastic_sql_tsqllint_sort = 1 +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sql_tsqllint_IsAvailable() dict + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_sql_tsqllint_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f(%l\,%c): %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sql', + \ 'name': 'tsqllint', + \ 'exec': 'tsqllint'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: From d184d4b46820ade04747b612a4fd5af5da8543c0 Mon Sep 17 00:00:00 2001 From: jmbeach Date: Fri, 15 Sep 2017 13:21:06 -0500 Subject: [PATCH 2/2] tsqllint remove extraneous items --- syntax_checkers/sql/tsqllint.vim | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/syntax_checkers/sql/tsqllint.vim b/syntax_checkers/sql/tsqllint.vim index 53725bd5..fb3b4e1e 100644 --- a/syntax_checkers/sql/tsqllint.vim +++ b/syntax_checkers/sql/tsqllint.vim @@ -23,10 +23,6 @@ endif let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_sql_tsqllint_IsAvailable() dict - return executable(self.getExec()) -endfunction - function! SyntaxCheckers_sql_tsqllint_GetLocList() dict let makeprg = self.makeprgBuild({}) @@ -39,8 +35,7 @@ endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'sql', - \ 'name': 'tsqllint', - \ 'exec': 'tsqllint'}) + \ 'name': 'tsqllint'}) let &cpo = s:save_cpo unlet s:save_cpo