Skip to content

Commit

Permalink
Merge pull request neovim#113 from tthbellcom/php-maker
Browse files Browse the repository at this point in the history
Added maker for php and phpcs
  • Loading branch information
benekastah committed Apr 24, 2015
2 parents bf9a40d + f3afdbd commit c437021
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions autoload/neomake/makers/ft/php.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
" vim: ts=4 sw=4 et

function! neomake#makers#ft#php#EnabledMakers()
return ['php', 'phpcs']
endfunction

function! neomake#makers#ft#php#php()
return {
\ 'args': ['-l'],
\ 'errorformat': '%m\ in\ %f\ on\ line\ %l,%-GErrors\ parsing\ %f,%-G',
\ 'postprocess': function('neomake#makers#ft#php#PhpEntryProcess'),
\ }
endfunction

function! neomake#makers#ft#php#PhpEntryProcess(entry)
"All php lint entries are Errors.
let a:entry.type = 'E'
endfunction

function! neomake#makers#ft#php#phpcs()
let l:args = ['--report=csv']

"Add standard argument if one is set.
if exists("g:neomake_php_phpcs_args_standard")
call add(l:args, '--standard=' . expand(g:neomake_php_phpcs_args_standard))
endif

return {
\ 'args': args,
\ 'errorformat':
\ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity%.%#,'.
\ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]%.%#',
\ }
endfunction

0 comments on commit c437021

Please sign in to comment.