Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
86 lines (70 loc) · 2.85 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
86 lines (70 loc) · 2.85 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
85
86
<?xml version="1.0" ?>
<ruleset name="Pattern Directory Coding Standards">
<description>Apply customized version of WordPress Coding Standards to the WordPress.org Pattern Directory.</description>
<!--
Setup instructions:
1) Install PHPCS & all required code standards using `composer install`
2) Run `composer run lint`.
See these links for useful information:
- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties
- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<!-- Exclude 3rd-party files -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<!-- Show sniff codes in all reports -->
<arg value="ps" />
<arg name="colors" />
<!-- Scan theme & plugins -->
<file>./public_html/wp-content/themes/wporg-pattern-directory-2024/</file>
<file>./public_html/wp-content/plugins/pattern-creator/</file>
<file>./public_html/wp-content/plugins/pattern-directory/</file>
<file>./public_html/wp-content/plugins/pattern-translations/</file>
<arg name="extensions" value="php" />
<!-- WordPress.org runs recent versions of WordPress. -->
<config name="minimum_wp_version" value="7.1" />
<!-- Keep compatibility with the project's PHP 7.4 minimum. -->
<config name="testVersion" value="7.4-" />
<rule ref="PHPCompatibilityWP" />
<rule ref="WordPress">
<exclude name="WordPress.DB.DirectDatabaseQuery" />
<exclude name="WordPress.DB.SlowDBQuery" />
<!-- Short ternary syntax is allowed on WordPress.org. -->
<exclude name="Universal.Operators.DisallowShortTernary" />
</rule>
<!-- Registered by the wporg-pattern post type. -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="edit_pattern" />
</property>
</properties>
</rule>
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<!-- Ignore the block pattern parser files. -->
<exclude-pattern>*/pattern-translations/includes/parsers/*.php$</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="allowed_custom_properties" type="array">
<element value="nodeValue"/>
<element value="parentNode"/>
</property>
</properties>
</rule>
<!-- Keep security diagnostics as errors. -->
<rule ref="WordPress.Security">
<type>error</type>
</rule>
<!-- Verify that the text_domain is set to the desired text-domain. Additional valid text domains can be
added as further `<element>` nodes. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wporg-patterns" />
</property>
</properties>
</rule>
</ruleset>