added phpcs support
This commit is contained in:
parent
cf6aa9a414
commit
22fedb5350
@ -26,9 +26,17 @@ function! SyntaxCheckers_php_Term(item)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_php_GetLocList()
|
function! SyntaxCheckers_php_GetLocList()
|
||||||
|
|
||||||
|
let errors = []
|
||||||
|
if executable("phpcs")
|
||||||
|
let makeprg = "phpcs --report=csv ".shellescape(expand('%'))
|
||||||
|
let errorformat = '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
|
||||||
|
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
|
endif
|
||||||
|
|
||||||
let makeprg = "php -l ".shellescape(expand('%'))
|
let makeprg = "php -l ".shellescape(expand('%'))
|
||||||
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
|
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
|
||||||
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
let errors = errors + SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
|
|
||||||
call syntastic#HighlightErrors(errors, function('SyntaxCheckers_php_Term'))
|
call syntastic#HighlightErrors(errors, function('SyntaxCheckers_php_Term'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user