Skip to content

Allow using a canonical dist file - #7845

Merged
TomasVotruba merged 1 commit into
rectorphp:mainfrom
carlos-granados:add-canonical-configuration
Feb 3, 2026
Merged

Allow using a canonical dist file#7845
TomasVotruba merged 1 commit into
rectorphp:mainfrom
carlos-granados:add-canonical-configuration

Conversation

@carlos-granados

Copy link
Copy Markdown
Contributor

Most code quality/testing tools allow you to have a "canonical" (dist) config file which is stored in the repository and a local config file which replaces/extends the canonical file, allowing you to have a base configuration which is shared by all users and which can be overridden locally

This PR adds this capability to Rector. Rector will load a rector.php file if it exists but will also use a rector.dist.php file if the rector.php file does not exist

Adds two new end-to-end tests that check this new functionality

Comment thread src/Bootstrap/RectorConfigsResolver.php
@TomasVotruba

Copy link
Copy Markdown
Member

Let's ship this, thank you 👍

@TomasVotruba
TomasVotruba merged commit a134f6a into rectorphp:main Feb 3, 2026
64 of 65 checks passed
@dcs-61b676b2a0

Copy link
Copy Markdown

The documentation uses rector.php.

Should it default to rector.dist.php?
Should the generation question be changed? (Type N,n,NO,no not to generate, enter to generate rector.dist.php, other option is to type rector.php or any other filename.)

Perhaps, if something like it is available, a link referencing an explanation of the practice of the .dist interfix could be added to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants