-
Notifications
You must be signed in to change notification settings - Fork 6
/
phpcs.ruleset.xml
48 lines (43 loc) · 1.9 KB
/
phpcs.ruleset.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?>
<ruleset>
<!-- Scan only PHP files -->
<arg name="extensions" value="php"/>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show progress -->
<arg value="p"/>
<!-- Be quiet -->
<arg value="q"/>
<!-- Include source codes in the report -->
<arg value="s"/>
<!-- Use HM Coding Standards -->
<rule ref="vendor/humanmade/coding-standards">
<!-- Disable all ESLint checks -->
<exclude name="HM.Debug.ESLint"/>
<!-- Disable rules we disagree with -->
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar"/>
<!-- though it can live in a WP environment, it is not a WP application -->
<exclude name="WordPress.WP.AlternativeFunctions"/>
<exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification"/>
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log"/>
</rule>
<!-- Re-enable rules we agree with -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<!-- Disable Namespaced Functions for vendors -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/cache/*</exclude-pattern>
<!-- would like to maintain WP independence -->
<rule ref="WordPress.DB.RestrictedClasses.mysql__PDO">
<exclude-pattern>/inc/models/class-webform.php</exclude-pattern>
</rule>
<!-- no php code in partials -->
<rule ref="Internal.NoCodeFound">
<exclude-pattern>/assets/templates/partial/*</exclude-pattern>
</rule>
<!-- line endings for CSV -->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>/inc/controllers/reviews/</exclude-pattern>
</rule>
</ruleset>