|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <ruleset name="Inpsyde Coding Standard"> |
3 | 3 |
|
4 | | - <description>PHP 7+ coding standards for Inpsyde WordPress projects.</description> |
| 4 | + <description>PHP 7+ coding standards for Inpsyde WordPress projects.</description> |
5 | 5 |
|
6 | 6 | <autoload>./Inpsyde/Helpers.php</autoload> |
7 | 7 | <autoload>./Inpsyde/PHPCSAliases.php</autoload> |
8 | 8 |
|
9 | 9 | <file>./Inpsyde/Sniffs/CodeQuality</file> |
10 | 10 |
|
11 | | - <!-- |
12 | | - PHP 7.0 and higher. |
13 | | - --> |
14 | | - <config name="testVersion" value="7.0-"/> |
| 11 | + <!-- |
| 12 | + PHP 7.0 and higher. |
| 13 | + --> |
| 14 | + <config name="testVersion" value="7.0-"/> |
15 | 15 |
|
16 | | - <!-- |
17 | | - Arguments: colors, show progress and show sniff name. |
18 | | - --> |
19 | | - <arg name="colors"/> |
20 | | - <arg value="sp"/> |
| 16 | + <!-- |
| 17 | + Arguments: colors, show progress and show sniff name. |
| 18 | + --> |
| 19 | + <arg name="colors"/> |
| 20 | + <arg value="sp"/> |
21 | 21 |
|
22 | | - <!-- |
23 | | - PSR 2 Code style. |
24 | | - See http://www.php-fig.org/psr/psr-2/ |
25 | | - --> |
| 22 | + <!-- |
| 23 | + PSR 2 Code style. |
| 24 | + See http://www.php-fig.org/psr/psr-2/ |
| 25 | + --> |
26 | 26 | <rule ref="PSR2"> |
27 | 27 | <exclude name="Generic.Files.LineLength.TooLong"/> |
28 | 28 | </rule> |
29 | 29 |
|
30 | | - <!-- |
31 | | - Some sanity in variables. |
32 | | - See https://github.com/sirbrillig/phpcs-variable-analysis |
33 | | - --> |
34 | | - <rule ref="VariableAnalysis"/> |
| 30 | + <!-- |
| 31 | + Some sanity in variables. |
| 32 | + See https://github.com/sirbrillig/phpcs-variable-analysis |
| 33 | + --> |
| 34 | + <rule ref="VariableAnalysis"/> |
35 | 35 |
|
36 | | - <!-- |
37 | | - Neutron standard are quality tools for PHP7 development from Automattic. |
38 | | - See https://github.com/Automattic/phpcs-neutron-standard |
39 | | - --> |
40 | | - <rule ref="NeutronStandard"> |
41 | | - <exclude name="NeutronStandard.Functions.LongFunction"/> |
42 | | - <exclude name="NeutronStandard.Functions.VariableFunctions"/> |
43 | | - <exclude name="NeutronStandard.Functions.TypeHint"/> |
44 | | - </rule> |
| 36 | + <!-- |
| 37 | + Neutron standard are quality tools for PHP7 development from Automattic. |
| 38 | + See https://github.com/Automattic/phpcs-neutron-standard |
| 39 | + --> |
| 40 | + <rule ref="NeutronStandard"> |
| 41 | + <exclude name="NeutronStandard.Functions.LongFunction"/> |
| 42 | + <exclude name="NeutronStandard.Functions.VariableFunctions"/> |
| 43 | + <exclude name="NeutronStandard.Functions.TypeHint"/> |
| 44 | + </rule> |
45 | 45 |
|
46 | 46 | <!-- |
47 | 47 | Some WordPress specific rules. |
|
55 | 55 | <type>error</type> |
56 | 56 | </rule> |
57 | 57 |
|
58 | | - <!-- |
59 | | - No commented-out code, please. Let version control do its job. |
60 | | - --> |
61 | | - <rule ref="Squiz.PHP.CommentedOutCode"> |
62 | | - <properties> |
63 | | - <property name="maxPercentage" value="45"/> |
64 | | - </properties> |
65 | | - </rule> |
| 58 | + <!-- |
| 59 | + Generic |
| 60 | + --> |
| 61 | + <rule ref="Generic.Metrics.CyclomaticComplexity"> |
| 62 | + <properties> |
| 63 | + <property name="absoluteComplexity" value="50"/> |
| 64 | + </properties> |
| 65 | + </rule> |
| 66 | + <rule ref="Generic.Metrics.NestingLevel"> |
| 67 | + <properties> |
| 68 | + <property name="nestingLevel" value="2"/> |
| 69 | + <property name="absoluteNestingLevel" value="4"/> |
| 70 | + </properties> |
| 71 | + </rule> |
| 72 | + <rule ref="Generic.NamingConventions.ConstructorName"/> |
| 73 | + <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/> |
| 74 | + <rule ref="Generic.PHP.LowerCaseConstant"/> |
| 75 | + <rule ref="Squiz.Classes.LowercaseClassKeywords"/> |
| 76 | + <rule ref="Squiz.PHP.CommentedOutCode"> |
| 77 | + <properties> |
| 78 | + <property name="maxPercentage" value="45"/> |
| 79 | + </properties> |
| 80 | + </rule> |
| 81 | + <rule ref="Squiz.PHP.Eval"/> |
| 82 | + <rule ref="Squiz.PHP.InnerFunctions"/> |
| 83 | + <rule ref="Squiz.PHP.LowercasePHPFunctions"/> |
| 84 | + <rule ref="Squiz.PHP.NonExecutableCode"/> |
| 85 | + <rule ref="Squiz.Scope.MemberVarScope"/> |
| 86 | + <rule ref="Squiz.Scope.StaticThisUsage"/> |
66 | 87 |
|
67 | | - <!-- |
68 | | - Use own styles :) |
69 | | - --> |
70 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php"/> |
71 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/ForbiddenPublicPropertySniff.php"/> |
72 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php"/> |
73 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php"/> |
74 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/MaxNestingLevelSniff.php"/> |
75 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/NoElseSniff.php"/> |
76 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/NoSetterSniff.php"/> |
77 | | - <rule ref="./Inpsyde/Sniffs/CodeQuality/PropertyPerClassLimitSniff.php"/> |
| 88 | + <!-- |
| 89 | + Use own styles :) |
| 90 | + --> |
| 91 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/ArgumentTypeDeclarationSniff.php"/> |
| 92 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/DisallowShortOpenTagSniff.php"/> |
| 93 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php"/> |
| 94 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/ForbiddenPublicPropertySniff.php"/> |
| 95 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php"/> |
| 96 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/HookClosureReturnSniff.php"/> |
| 97 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php"/> |
| 98 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/NoElseSniff.php"/> |
| 99 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/NoSetterSniff.php"/> |
| 100 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/PropertyPerClassLimitSniff.php"/> |
| 101 | + <rule ref="./Inpsyde/Sniffs/CodeQuality/ReturnTypeDeclarationSniff.php"/> |
78 | 102 |
|
79 | 103 | </ruleset> |
0 commit comments