Skip to content

Commit

Permalink
Use a better ruleset.
Browse files Browse the repository at this point in the history
Note:
* As the WordPress ruleset includes all WP sniffs, specific sniffs which were not in the VIP ruleset don't need to be included separately anymore.
* As the WordPress ruleset includes the Docs ruleset, no need to include it separately. The related rule exclusions have been moved up to the main ruleset inclusion block (except for the scalar type hint one as that is no longer needed).
* The GlobalVariables sniff was intended to be added, but commented out for bugs. As it will now be automatically included as the ruleset has changed, it will need to be explicitely excluded. The exclusion can be removed once WPCS 0.11.0 has been released which fixes all known bugs in that sniff.
  • Loading branch information
jrfnl committed Jan 12, 2017
1 parent e9d5e05 commit 7170dc1
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions Yoast/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description>Yoast Coding Standards</description>

<!-- ##### WordPress sniffs #####-->
<rule ref="WordPress-VIP">
<rule ref="WordPress">
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
<!-- Some calls just too quirky and complicated for this. -->
Expand Down Expand Up @@ -33,20 +33,21 @@

<!-- Turned off because of known & reported bugs in the Sniffs, should be turned on once the bugs are fixed. -->
<exclude name="WordPress.VIP.ValidatedSanitizedInput"/>

<!-- Turned off because of known & reported bugs in the Sniffs, should be turned on once the bugs are fixed. -->
<!-- Exclusion can be removed once the WPCS 0.11.0 has been released - in which the bugs have been fixed -
and the the minimum WPCS version required by Yoast CS has been upped to 0.11.0. -->
<exclude name="WordPress.Variables.GlobalVariables"/><!-- WPCS #300 -->

<!-- Catches way too many things, like vars and file headers. -->
<exclude name="Generic.Commenting.DocComment.MissingShort" />
</rule>

<rule ref="WordPress.NamingConventions">
<!-- complains about core cat_ID -->
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
</rule>

<!-- Rules from WP-Extra which are not in WP-VIP -->
<rule ref="WordPress.PHP.DiscouragedFunctions"/>
<rule ref="WordPress.WP.EnqueuedResources" />

<!-- Turned off because of known & reported bugs in the Sniffs, should be turned on once the bugs are fixed. -->
<!--<rule ref="WordPress.Variables.GlobalVariables"/>--><!-- WPCS #300 -->

<!-- ##### Sniffs for PHP cross-version compatibility ##### -->
<!-- Requires CodeSniffer <2.0 at the moment, conflicts with other packages -->
<!--<rule ref="PHPCompatibility"/>-->
Expand Down Expand Up @@ -92,14 +93,7 @@
<!-- Should be turned on, but gives issue with current codebase -->
<!--<rule ref="Generic.CodeAnalysis.EmptyStatement" />-->

<!-- ##### Documentation Sniffs ##### -->

<rule ref="WordPress-Docs">
<!-- Catches way too many things, like vars and file headers. -->
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<!-- PHP 7 -->
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing" />
</rule>
<!-- ##### Documentation Sniffs vs empty index files ##### -->

<!-- exclude the 'empty' index files from some documentation checks -->
<rule ref="Squiz.Commenting.FileComment">
Expand Down

0 comments on commit 7170dc1

Please sign in to comment.