-
Notifications
You must be signed in to change notification settings - Fork 0
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
IBX-8117: Prepared Rector package #1
Conversation
2fb6ad2
to
121bf48
Compare
tests/lib/Composer/Command/CustomRule/RectorTemplateContentsProcessorTest.php
Outdated
Show resolved
Hide resolved
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.
Looks good to me 💪
Co-authored-by: Adam Wójs <adam@wojs.pl>
src/lib/Composer/Command/CustomRule/AbstractRectorTemplateProcessor.php
Outdated
Show resolved
Hide resolved
Co-Authored-By: Paweł Niedzielski <Steveb-p@users.noreply.github.com>
Co-Authored-By: Paweł Niedzielski <Steveb-p@users.noreply.github.com>
|
||
## Creating custom rules | ||
|
||
This package comes with a Composer-wrapped Symfony command to generate custom rule and place its files to proper |
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.
This package comes with a Composer-wrapped Symfony command to generate custom rule and place its files to proper | |
This package comes with a Composer-wrapped Symfony command to generate custom rule and place its files in proper |
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.
Sorry, missed this. Fixed via ee2b174 on main
, thanks.
Description:
This PR provides some skeleton which adapts https://github.com/rectorphp/rector to our needs.
Changes:
rector/rector
v1nikic/php-parser
^4
due to php-parser v5 compat rectorphp/rector#8567.define-custom-rule
and necessary processors, based on built-in Rectorcustom-rule
command, utilizing rector-provided templatesBackground: built-in command is not very flexible and does too much, adding our custom command based on the built-in seemed like the most sane approach (though required not small portion of code). Road explored: wrap it and move files afterwards, but that doesn't provide the best DX as the command messes with composer and PHPUnit configuration...
Please note that this is executed by
composer define-custom-rule
so there's no Symfony DI involved there, nor bundle requirement. It makes it more compact and easier to install and use, though it's something that can be changed, depending on the preferences.For QA:
Rather no QA at this point.
Documentation:
All needed information were documented here. Due to the nature of this package IMHO it makes more sense to do it here, however we can still either reference this in the Official Doc or move it and reference Official Doc here.