-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registering 0 sniffs must through an error #1129
Comments
Maybe |
That would also be good. |
I've thought about doing this for a while but never got around to it. I agree it would be a good change. Ideally, I'd like to add both the "no sniffs registered" error and the "invalid sniffs supplied" error. |
I've added an error for this to the 3.x branch. The output looks like this:
Note that when caching is enabled, sniff restrictions are not processed, and so sniffs might be registered even though none of them are valid. There is nowhere in PHPCS to perform this sort of check without a significant performance penalty. Currently, when the error messages are replayed from the cache, they are filtered out if they don't match one of the sniff restrictions. |
Hi guys I have installed codesniffer using composer on a windows machine with the intention of using it in PHP Storm. Although I had to change the directories in phpcs.bat to point to my php.exe and phpcs I managed to get PHPStorm to validate phpcs.bat However every time I open a php file I am getting the error mentioned by @gsherwood in his last comment. ERROR: No sniffs were registered Anything I could have missed or mis configured? Thanks |
Right now, by accident you can have a typo in the sniff name for
--sniffs
and it would just silently do nothing.gets you
And this is also only visible with -v, otherwise it is even cloaked and gives the false positive expression of running the selected sniffer.
There is absolutely 0 use case for having 0 sniffs and running it on sth.
Therefore it should definitely error out with "No sniffs registered/found" or sth.
The text was updated successfully, but these errors were encountered: