10up / phpcs-composer

Official 10up PHPCS rules.
MIT License
49 stars 8 forks source link

Readme: suggest using `.phpcs.xml.dist` rather than `phpcs.xml` file for repo rulesets #13

Closed jrfnl closed 6 years ago

jrfnl commented 6 years ago

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:

  1. .phpcs.xml
  2. phpcs.xml
  3. .phpcs.xml.dist
  4. phpcs.xml.dist

References: