PHPCS throws a fatal error when the user passes an invalid generator.
To reproduce
Steps to reproduce the behavior:
Run phpcs test.php --generator=InvalidGenerator --standard=Generic
See the error message displayed
$ phpcs test.php --generator=InvalidGenerator --standard=Generic
PHP Fatal error: Uncaught Error: Class "PHP_CodeSniffer\Generators\InvalidGenerator" not found in src/Runner.php:98
Stack trace:
#0 bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS()
#1 {main}
thrown in src/Runner.php on line 98
Expected behavior
PHPCS should display a friendly error message informing the user that the generator does not exist and potentially listing the available generators.
Please confirm
[x] I have searched the issue list and am not opening a duplicate issue.
Marking this as an enhancement instead of a bug, as the error is with the user, not with PHPCS, but PHPCS can handle the error in a more user-friendly manner, hence: enhancement.
Describe the bug
PHPCS throws a fatal error when the user passes an invalid generator.
To reproduce
Steps to reproduce the behavior:
phpcs test.php --generator=InvalidGenerator --standard=Generic
Expected behavior
PHPCS should display a friendly error message informing the user that the generator does not exist and potentially listing the available generators.
Please confirm
master
branch of PHP_CodeSniffer.