Skip to content
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

Composer > Define allowed plugins #1464

Merged
merged 1 commit into from
Dec 11, 2021

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Dec 11, 2021

Needed for Composer 2.2.0 (found with 2.2.0-RC1)

composer self-update --preview

Needed for Composer 2.2.0 (found with 2.2.0-RC1)
@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 39f6429 into rectorphp:main Dec 11, 2021
@ruudk ruudk deleted the composer-preview branch December 11, 2021 15:19
@rvanlaak
Copy link

Nice!

@TomasVotruba do you remember the PHP-WVL user group talk, where we spoke about having Rector to allow libraries to automagically run Rectors on composer update? Would this PR allow us to start experimenting with that, given that rector/extension-installer now gets enabled via this PR?

Are you keeping track of the progress on such an 'interactive upgrade' milestone?

@TomasVotruba
Copy link
Member

TomasVotruba commented Dec 16, 2021

Hi @rvanlaak ,

yes, I remember :) this was one of idea to implement Rector by default 4 years ago.
I'm not sure what this PR does to be honest, as I don't use newer composer.

But you can create such plugin today without hardcoding to Rector.

  • it would be composer plugin package
  • that checks if package has specific "type"
  • than looks to paths defined in "extra"
  • loads rector/*.php configs from the package
  • checks currently upgraded packages, e.g. Symfony 5.4 to 6.0
  • invokes the Rector with propper discovered set

@ruudk
Copy link
Contributor Author

ruudk commented Dec 16, 2021

To be clear, Composer 2.2.0 now warns users about these things happening and letting them opt-in, instead of running the plugins automatically. Before 2.2.0 it would just do it without your consent. I think this is good for security :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants