Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure PHPCS handles CLI arguments case-insensitively across operating systems #774

Open
rodrigoprimo opened this issue Dec 18, 2024 · 0 comments

Comments

@rodrigoprimo
Copy link
Contributor

PHPCS CLI arguments should be handled case-insensitively (see squizlabs/PHP_CodeSniffer#1656 (comment) and #771 (comment)). But on #771, it was discovered that PHPCS was handling the --generator argument case-insensitively on Windows, but not on Linux (and probably not on Mac as well).

In this issue, we should check the other PHPCS CLI arguments to ensure they are handled case-insensitively across different operating systems. The --generator argument will be fixed in #771.

There is at least one other argument where this is not happening that needs to be fixed. On Linux, bin/phpcs --filter=GitModified . works, but bin/phpcs --filter=gitmodified . causes a fatal error:

$ bin/phpcs --filter=gitmodified .       
PHP Fatal error:  Uncaught Error: Class "\PHP_CodeSniffer\Filters\gitmodified" not found in src/Files/FileList.php:90
Stack trace:
#0 src/Runner.php(402): PHP_CodeSniffer\Files\FileList->__construct()
#1 src/Runner.php(120): PHP_CodeSniffer\Runner->run()
#2 bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS()
#3 {main}
  thrown in src/Files/FileList.php on line 90
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants