-
Notifications
You must be signed in to change notification settings - Fork 135
/
phpcs.xml
142 lines (109 loc) · 5.87 KB
/
phpcs.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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0"?>
<ruleset name="LifterLMS Core">
<description>LifterLMS Rules for PHP_CodeSniffer</description>
<file>.</file>
<!-- Exclude project directories -->
<exclude-pattern>.bin/</exclude-pattern>
<exclude-pattern>.config/</exclude-pattern>
<exclude-pattern>.github/</exclude-pattern>
<exclude-pattern>.wordpress-org/</exclude-pattern>
<!-- Exclude compile or minified JS files -->
<exclude-pattern>assets/js/llms.js</exclude-pattern>
<exclude-pattern>assets/js/llms-admin-addons.js</exclude-pattern>
<exclude-pattern>assets/js/llms-admin-certificate-editor.js</exclude-pattern>
<exclude-pattern>assets/js/llms-builder.js</exclude-pattern>
<exclude-pattern>assets/js/llms-components.js</exclude-pattern>
<exclude-pattern>assets/js/llms-icons.js</exclude-pattern>
<exclude-pattern>assets/js/llms-metaboxes.js</exclude-pattern>
<exclude-pattern>assets/js/llms-spinner.js</exclude-pattern>
<exclude-pattern>blocks/**/*.js</exclude-pattern>
<!-- Exclude PHP asset files -->
<exclude-pattern>*.asset.php</exclude-pattern>
<!-- Let ESLint handle ESNext JS -->
<exclude-pattern type="relative">src/**/*</exclude-pattern>
<exclude-pattern>webpack.config.js</exclude-pattern>
<!-- Exclude node packages -->
<exclude-pattern>packages/</exclude-pattern>
<!-- Exclude external libraries -->
<exclude-pattern>libraries/</exclude-pattern>
<!-- Exclude deprecated/legacy files -->
<exclude-pattern>includes/functions/llms-functions-deprecated.php</exclude-pattern>
<!-- Exclude locale files that take forever to process -->
<exclude-pattern>languages/*.php</exclude-pattern>
<!-- Allow dynamic styles on the certificate template. -->
<rule ref="WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet">
<exclude-pattern>templates/certificates/dynamic-styles.php</exclude-pattern>
</rule>
<rule ref="LifterLMS">
<!-- @todo: Apply coding standards to js -->
<exclude-pattern>assets/js/*.js</exclude-pattern>
<!-- @todo: Fix docs and comments to adhere to these rules -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Generic.Commenting.DocComment.ShortNotCapital" />
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamName" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturnVoid" />
<!-- @todo: Update these to use a prefix, see https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace -->
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited" />
<!-- @todo: extract is messy you're right, fix this -->
<exclude name="WordPress.PHP.DontExtract.extract_extract" />
<!-- @todo: Most core files break this rule. -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- @todo: This needs to be adjusted since WP 5.3 -->
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date" />
<!-- These templates follow WP Template style so they're okay -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>templates/taxonomy-*.php</exclude-pattern>
</exclude>
<!-- This rule is for PHP versions less than 7.3, but we require an higher PHP version. -->
<exclude name="PHPCompatibility.Classes.NewTypedProperties.Found" />
</rule>
<!--
@todo The following 3 rule sets are disabled for the following files/directories
We are in the process of gradually fixing these in bulk.
See https://github.com/gocodebox/lifterlms/issues/946
-->
<rule ref="LifterLMS.Commenting.FileComment">
<exclude-pattern>includes/admin/views/*.php</exclude-pattern>
<exclude-pattern>includes/admin/views/**/*.php</exclude-pattern>
<exclude-pattern>templates/*.php</exclude-pattern>
<exclude-pattern>templates/**/*.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment">
<exclude-pattern>includes/admin/views/*.php</exclude-pattern>
<exclude-pattern>includes/admin/views/**/*.php</exclude-pattern>
<exclude-pattern>templates/*.php</exclude-pattern>
<exclude-pattern>templates/**/*.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>includes/admin/views/*.php</exclude-pattern>
<exclude-pattern>includes/admin/views/**/*.php</exclude-pattern>
<exclude-pattern>templates/*.php</exclude-pattern>
<exclude-pattern>templates/**/*.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<!-- To be fixed -->
<exclude-pattern>includes/notifications/class.llms.notifications.query.php</exclude-pattern>
<exclude-pattern>includes/privacy/class-llms-privacy-exporters.php</exclude-pattern>
<exclude-pattern>includes/privacy/class-llms-privacy.php</exclude-pattern>
<exclude-pattern>includes/processors/class.llms.processor.membership.bulk.enroll.php</exclude-pattern>
<exclude-pattern>includes/processors/class.llms.processor.table.to.csv.php</exclude-pattern>
<exclude-pattern>includes/shortcodes/class.llms.shortcode.course.outline.php</exclude-pattern>
<exclude-pattern>includes/shortcodes/class.llms.shortcode.hide.content.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.I18n">
<!-- @todo: Fix all of these -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<properties>
<property name="text_domain" value="lifterlms" />
</properties>
</rule>
<!-- @todo: Fix these issues. -->
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops.Found">
<exclude-pattern>assets/js/*.js</exclude-pattern>
</rule>
</ruleset>