|
8 | 8 | <include-pattern>*\.php$</include-pattern> |
9 | 9 | </rule> |
10 | 10 |
|
11 | | - <!-- Load WordPress VIP Go standards - for use with projects on the (newer) VIP Go platform. --> |
| 11 | + <!-- |
| 12 | + Load WordPress VIP Go standards |
| 13 | + see: https://docs.wpvip.com/technical-references/vip-code-analysis-bot/phpcs-report/ |
| 14 | + --> |
12 | 15 | <rule ref="WordPress-VIP-Go" /> |
13 | 16 |
|
14 | | - <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/> |
15 | | - |
16 | | - <rule ref="WordPress-Core"> |
| 17 | + <rule ref="WordPress"> |
| 18 | + <!-- Definitely should not be added back --> |
17 | 19 | <exclude name="Generic.Arrays.DisallowShortArraySyntax"/> |
| 20 | + <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/> |
| 21 | + <exclude name="WordPress.Files.FileName"/> |
| 22 | + <exclude name="WordPress.NamingConventions.ValidVariableName"/> |
| 23 | + <exclude name="WordPress.PHP.DisallowShortTernary.Found"/> |
18 | 24 |
|
19 | 25 | <!-- Should probably not be added back --> |
20 | 26 | <exclude name="PHPCompatibility.Keywords.ForbiddenNamesAsDeclared.objectFound"/> |
| 27 | + <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/> |
21 | 28 |
|
22 | 29 | <!-- Added back in WPGraphQL-Strict --> |
23 | | - <exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/> |
24 | | - <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/> |
25 | 30 | <exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/> |
| 31 | + <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/> |
26 | 32 | <exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments"/> |
27 | | - </rule> |
28 | | - |
29 | | - <!-- Load WordPress Coding standards --> |
30 | | - <rule ref="WordPress"> |
31 | | - <exclude name="WordPress.NamingConventions.ValidVariableName"/> |
32 | | - <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/> |
33 | | - <exclude name="WordPress.Files.FileName"/> |
34 | | - |
35 | | - <!-- Definitely should not be added back --> |
36 | | - <exclude name="WordPress.PHP.DisallowShortTernary.Found"/> |
37 | | - <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/> |
38 | | - |
39 | | - <!-- Added back in WPGraphQL-Strict --> |
| 33 | + <!-- This would be a breaking change to fix in Core --> |
40 | 34 | <exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/> |
41 | | - <exclude name="WordPress.DateTime.RestrictedFunctions.date_date"/> |
42 | 35 | </rule> |
43 | 36 |
|
44 | 37 | <!-- Tests for inline documentation of code --> |
|
52 | 45 | <!-- Enforce short array syntax --> |
53 | 46 | <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
54 | 47 |
|
55 | | - <!-- Enforce FQCN in comments --> |
56 | | - <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/> |
57 | | - <!-- Enforce static closures --> |
| 48 | + <!-- |
| 49 | + Slevomat sniffs |
| 50 | + See: https://github.com/slevomat/coding-standard/tree/master#alphabetical-list-of-sniffs |
| 51 | + --> |
| 52 | + <rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" /> |
| 53 | + <rule ref="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion" /> |
| 54 | + <rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants" /> |
| 55 | + <rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition" /> |
| 56 | + <rule ref="SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition" /> |
| 57 | + <rule ref="SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch" /> |
| 58 | + <rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" /> |
| 59 | + |
| 60 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" /> |
| 61 | + |
58 | 62 | <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
| 63 | + <rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" /> |
| 64 | + <rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" /> |
| 65 | + |
| 66 | + <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/> |
| 67 | + <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" /> |
| 68 | + |
| 69 | + <rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" /> |
| 70 | + <rule ref="SlevomatCodingStandard.PHP.TypeCast" /> |
| 71 | + |
| 72 | + <rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" /> |
| 73 | + |
59 | 74 | </ruleset> |
0 commit comments