Merge pull request #333 from pneff/puppet-lint

Allow puppet validation to be disabled
This commit is contained in:
Martin Grenfell 2012-08-31 09:02:18 -07:00
commit 38eeaa8a87

View File

@ -19,6 +19,10 @@ if !executable("puppet")
finish
endif
if !exists("g:syntastic_puppet_validate_disable")
let g:syntastic_puppet_validate_disable = 0
endif
if !exists("g:syntastic_puppet_lint_disable")
let g:syntastic_puppet_lint_disable = 0
endif
@ -94,7 +98,9 @@ function! s:getPuppetMakeprg()
endfunction
function! SyntaxCheckers_puppet_GetLocList()
let errors = []
if !g:syntastic_puppet_validate_disable
let makeprg = s:getPuppetMakeprg()
"some versions of puppet (e.g. 2.7.10) output the message below if there
@ -102,7 +108,8 @@ function! SyntaxCheckers_puppet_GetLocList()
let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
let errors = errors + SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endif
if !g:syntastic_puppet_lint_disable
let errors = errors + s:getPuppetLintErrors()