php checker: add an option to disable phpcs

This commit is contained in:
Martin Grenfell 2011-12-07 14:13:18 +00:00
parent 6b6e2d1d37
commit 3defb627a5

View File

@ -24,6 +24,10 @@ if !exists("g:syntastic_phpcs_conf")
let g:syntastic_phpcs_conf = "" let g:syntastic_phpcs_conf = ""
endif endif
if !exists("g:syntastic_phpcs_disable")
let g:syntastic_phpcs_disable = 0
endif
function! SyntaxCheckers_php_Term(item) function! SyntaxCheckers_php_Term(item)
let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'") let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'")
if len(unexpected) < 1 | return '' | end if len(unexpected) < 1 | return '' | end
@ -33,7 +37,7 @@ endfunction
function! SyntaxCheckers_php_GetLocList() function! SyntaxCheckers_php_GetLocList()
let errors = [] let errors = []
if executable("phpcs") if !g:syntastic_phpcs_disable && executable("phpcs")
let errors = s:GetPHPCSErrors() let errors = s:GetPHPCSErrors()
endif endif