|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <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> |
23 | 25 | <!-- Exclude other conflicting rules. --> |
24 | 26 | <exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" /> |
25 | 27 | <exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" /> |
26 | 28 | <exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" /> |
27 | | - |
28 | 29 | <!-- Yoda, say no to. --> |
29 | 30 | <exclude name="WordPress.PHP.YodaConditions" /> |
30 | 31 | </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> |
56 | 53 | <!-- Prefer alignment over line length. --> |
57 | 54 | <rule ref="WordPress.Arrays.MultipleStatementAlignment"> |
58 | 55 | <properties> |
59 | 56 | <property name="maxColumn" value="1000" /> |
60 | 57 | </properties> |
61 | 58 | </rule> |
62 | | - |
63 | 59 | <rule ref="WordPress.DB.SlowDBQuery" /> |
64 | | - |
65 | 60 | <!-- Allow . in hook names. --> |
66 | 61 | <rule ref="WordPress.NamingConventions.ValidHookName"> |
67 | 62 | <properties> |
68 | 63 | <property name="additionalWordDelimiters" value="." /> |
69 | 64 | </properties> |
70 | 65 | </rule> |
71 | | - |
72 | 66 | <rule ref="WordPress.Security.EscapeOutput" /> |
73 | | - |
74 | 67 | <rule ref="WordPress.Security.PluginMenuSlug" /> |
75 | 68 | <rule ref="WordPress.Security.PluginMenuSlug.Using__FILE__"> |
76 | | - <type>error</type> |
| 69 | + <type> |
| 70 | + error |
| 71 | + </type> |
77 | 72 | </rule> |
78 | | - |
79 | 73 | <!-- Allow the use of filesystem functions. --> |
80 | 74 | <rule ref="WordPress.WP.AlternativeFunctions"> |
81 | 75 | <properties> |
82 | 76 | <property name="exclude" value="file_get_contents,file_system_read" /> |
83 | 77 | <property name="exclude" value="json_encode,json_decode" /> |
84 | 78 | </properties> |
85 | 79 | </rule> |
86 | | - |
87 | 80 | <rule ref="WordPress.WP.CronInterval" /> |
88 | 81 | <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> |
91 | 88 | </rule> |
92 | | - |
93 | 89 | <rule ref="WordPress.WP.PostsPerPage" /> |
94 | 90 | <rule ref="WordPress.WP.PostsPerPage.posts_per_page_numberposts"> |
95 | | - <type>error</type> |
| 91 | + <type> |
| 92 | + error |
| 93 | + </type> |
96 | 94 | </rule> |
97 | 95 | <rule ref="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page"> |
98 | | - <type>error</type> |
| 96 | + <type> |
| 97 | + error |
| 98 | + </type> |
99 | 99 | </rule> |
100 | 100 | <rule ref="PEAR.Functions.FunctionCallSignature"> |
101 | 101 | <properties> |
102 | | - <property name="allowMultipleArguments" value="true"/> |
| 102 | + <property name="allowMultipleArguments" value="true" /> |
103 | 103 | </properties> |
104 | 104 | </rule> |
105 | 105 | <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"> |
106 | | - <severity phpcs-only="true">0</severity> |
| 106 | + <severity phpcs-only="true"> |
| 107 | + 0 |
| 108 | + </severity> |
107 | 109 | </rule> |
108 | 110 | <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"> |
109 | | - <severity phpcs-only="true">0</severity> |
| 111 | + <severity phpcs-only="true"> |
| 112 | + 0 |
| 113 | + </severity> |
110 | 114 | </rule> |
111 | | - |
112 | 115 | <!-- Single statement per line. --> |
113 | 116 | <rule ref="Generic.Formatting.DisallowMultipleStatements" /> |
114 | | - |
115 | | - <!-- Declare symbols or run code, but not both. --> |
116 | | - <rule ref="PSR1.Files.SideEffects" /> |
117 | | - |
118 | 117 | <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> |
119 | 118 | <exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" /> |
120 | 119 | </rule> |
| 120 | + <rule ref="Generic.Arrays.ArrayIndent"> |
| 121 | + <properties> |
| 122 | + <property name="indent" value="2" /> |
| 123 | + </properties> |
| 124 | + </rule> |
121 | 125 | </ruleset> |
0 commit comments