-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
The "--set" option does not exist. #7162
Comments
You can define: use Rector\PHPOffice\Set\PHPOfficeSetList;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET
]);
}; ref https://github.com/rectorphp/rector-phpoffice#use-sets |
I'm running into the same issue. I've got that specific config in rector.php: <?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\PHPOffice\Set\PHPOfficeSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET
]);
}; When I then run In addition to that it seems to process rules I don't want it to process. I only want it to process the phpexcel -> spreadsheet changes, but it's touching things like unused arguments. Yes I need to fix them, but another time. |
This is expected. This option does now exist anymore. It was removed ~1,5 year ago, when we moved to config |
Unused argument removal is depends on version you're using, which on purpose due to different version usage, see #7072 |
Different guides saying different things, joy :( Any idea how to limit it to just that one list? It's making thousands of changes I did not configure. Example
|
Where is the |
I came here following directions from the spreadsheet repository, I don't think I've found any guides that reference it incorrectly, just differently: |
@linaori Thanks! |
Awesome, thanks! I've been trying to figure out how to set the configuration to only run the phpspreadsheet rules, and found this: https://github.com/rectorphp/rector/blob/main/docs/how_to_ignore_rule_or_paths.md But I can't find the inverse of this. Is there no way to define "only PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET"? |
Thank you 👍 @linaori You've done correct way already: #7162 (comment) The set is group of rules. If you want to run only 1 rule from the set, you can cherry pick them manually from the set: |
Oh, a bit odd that this specific set is doing more than just what you'd expect to be fixing. Would it make sense to reduce this to the bare minimum required for the migration? Not arguing that these changes aren't good, but if I run this over my code-base I get thousands of changes which will break things 😅 Thanks for the pointers, I'll be cherry picking the rules and will try again! edit:
|
Could you be more specific about "a bit odd that this specific set is doing more than just what you'd expect to be fixing"? It should handle the sheet/excel upgrade only, so we're on the same page :) |
You can increase timeout seconds with something like this: $rectorConfig->parallel(200); for very large codebase. |
Here's an example where I run in a directory where I don't have a single reference to PHPExcel for example:
I'm also experiencing some serious memory issues, every time I run the script, it crashes my chrome and intellij 😂 |
That's probably job of Skip it in
That could be caused by something like mpdf. Try to narrow refactoring to narrow scope. |
Yeah I think I'm going to set up a limit to only process the files that contain a reference to PHPExcel, because this codebase is an absolute mess with embedded dependencies, thanks again for the pointers! |
I created PR rectorphp/rector-phpoffice#18 to ensure show "Applied rules" only when changed for
|
I'm trying to move from the library to phpexcel on phpspreadsheet.
vendor/bin/rector process /src/ --set phpexcel-to-phpspreadsheet
Gives an error message 'The "--set" option does not exist.'
I understood that you turned off the option "--set".
But I did not find which option should be added in
$rectorConfig->sets([ SetList::CODE_QUALITY ]);
The text was updated successfully, but these errors were encountered: