Php_codesniffer: Allow wildcard/patterns/group run for --sniffs

Created on 26 Mar 2018  路  1Comment  路  Source: squizlabs/PHP_CodeSniffer

Specifying --sniffs=Squiz.WhiteSpace shows sniff as invalid. I would expect it'll run all sniffs in that category.

When I run:

phpcbf --standard=Squiz --sniffs='Squiz.WhiteSpace.*' src/

it's running, but I've got:

No fixable errors were found

However when I run:

phpcbf --standard=Squiz --sniffs=Squiz.WhiteSpace.SuperfluousWhitespace src/

it works.

Enhancement

Most helpful comment

The --sniffs command line argument has always required full sniff codes, as is documented everywhere like that. That's why partial codes or wildcards are not working for you. Those are not sniff codes.

However, being able to use partial codes is something I've been thinking about building for a while, so I'm going to leave this open a feature request. I have no idea when I'd ever get around to it, but it's a nice feature to have for debugging at least.

>All comments

The --sniffs command line argument has always required full sniff codes, as is documented everywhere like that. That's why partial codes or wildcards are not working for you. Those are not sniff codes.

However, being able to use partial codes is something I've been thinking about building for a while, so I'm going to leave this open a feature request. I have no idea when I'd ever get around to it, but it's a nice feature to have for debugging at least.

Was this page helpful?
0 / 5 - 0 ratings