-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathphpcs.xml.dist
102 lines (84 loc) · 4.18 KB
/
phpcs.xml.dist
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?xml version="1.0"?>
<ruleset name="Gravity PDF">
<description>Customise the WordPress Coding Standard</description>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache"/>
<!-- Set the memory limit to 256M.
For most standard PHP configurations, this means the memory limit will temporarily be raised.
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings
-->
<ini name="memory_limit" value="256M"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>
<!-- Show sniff codes in all reports -->
<arg value="ps"/>
<file>.</file>
<!-- Add generic PHP Linting Rule -->
<rule ref="Generic.PHP.Syntax"/>
<!-- Include the WordPress Extra ruleset for best practice -->
<rule ref="WordPress-Extra">
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.PHP.YodaConditions"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
<exclude name="Universal.WhiteSpace.PrecisionAlignment"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fopen"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fread"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fclose"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<exclude name="PSR12.Files.FileHeader.IncorrectOrder"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed"/>
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<!-- Include the best parts of PSR-1 -->
<rule ref="PSR1.Classes.ClassDeclaration">
<exclude-pattern>/pdf.php</exclude-pattern>
<exclude-pattern>/api.php</exclude-pattern>
<exclude-pattern>/src/deprecated.php</exclude-pattern>
<exclude-pattern>/src/controller/Controller_Activation.php</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.ByteOrderMark"/>
<!-- Customise the WordPress Core Rules -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
</rule>
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_wp_version" value="4.8"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="gravity-pdf, gravityforms, default"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="space_before_colon" value="forbidden"/>
</properties>
</rule>
<!-- For if: else: endif: ruleset -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.SpaceBetweenStructureColon">
<exclude-pattern>/src/*.php</exclude-pattern>
</rule>
<!-- Exclude a bunch of directories -->
<exclude-pattern>/wordpress/*</exclude-pattern>
<exclude-pattern>/tmp/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/vendor_prefixed/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/src/helper/licensing/EDD_SL_Plugin_Updater.php</exclude-pattern>
<exclude-pattern>/.php-scoper/*</exclude-pattern>
</ruleset>