Skip to content

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

Open
@rodrigoprimo

Description

@rodrigoprimo

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions