Rector init should add Drupal-specific config in rector.php
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3372028. --> Reported by: [froboy](https://www.drupal.org/user/271282) >>> <h2>Drupal version</h2> <p>Drupal version : 10.0.9</p> <h2>Drupal Rector version</h2> <p>Rector 0.15.25</p> <h2>Problem / Motivation</h2> <p>Running <code>rector</code> with no <code>rector.php</code> file in your codebase results in this prompt:</p> <blockquote><p> No "rector.php" config found. Should we generate it for you? [yes]:<br> &gt; yes</p> <p> [OK] The config is added now. Re-run command to make Rector do the work! </p></blockquote> <p>I was under the impression that this was giving me the proper rector.php file, but actually it's providing the <a href="https://github.com/rectorphp/rector/blob/main/templates/rector.php.dist">base rector config</a>, not the <a href="https://github.com/palantirnet/drupal-rector/blob/main/rector.php">Drupal specific one</a>. This results in basically no rector fixes being made.</p> <h2>Solution</h2> <p>Best: This module should hook into rector's init process to provide our config instead of theirs.</p> <p>Less good: Warn folks that the auto-generated <code>rector.php</code> is good and redirect them to <a href="https://github.com/palantirnet/drupal-rector#create-a-configuration-file-in-your-project">Create a config file in your project</a>.</p>
issue