Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit c73ab37

Browse files
Array rules update
1 parent c981117 commit c73ab37

File tree

1 file changed

+70
-66
lines changed

1 file changed

+70
-66
lines changed

Neuralab/ruleset.xml

Lines changed: 70 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,125 @@
11
<?xml version="1.0"?>
22
<ruleset name="Neuralab">
3-
<description>a.neuralab.coding-standard</description>
4-
5-
<!-- We'll use spaces for indentation! -->
6-
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
7-
8-
<rule ref="WordPress-Core">
9-
10-
<!-- Allow space indent! -->
11-
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
12-
13-
<!-- We like short arrays. -->
14-
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
15-
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
16-
17-
<!-- It's fine. -->
18-
<exclude name="Squiz.PHP.EmbeddedPhp.NoSemicolon" />
19-
20-
<exclude name="WordPress.WhiteSpace.PrecisionAlignment" />
21-
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
22-
3+
<description>
4+
a.neuralab.coding-standard
5+
</description>
6+
<!-- We'll use spaces for indentation! -->
7+
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
8+
<rule ref="WordPress-Core">
9+
<!-- Allow space indent! -->
10+
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
11+
<!-- We like short arrays. -->
12+
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
13+
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
14+
<!-- It's fine. -->
15+
<exclude name="Squiz.PHP.EmbeddedPhp.NoSemicolon" />
16+
<exclude name="WordPress.WhiteSpace.PrecisionAlignment" />
17+
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
18+
<!-- override tab width -->
19+
<exclude name="WordPress.Arrays.ArrayIndentation" />
20+
<rule ref="WordPress.Arrays.ArrayIndentation">
21+
<properties>
22+
<property name="tab-width" value="2" />
23+
</properties>
24+
</rule>
2325
<!-- Exclude other conflicting rules. -->
2426
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
2527
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />
2628
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
27-
2829
<!-- Yoda, say no to. -->
2930
<exclude name="WordPress.PHP.YodaConditions" />
3031
</rule>
31-
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
32-
<rule ref="PEAR.Functions.FunctionCallSignature">
33-
<properties>
34-
<property name="indent" value="2"/>
35-
</properties>
36-
</rule>
37-
<!-- Whitespace - indent with 2 spaces, dissalow tabs -->
38-
<rule ref="Generic.WhiteSpace.ScopeIndent">
39-
<properties>
40-
<property name="indent" value="2"/>
41-
<property name="exact" value="true"/>
42-
<property name="tabIndent" value="false"/>
43-
<property name="ignoreIndentationTokens" type="array" value="T_HEREDOC,T_NOWDOC,T_INLINE_HTML"/>
44-
</properties>
45-
</rule>
46-
47-
<!-- set switch indent to 2 instead of 4 -->
48-
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
49-
<properties>
50-
<property name="indent" value="2"/>
51-
</properties>
52-
</rule>
53-
54-
55-
32+
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
33+
<rule ref="PEAR.Functions.FunctionCallSignature">
34+
<properties>
35+
<property name="indent" value="2" />
36+
</properties>
37+
</rule>
38+
<!-- Whitespace - indent with 2 spaces, dissalow tabs -->
39+
<rule ref="Generic.WhiteSpace.ScopeIndent">
40+
<properties>
41+
<property name="indent" value="2" />
42+
<property name="exact" value="true" />
43+
<property name="tabIndent" value="false" />
44+
<property name="ignoreIndentationTokens" type="array" value="T_HEREDOC,T_NOWDOC,T_INLINE_HTML" />
45+
</properties>
46+
</rule>
47+
<!-- set switch indent to 2 instead of 4 -->
48+
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
49+
<properties>
50+
<property name="indent" value="2" />
51+
</properties>
52+
</rule>
5653
<!-- Prefer alignment over line length. -->
5754
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
5855
<properties>
5956
<property name="maxColumn" value="1000" />
6057
</properties>
6158
</rule>
62-
6359
<rule ref="WordPress.DB.SlowDBQuery" />
64-
6560
<!-- Allow . in hook names. -->
6661
<rule ref="WordPress.NamingConventions.ValidHookName">
6762
<properties>
6863
<property name="additionalWordDelimiters" value="." />
6964
</properties>
7065
</rule>
71-
7266
<rule ref="WordPress.Security.EscapeOutput" />
73-
7467
<rule ref="WordPress.Security.PluginMenuSlug" />
7568
<rule ref="WordPress.Security.PluginMenuSlug.Using__FILE__">
76-
<type>error</type>
69+
<type>
70+
error
71+
</type>
7772
</rule>
78-
7973
<!-- Allow the use of filesystem functions. -->
8074
<rule ref="WordPress.WP.AlternativeFunctions">
8175
<properties>
8276
<property name="exclude" value="file_get_contents,file_system_read" />
8377
<property name="exclude" value="json_encode,json_decode" />
8478
</properties>
8579
</rule>
86-
8780
<rule ref="WordPress.WP.CronInterval" />
8881
<rule ref="WordPress.WP.CronInterval.CronSchedulesInterval">
89-
<type>error</type>
90-
<message>Scheduling crons at %s sec ( less than %s minutes ) is prohibited.</message>
82+
<type>
83+
error
84+
</type>
85+
<message>
86+
Scheduling crons at %s sec ( less than %s minutes ) is prohibited.
87+
</message>
9188
</rule>
92-
9389
<rule ref="WordPress.WP.PostsPerPage" />
9490
<rule ref="WordPress.WP.PostsPerPage.posts_per_page_numberposts">
95-
<type>error</type>
91+
<type>
92+
error
93+
</type>
9694
</rule>
9795
<rule ref="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page">
98-
<type>error</type>
96+
<type>
97+
error
98+
</type>
9999
</rule>
100100
<rule ref="PEAR.Functions.FunctionCallSignature">
101101
<properties>
102-
<property name="allowMultipleArguments" value="true"/>
102+
<property name="allowMultipleArguments" value="true" />
103103
</properties>
104104
</rule>
105105
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
106-
<severity phpcs-only="true">0</severity>
106+
<severity phpcs-only="true">
107+
0
108+
</severity>
107109
</rule>
108110
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
109-
<severity phpcs-only="true">0</severity>
111+
<severity phpcs-only="true">
112+
0
113+
</severity>
110114
</rule>
111-
112115
<!-- Single statement per line. -->
113116
<rule ref="Generic.Formatting.DisallowMultipleStatements" />
114-
115-
<!-- Declare symbols or run code, but not both. -->
116-
<rule ref="PSR1.Files.SideEffects" />
117-
118117
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
119118
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
120119
</rule>
120+
<rule ref="Generic.Arrays.ArrayIndent">
121+
<properties>
122+
<property name="indent" value="2" />
123+
</properties>
124+
</rule>
121125
</ruleset>

0 commit comments

Comments
 (0)