How to load multiple coding standards in phpcs

1.5k views Asked by At

How could load multiple coding standards in phpcs?

While sniffing the files, I am supposed to use an xml file which uses three coding standards.

When I try to set their paths one by one, only recent one gets stored and old standard gets replaced.

phpcs --config-set installed_paths ../wordpress-coding-standards;

phpcs --config-set installed_paths ../wordpress-coding-standards/PHPCompatibility;

I also tried setting this value up with parent directory but it didn't work. Here's the final command which throws the errors:

phpcs -p -s -v  -n --standard=phpcs.xml /path/to/files

This is the xml file which is being used in above command: https://github.com/xwp/wp-dev-lib/blob/master/phpcs.xml

Any help would be appreciated. Thanks!

1

There are 1 answers

0
Shantanu Deshpande On

Solved it by specifying multiple paths separated by commas.

phpcs --config-set installed_paths first/path/,second/path/,yet/another/path/