diff --git a/README.md b/README.md index d59b7ff..6d18219 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,20 @@ Acquia Coding Standards for PHP includes a selection of sniffs from the followin ## Rulesets -Rules are split into rulesets according to the project language and framework: +Rules are split into rulesets according to the project *framework* and *visibility*: + +* Projects (e.g., Drupal modules) targeting the Drupal community should adopt a *Drupal* ruleset. All others should adopt a general *PHP* ruleset. +* Public projects (e.g., open-source Drupal modules) should adopt a *non-strict* ruleset to facilitate external collaboration. All others should adopt a more opinionated *internal* ruleset. + +There are four permutations of these guidelines, leading to four rulesets to choose from: + +* [AcquiaPHP](src/Standards/AcquiaPHP/ruleset.xml) is based on PSR-12 and is intended for use on all public non-Drupal projects. +* [AcquiaPHPStrict](src/Standards/AcquiaPHPStrict/ruleset.xml) is based on AcquiaPHP and adds additional more opinionated standards. It is intended for use on all internal non-Drupal projects. +* [AcquiaDrupal](src/Standards/AcquiaDrupal/ruleset.xml) is based on the Drupal coding standard and is intended for use on all public Drupal projects. +* [AcquiaDrupalStrict](src/Standards/AcquiaDrupalStrict/ruleset.xml) is based on AcquiaDrupal and adds the more opinionated DrupalPractice standard. It is intended for use on all internal Drupal projects. + +There is one additional ruleset intended to maintain backwards compatibility between major releases: -* [AcquiaPHP](src/Standards/AcquiaPHP/ruleset.xml) contains sniffs applicable to all PHP projects. -* [AcquiaDrupalStrict](src/Standards/AcquiaDrupalStrict/ruleset.xml) incorporates AcquiaPHP and adds all Drupal coding standards and best practices sniffs. Recommended for new Drupal projects and teams familiar with Drupal coding standards. -* [AcquiaDrupalTransitional](src/Standards/AcquiaDrupalTransitional/ruleset.xml) incorporates AcquiaPHP and adds Drupal core's own phpcs configuration, which is less strict than the official standards. Recommended for legacy Drupal codebases or teams new to Drupal coding standards. * [AcquiaEdge](src/Standards/AcquiaEdge/ruleset.xml) incorporates AcquiaPHP and adds backwards-incompatible sniffs that will be included in AcquiaPHP with the next major release of this package. ## Installation & usage diff --git a/example/phpcs.xml.dist b/example/phpcs.xml.dist index 216045c..91fcea8 100644 --- a/example/phpcs.xml.dist +++ b/example/phpcs.xml.dist @@ -8,7 +8,8 @@ - + + diff --git a/src/Standards/AcquiaDrupalTransitional/ruleset.xml b/src/Standards/AcquiaDrupal/ruleset.xml similarity index 52% rename from src/Standards/AcquiaDrupalTransitional/ruleset.xml rename to src/Standards/AcquiaDrupal/ruleset.xml index 0159dc0..47c2d0e 100644 --- a/src/Standards/AcquiaDrupalTransitional/ruleset.xml +++ b/src/Standards/AcquiaDrupal/ruleset.xml @@ -3,10 +3,10 @@ - Acquia's transitional Drupal coding standards. + Acquia's Drupal coding standards. @@ -32,22 +32,4 @@ - - - - - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - diff --git a/src/Standards/AcquiaDrupalStrict/ruleset.xml b/src/Standards/AcquiaDrupalStrict/ruleset.xml index 4fac5fe..3679d6e 100644 --- a/src/Standards/AcquiaDrupalStrict/ruleset.xml +++ b/src/Standards/AcquiaDrupalStrict/ruleset.xml @@ -9,45 +9,9 @@ Acquia's strict Drupal coding standards. - - - - - - tests/* - - - tests/* - - - tests/* - - - tests/* - - - tests/* - + - - - - - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - - */modules/custom/*/*\.(module|install)$ - - diff --git a/src/Standards/AcquiaPHP/ruleset.xml b/src/Standards/AcquiaPHP/ruleset.xml index 3041e70..8e8e878 100644 --- a/src/Standards/AcquiaPHP/ruleset.xml +++ b/src/Standards/AcquiaPHP/ruleset.xml @@ -8,35 +8,7 @@ Acquia's PHP coding standards. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -44,53 +16,6 @@ *.(md|txt|yml) - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Standards/AcquiaPHPStrict/ruleset.xml b/src/Standards/AcquiaPHPStrict/ruleset.xml new file mode 100644 index 0000000..1c7f7ad --- /dev/null +++ b/src/Standards/AcquiaPHPStrict/ruleset.xml @@ -0,0 +1,22 @@ + + + + + + Acquia's strict PHP coding standards. + + + + + + + + + + + +