Use phpcs.xml config file

166 views
Skip to first unread message

David Petersen

unread,
Jun 19, 2015, 10:09:43 AM6/19/15
to vim-sy...@googlegroups.com
Current to use phpcs as a php checker and use the PSR-2 standard you have to have this in your .vimrc :
let g:syntastic_php_phpcs_args="--standard=PSR2 -n --report=csv"

The problem is that in the project I am working on we only use the PSR 2 standard for part of the code (its a work in progress). This is handled correctly by the phpcs.xml config file but I have yet to find a way to allow phpcs to use that config file when running in syntactic.

LCD 47

unread,
Jun 19, 2015, 12:03:11 PM6/19/15
to vim-sy...@googlegroups.com
On 19 June 2015, David Petersen <pub...@petersendidit.com> wrote:
> Current to use phpcs as a php checker and use the PSR-2 standard you
> have to have this in your .vimrc :
> let g:syntastic_php_phpcs_args="--standard=PSR2 -n --report=csv"

The "--report=csv" is redundant with decently recent versions of
syntastic.

> The problem is that in the project I am working on we only use the
> PSR 2 standard for part of the code (its a work in progress). This
> is handled correctly by the phpcs.xml config file but I have yet to
> find a way to allow phpcs to use that config file when running in
> syntactic.

You can do it pretty much the same way as you do it when you run
phpcs in a terminal:

let g:syntastic_php_phpcs_args="--standard=/path/to/ruleset.xml -n"

There's no magic involved here, g:syntastic_php_phpcs_args is just a
list of arguments to pass to phpcs.

/lcd
Reply all
Reply to author
Forward
0 new messages