-
Notifications
You must be signed in to change notification settings - Fork 55
/
phpcs.xml
108 lines (90 loc) · 3.75 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
<?xml version="1.0"?>
<ruleset name="WP Search With Algolia Coding Standards">
<description>
Coding standards configuration for WP Search With Algolia.
</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 file paths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Show sniff codes in all reports. -->
<arg value="ps"/>
<!-- What to scan. -->
<file>.</file>
<!-- What not to scan. -->
<exclude-pattern>/index.php</exclude-pattern>
<exclude-pattern>/.github/</exclude-pattern>
<exclude-pattern>/bin/</exclude-pattern>
<exclude-pattern>/config/</exclude-pattern>
<exclude-pattern>/includes/libraries/</exclude-pattern>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/vendor_prefixed/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/tests/</exclude-pattern>
<!-- Use WordPress "Extra" Coding Standards. -->
<rule ref="WordPress-Extra">
<!-- Allow array short syntax. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<!-- Allow short prefixes. -->
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed"/>
</rule>
<!-- Use WordPress "Docs" Coding Standards. -->
<rule ref="WordPress-Docs" />
<!--
WP Search With Algolia currently supports WP 5.0+.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters
-->
<config name="minimum_supported_wp_version" value="5.0"/>
<!--
Configure global prefixes/namespaces.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="webdevstudios,wds,wpswa,algolia"/>
</properties>
</rule>
<!--
Configure text_domain for I18n.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set
-->
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="wp-search-with-algolia"/>
</properties>
</rule>
<!--
Precision alignment should be fine in HTML.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#precision-alignment-exempt-certain-tokens
-->
<rule ref="WordPress.WhiteSpace.PrecisionAlignment">
<properties>
<property name="ignoreAlignmentTokens" type="array">
<element value="T_COMMENT"/>
<element value="T_INLINE_HTML"/>
</property>
</properties>
</rule>
<!--
We're PSR-4 autoloading, skip the "class-whatever" naming convention.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#disregard-class-file-name-rules
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
</rule>
<!-- Use WordPress PHP Compatibility. -->
<rule ref="PHPCompatibilityWP"/>
<!-- WPSWA currently supports PHP 7.4+. -->
<config name="testVersion" value="7.4-"/>
</ruleset>