Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add multiple paths for phpcs?

I want to configure multiple installed paths for phpcs.

I can add one via:

phpcs --config-set installed_paths the/dir/to/standard

I tried adding multiple by using : yet it did not work and the man page is non-existent and the help not that helpful.

like image 834
k0pernikus Avatar asked Jun 19 '15 08:06

k0pernikus


2 Answers

Use a comma-separated list without spaces between the paths:

phpcs --config-set installed_paths first/path/,second/path/,yet/another/path/
like image 105
k0pernikus Avatar answered Sep 21 '22 21:09

k0pernikus


I have the same frustration about not being able to set multiple paths. I use a bash script to append the current path to the installed_paths:

phpcs_ipath=$(phpcs --config-show installed_paths); oldpath=${phpcs_ipath##*:}; phpcs --config-set installed_paths ${oldpath},$(pwd)

I cd into the directory that contains my new standards, then run this one-liner. It grabs the current paths and appends the current path to them. Not perfect, but it's a quick way to add paths.

like image 30
Morgan Estes Avatar answered Sep 19 '22 21:09

Morgan Estes