Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignoring single PHPCS rule when running from command line

Tags:

phpcs

Scenario

Some times, I want to run PHPCS, but have it ignore one rule, in this case the Camel Case Method Name rule.

I know that I can create a new ruleset which inherits all from another ruleset, and excludes one, but I'd like to do this from the command line if possible.

Question

When running phpcs --standard=PSR2 --extentions=php src/, is there a way to exclude a single rule from the standard for this run?

like image 338
Alec Avatar asked Feb 26 '16 12:02

Alec


1 Answers

As of June 29th, 2016, this is now possible.

To exclude specific sniffs, use the flag --exclude=sniff1,sniff2,sniff3.

For more information, see GitHub issue and commit.

like image 82
Alec Avatar answered Nov 16 '22 23:11

Alec