Closed Potherca closed 4 years ago
You are correct... The "Is this plugin installed?" check should always run. It doesn't matter if it is require-dev
or require
. I've updated my test scenarios and removed the $isDev
.
I guess I was a bit monofocussed on the reported scenario. 🤷
Anyway, good catch! 👍
Regarding the "P.S."... I tend to always work from my own fork, for various reasons.
Thanks @Potherca for sorting this out.
I think I will still open an issue in the Composer repo to ask about the principle of plugins running after they've been uninstalled. Depending on the answer there, we can iterate on this further.
Re: the "P.S.":
Thanks for the extensive answer. I was mostly wondering about it as it makes (manual) testing by other committers or even by casual watchers of the repo more awkward.
To be able to test this PR, as you will no doubt be aware, I had to add a new remote + add a repositories
vcs
directive to the composer.json
for the test scenario I was using.
If the branch had been in this repo, neither would have been necessary.
As PR branches should "normally" be short-lived, I'm not too concerned about branches being added to a repo, especially as it is now possible for them to be auto-deleted on merge (setting in the repo settings).
I'm not trying to persuade you to change your workflow. Just wanted to give you my perspective.
If the phpcodesniffer-composer-installer plugin is installed as a dev requirement and it is then uninstalled as part of a "--no-dev" install, a bug occurs. The bug that occurs is that the plugin complains that the package "squizlabs/php_codesniffer" is not installed without checking if the package should be present.
Proposed Changes
This commit adds a check to verify that this plugin is actually installed before complaining about the missing package. If this plugin itself is removed, then it should not complain about the missing package.
Related Issues
103