Skip to content

Commit

Permalink
WIP | Add new rules to Core ruleset based on Make post
Browse files Browse the repository at this point in the history
Related:
* `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6
* `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4
* `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50

* `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46
* `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58

* `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72

* `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174
* `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65

* `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
  • Loading branch information
jrfnl committed Sep 11, 2022
1 parent 7811e97 commit f245203
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions WordPress-Core/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,32 @@
<rule ref="Generic.PHP.BacktickOperator"/>


<!--
HANDBOOK NEEDS ADJUSTING
-->
<!-- Covers rule: There should be only one namespace declaration per file. -->
<rule ref="Universal.Namespaces.OneDeclarationPerFile"/>

<!-- Covers rules:
Namespace declaration using the curly brace block syntax are not allowed.
Namespace declarations without name (= explicit global namespace) are not allowed.
(as those can only be created using the curly brace block syntax).
-->
<rule ref="Universal.Namespaces.DisallowCurlyBraceSyntax"/>

<!-- Covers rule: Namespace declarations without name (= explicit global namespace) are not allowed. -->
<rule ref="Universal.Namespaces.DisallowDeclarationWithoutName"/>


<!-- Covers rule: Names in an import use statement should not start with a leading backslash. -->
<rule ref="Universal.UseStatements.NoLeadingBackslash"/>

<!-- Covers rule: The use, function, const and as keywords should be lowercase.
This is partially already covered via Generic.PHP.LowerCaseKeyword
-->
<rule ref="Universal.UseStatements.LowercaseFunctionConst"/>


<!--
#############################################################################
Not in the handbook: Generic sniffs.
Expand Down

0 comments on commit f245203

Please sign in to comment.