-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
84 lines (71 loc) · 3.63 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
84 lines (71 loc) · 3.63 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
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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Sherv Plugin Foundation">
<description>Sniffs for the Sherv Plugin Foundation library, following WordPress and WP VIP standards</description>
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- What to scan -->
<file>./src</file>
<file>./tests</file>
<!-- Ignoring Files and Folders:
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/coverage/*</exclude-pattern>
<exclude-pattern>/.cache/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- How to scan -->
<!-- Strip the file paths down to the relevant bit -->
<arg name="basepath" value="."/>
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="20"/>
<!-- Limit to PHP files -->
<arg name="extensions" value="php"/>
<arg value="ps"/>
<!-- Cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value=".cache/phpcs.json"/>
<!-- Rules: Check PHP version compatibility - see
https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<config name="testVersion" value="8.2-"/>
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- WordPress-Extra includes WordPress-Core -->
<rule ref="WordPress-Extra"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="6.2"/>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedParametersBeforeUsed" value="true"/>
</properties>
</rule>
<!-- Rules: Check VIP Coding Standards - see
https://github.com/Automattic/VIP-Coding-Standards/ -->
<rule ref="WordPress-VIP-Go">
<exclude-pattern>/tests/*</exclude-pattern>
<!-- These disallow anonymous functions as action/filter callbacks -->
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<!-- Allow short array syntax -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<!-- Do not enforce 'class-' prefix (PSR-4 PascalCase filenames) -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- JS-only sniffs: this is a PHP-only library, exclude to prevent PHPCS 3.x DEPRECATED warnings -->
<exclude name="WordPressVIPMinimum.JS.Window" />
<exclude name="WordPressVIPMinimum.JS.DangerouslySetInnerHTML" />
<exclude name="WordPressVIPMinimum.JS.InnerHTML" />
<exclude name="WordPressVIPMinimum.JS.StrippingTags" />
<exclude name="WordPressVIPMinimum.JS.StringConcat" />
<exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions" />
</rule>
<!-- PSR-4 requires PascalCase filenames, disable WordPress hyphenated-lowercase rules. -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Allow camelCase for PHPUnit methods in tests. -->
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
</ruleset>