Skip to content

Conversation

@carlos-granados
Copy link
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

{
public const string DEFAULT_CONFIG_FILE = 'rector.php';

public const string DEFAULT_DIST_CONFIG_FILE = 'rector.dist.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is common fallback file has .php.dist instead of .dist.php?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the .dist.php format because IDEs will automatically recognise them as PHP files. Some tools like phpunit only support the xml.dist format. Others like phpstan support both. PHP-CS-Fixer supports .dist.php. So it seems that there is not a full consensus on this.
I can change this (or support both options) if needed, please let me know

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I will let @TomasVotruba decide on this :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants