puppet: extract the puppet errorformat generation code into a function
This commit is contained in:
parent
7b51216924
commit
d210940339
@ -78,12 +78,7 @@ function! s:getPuppetMakeprg()
|
||||
return makeprg
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_GetLocList()
|
||||
let errors = []
|
||||
|
||||
if !g:syntastic_puppet_validate_disable
|
||||
let makeprg = s:getPuppetMakeprg()
|
||||
|
||||
function! s:getPuppetEfm()
|
||||
"some versions of puppet (e.g. 2.7.10) output the message below if there
|
||||
"are any syntax errors
|
||||
let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
|
||||
@ -96,7 +91,14 @@ function! SyntaxCheckers_puppet_GetLocList()
|
||||
let errorformat .= 'Error: Could not parse for environment %*[a-z]: %m at %f:%l'
|
||||
endif
|
||||
|
||||
let errors = errors + SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
return errorformat
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_GetLocList()
|
||||
let errors = []
|
||||
|
||||
if !g:syntastic_puppet_validate_disable
|
||||
let errors = errors + SyntasticMake({ 'makeprg': s:getPuppetMakeprg(), 'errorformat': s:getPuppetEfm() })
|
||||
endif
|
||||
|
||||
if !g:syntastic_puppet_lint_disable
|
||||
|
Loading…
Reference in New Issue
Block a user