PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Allow wildcard/patterns/group run for --sniffs

Open kenorb opened this issue 7 years ago • 1 comments

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.

kenorb avatar Mar 26 '18 11:03 kenorb

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.

gsherwood avatar Mar 26 '18 22:03 gsherwood