Using a .dist file for a repo ruleset allows for individual developers to overrule the ruleset with a custom version (without the .dist file extension).
This makes testing of new additions/changes to the ruleset easier.
The master ruleset can be imported into a custom ruleset by using <rule ref="./.phpcs.xml.dist"/>.
Since PHPCS 3.1.0, it is also possible to use dot-prefixed files for the PHPCS config, allowing these files to be sorted with other configuration related files.
The loading order of the ruleset files in PHPCS, as of version 3.1.1, is:
Using a
.dist
file for a repo ruleset allows for individual developers to overrule the ruleset with a custom version (without the.dist
file extension). This makes testing of new additions/changes to the ruleset easier. The master ruleset can be imported into a custom ruleset by using<rule ref="./.phpcs.xml.dist"/>
.Since PHPCS 3.1.0, it is also possible to use dot-prefixed files for the PHPCS config, allowing these files to be sorted with other configuration related files.
The loading order of the ruleset files in PHPCS, as of version 3.1.1, is:
.phpcs.xml
phpcs.xml
.phpcs.xml.dist
phpcs.xml.dist
References: