squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

Add "static analysis" Composer keyword #3655

Closed GaryJones closed 2 years ago

GaryJones commented 2 years ago

As per https://getcomposer.org/doc/04-schema.md#keywords by including "static analysis" as a keyword in the composer.json file, Composer 2.4.0-RC1 and later will prompt users if the package is installed with composer require instead of composer require --dev. See https://github.com/composer/composer/pull/10960 for more info.

GaryJones commented 2 years ago

Errant comma on the first commit, so these can be rebased/squashed on merge.

jrfnl commented 2 years ago

Note: (new) external standards which require PHPCS will also get prompted whether squizlabs/php_codesniffer was deliberately requested as require, not require-dev. IMO, that's fine. Maintainers of external standards can select to keep the package in require on the command-line prompt.

gsherwood commented 2 years ago

Thanks for this. I did end up squashing them, hence no merged tag.