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
Add prompt suggesting using --dev when require command is used with dev packages #10960
Conversation
…ackages which appear to be dev, fixes composer#10939
@@ -254,6 +284,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
return 0; | |||
} | |||
|
|||
$input->setOption('dev', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this here for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just correctness, in case any new code below would check $input->getOption('dev')
, as this effectively switches the mode we're running in.
Co-authored-by: Nils Adermann <naderman@naderman.de>
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 composer/composer#10960.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
As per https://getcomposer.org/doc/04-schema.md#keywords by including "dev" and/or "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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
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 composer/composer#10960 for more info.
as per composer/composer#10960 this allows composer to warn the user, when installing the tool as a project dependency instead of a dev-dependency
This tells composer to install composer-unused to require-dev when running composer require without --dev composer/composer#10960
This tells composer to install composer-unused to require-dev when running composer require without --dev composer/composer#10960
as per composer/composer#10960 this allows composer to warn the user, when installing the tool as a project dependency instead of a dev-dependency
as per composer/composer#10960 this allows composer to warn the user, when installing the tool as a project dependency instead of a dev-dependency
This tells composer to install composer-unused to require-dev when running composer require without --dev composer/composer#10960
as per composer/composer#10960 this allows composer to warn the user, when installing the tool as a project dependency instead of a dev-dependency
… as a require-dev package. See: composer/composer#10960
Keywords to describe pdepend Dev to let composer know the package is mostly a dev dependency, see: composer/composer#10960
Keywords to describe pdepend Dev to let composer know the package is mostly a dev dependency, see: composer/composer#10960
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 composer/composer#10960 for more info.
Since Composer 2.4.0, Composer will prompt users if they are sure they want to install something as `require` instead of `require-dev` if the package contains certain "dev" related keyword, like `static analysis`. This adds the keywords to this package to help users add the package in the most appropriate place. Refs: * https://getcomposer.org/doc/04-schema.md#keywords * composer/composer#10960 Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
Since Composer 2.4.0, Composer will prompt users if they are sure they want to install something as `require` instead of `require-dev` if the package contains certain "dev" related keyword, like `static analysis`. This adds the keywords to this package to help users add the package in the most appropriate place. Refs: * https://getcomposer.org/doc/04-schema.md#keywords * composer/composer#10960 Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
First suggested in #10939
This implements the idea discussed here tho #10939 (comment)
Currently taking
dev
,testing
,static analysis
tags as indicator that a package is meant to be in require-dev, then it does this:IMO
testing
andstatic analysis
are fairly safe bets.dev
is almost unused atm, and I took a look at all the top download packages there and only one is arguably not meant to be in require-dev, but they can fix that by removing the tag from the default branch.