-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Do not exit with code 1 on uninstall (--no-dev) #103
Comments
@tobiasbaehr Thanks for the detailed report. I'm at a conference right now, but either @Potherca or me will look at this soon. The main thing which surprises me is that Composer would try to run a plugin which it has just uninstalled. The other thing which surprised me when you originally reported it, is that PHPCS would be reported as unavailable as it is a Anyway, need to get back to the conference now. I will try to have a look at this later tonight or at some point tomorrow. |
I've created automated reproduction scenarios for this bug (in BASH). Tomorrow I'll work on a fix. |
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. 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.
I've implemented a fix in MR #104. As soon as it has been reviewed and approved I can deploy a new release to get this fix out the door so @tobiasbaehr can verify it resolves things on his end. |
I can confirm that #104 works for me. composer install --no-interaction --optimize-autoloader --ansi --no-progress --no-dev -vv;echo $?
Required tags were not explicitly set so the zaporylie/composer-drupal-optimizations set default based on project's composer.json content.
extra.commerce-drupal-optimizations.require.symfony/symfony: '>3.4'
No patches supplied.
Loading composer repositories with package information
Installing dependencies from lock file
Dependency resolution completed in 0.003 seconds
Analyzed 362 packages to resolve dependencies
Analyzed 1174 rules to resolve dependencies
Package operations: 0 installs, 0 updates, 5 removals
Removals: squizlabs/php_codesniffer, drupal/stage_file_proxy, drupal/devel, drupal/coder, dealerdirect/phpcodesniffer-composer-installer
- Removing squizlabs/php_codesniffer (3.5.3)
Deleting /.../vendor/squizlabs/php_codesniffer - deleted
- Removing drupal/stage_file_proxy (1.0.0-rc2)
Deleting web/modules/contrib/stage_file_proxy - deleted
- Removing drupal/devel (2.1.0)
Deleting web/modules/contrib/devel - deleted
- Removing drupal/coder (8.3.7)
- Removing dealerdirect/phpcodesniffer-composer-installer (dev-master 2a57571)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Generating optimized autoload files
Running PHPCodeSniffer Composer Installer
PHPCodeSniffer Composer Installer is uninstalled
0 |
Thanks for testing @tobiasbaehr ! |
@tobiasbaehr The fix for this issue has been release as part of And thanks again for reporting the issue and testing the fix! |
Problem/Motivation
When dealerdirect/phpcodesniffer-composer-installer + package which has phpcs rules are uninstalled while
composer install --no-dev
the dealerdirect/phpcodesniffer-composer-installer exit with the exitcode 1, which breaks a CI.Expected behaviour
Do nothing in this case.
Actual behaviour
Steps to reproduce
Run
composer install --no-interaction --optimize-autoloader --ansi --no-progress --no-dev -vv;echo $?
to remove the dev-deps and the see the exit code.Proposed changes
Environment
Output of
vendor/bin/phpcs --config-show
:Tested against
master
branch?master
branch.The text was updated successfully, but these errors were encountered: