- ๐บ๐ธUnited States euk
I was able to get around this error by simply updating the
upgrade_rector/rector-config-template.php
with the following code:<?php declare(strict_types=1); use DrupalRector\Set\Drupal8SetList; use DrupalRector\Set\Drupal9SetList; use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { // Adjust the set lists to be more granular to your Drupal requirements. // @todo find out how to only load the relevant rector rules. // Should we try and load \Drupal::VERSION and check? $rectorConfig->sets([ Drupal8SetList::DRUPAL_8, Drupal9SetList::DRUPAL_9, ]); $parameters = $rectorConfig->parameters(); $rectorConfig->autoloadPaths([ $drupal_root . '/core', $drupal_root . '/modules', $drupal_root . '/profiles', $drupal_root . '/themes' ]); $rectorConfig->skip(['*/upgrade_status/tests/modules/*']); $rectorConfig->fileExtensions(['php', 'module', 'theme', 'install', 'profile', 'inc', 'engine']); $rectorConfig->importNames(true, false); $rectorConfig->importShortClasses(false); $parameters->set('drupal_rector_notices_as_comments', true); };
This mimics
vendor/palantirnet/drupal-rector/rector.php
, with only difference it doesn't useDrupalFinder
.
If I read the results of this correctly - it works.Here is what I got for the Redirect 8.x-1.7 module.
Rector log:
20/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 19%[1G[2K 40/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 38%[1G[2K 60/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 57%[1G[2K 65/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 61%[1G[2K 85/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 80%[1G[2K 105/105 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100% ===================== [OK] 30 files would have changed (dry-run) by Rector
Applied Rectors:
- DrupalGetPathRector
- ArgumentRemoverRector
- GetMockBuilderGetMockToCreateMockRector (https://github.com/lmc-eu/steward/pull/187/files#diff-c7e8c65e59b8b4ff8b...)
- RenameClassRector
- WrapReturnRector
- ChangeMethodVisibilityRector
- AssertFieldByNameRector
- ProtectedStaticModulesPropertyRector ( https://www.drupal.org/node/2909426 โ )
- AddReturnTypeDeclarationRector
- AssertIdenticalRector
- PassRector
- AssertLinkRector
- AssertRawRector
- AssertUrlRector
- UiHelperTraitDrupalPostFormRector
- AssertLinkByHrefRector
- AssertResponseRector
- AssertTextRector
- AssertNoOptionRector
- AssertOptionByTextRector
- AssertOptionRector
- AssertNoRawRector
- AssertElementPresentRector
- AssertNoTextRector
- AssertOptionSelectedRector
- RenameMethodRector
And it successfully generated a very long patch.
- last update
over 1 year ago 2 fail - Status changed to Needs review
about 1 year ago 2:53pm 29 September 2023 - last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Updated to current rector.php state from palantir.
The last submitted patch, 12: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- Status changed to Needs work
about 1 year ago 3:13pm 29 September 2023 - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
When running this still fails with
[ERROR] Class "DrupalRector\Set\Drupal10SetList" not found
Not sure how it worked for you all above?
- Status changed to Needs review
about 1 year ago 3:22pm 29 September 2023 - last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Duh the current 0.15.1 release version does not have Drupal 10 rules yet, I pulled that from dev.
- last update
about 1 year ago 2 fail The last submitted patch, 15: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 2 pass - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Rectors executed does not return the FQCN anymore.
- last update
about 1 year ago 2 pass - last update
about 1 year ago 2 pass - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Ok this certainly fixes what the smoke tests were looking for. It still does not completely work, also has an error about not finding the form class for some reason. Let's see if naming the class namespace after the actual module name helps.
- last update
about 1 year ago 2 pass - last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Now that passes fine, we can add extra tests that there are no errors generated either.
- last update
about 1 year ago 2 fail The last submitted patch, 19: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Should not match a pattern when we want to match exact text.
- last update
about 1 year ago 2 fail The last submitted patch, 21: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
The values asserted were in a form, so it does not seem to appear in the page text, let's try asserting the raw values.
- last update
about 1 year ago 2 fail The last submitted patch, 23: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 2 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Duh that's for kernel tests. Classic testbot driven development. :D
The last submitted patch, 25: 3322943.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 2 pass - last update
about 1 year ago 2 pass - f84f6339 committed on 2.x
Issue #3322943 by Gรกbor Hojtsy, prudloff, euk, arpitk, heddn:...
- f84f6339 committed on 2.x
- 91739d2c committed on 8.x-1.x
Issue #3322943 by Gรกbor Hojtsy, prudloff, euk, arpitk, heddn:...
- 91739d2c committed on 8.x-1.x
- Status changed to Fixed
about 1 year ago 8:20pm 29 September 2023 - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
All right, landed that. Its a somewhat better smoke test than we had before even.
Automatically closed - issue fixed for 2 weeks with no activity.