-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
59 lines (43 loc) · 2.06 KB
/
phpcs.xml
File metadata and controls
59 lines (43 loc) · 2.06 KB
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
<?xml version="1.0"?>
<ruleset name="WordPress Code Quality Talk">
<description>PHP_CodeSniffer ruleset for WordPress Code Quality Talk examples</description>
<!-- What to scan -->
<file>./examples</file>
<!-- Exclude vendor and other directories -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<!-- Exclude bad example files (intentionally bad code) -->
<exclude-pattern>*/bad*.php</exclude-pattern>
<!-- Show progress and sniff codes -->
<arg value="ps"/>
<!-- Use colors in output -->
<arg name="colors"/>
<!-- Include the WordPress standard -->
<rule ref="WordPress">
<!-- Allow short array syntax (we're using modern PHP) -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Allow short ternary syntax -->
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
<!-- Allow files without full documentation (these are examples) -->
<exclude name="Squiz.Commenting.FileComment"/>
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Squiz.Commenting.ClassComment"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<!-- Allow mixing functions and classes (examples demonstrate both) -->
<exclude name="Universal.Files.SeparateFunctionsFromOO"/>
<!-- Allow multiple classes per file (examples are compact) -->
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound"/>
<!-- Relax filename requirements for examples -->
<exclude name="WordPress.Files.FileName"/>
<!-- Allow space indentation (examples use spaces for consistency) -->
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- Don't require prefix for examples -->
<exclude name="WordPress.NamingConventions.PrefixAllGlobals"/>
<!-- Allow normal comparison order (disable Yoda conditions) -->
<exclude name="WordPress.PHP.YodaConditions"/>
</rule>
<!-- Check for PHP 8.2+ compatibility -->
<config name="testVersion" value="8.2-"/>
</ruleset>