From f4b798ed21005e32067fba8e73b8ec96117435b4 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 28 Jul 2016 20:10:03 +0200 Subject: [PATCH] Order the `core` ruleset according to the handbook. This PR does not add or remove any new rules, it just re-orders the core ruleset to follow the handbook and documents the rules as they are in the handbook - both covered and not covered. Closes #602 For any core rules which are not yet covered, but *could* possibly *be* covered, a new issue has been opened if one didn't exist already and the link to the issue is included in the ruleset. Rules included, but not (explicitly) covered in the handbook are listed in their own section at the bottom of the ruleset. I've made three changes which should be noted: * Removed the `WordPress.WP.I18n` sniff from the `extra` ruleset as it is included in the `core` ruleset and `core` is included in `extra`. * Moved the `WordPress.WP.PreparedSQL` sniff from `extra` to `core` as the checks included in that sniff are actually part of the core rules. * Moved the `Generic.PHP.Syntax` to `extra` as IRL often enough there will be code which will only be loaded for higher PHP versions with a wrapper and fall-backs for lower PHP versions. Feedback welcome. Review is probably easiest by just looking at the new version of the file as the diff will be horrible ;-) --- WordPress-Core/ruleset.xml | 407 +++++++++++++++++++++++++----------- WordPress-Extra/ruleset.xml | 10 +- 2 files changed, 295 insertions(+), 122 deletions(-) diff --git a/WordPress-Core/ruleset.xml b/WordPress-Core/ruleset.xml index 47b56b68de..ae39cc8960 100644 --- a/WordPress-Core/ruleset.xml +++ b/WordPress-Core/ruleset.xml @@ -2,123 +2,294 @@ Non-controversial generally-agreed upon WordPress Coding Standards - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WordPress-Extra/ruleset.xml b/WordPress-Extra/ruleset.xml index f7853ab8c2..b4f6cf0f27 100644 --- a/WordPress-Extra/ruleset.xml +++ b/WordPress-Extra/ruleset.xml @@ -15,11 +15,11 @@ - + - + @@ -30,11 +30,13 @@ - - + + + +