-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
48 lines (39 loc) · 1.84 KB
/
phpcs.xml.dist
File metadata and controls
48 lines (39 loc) · 1.84 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
<?xml version="1.0"?>
<ruleset name="AI Provider for OpenAI Coding Standards">
<description>PSR-12 coding standards for AI Provider for OpenAI</description>
<!-- Scan these files -->
<file>src</file>
<file>plugin.php</file>
<!-- Ignore vendor directory -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Show progress, show sniff codes in all reports -->
<arg value="sp"/>
<!-- Set minimum supported PHP version -->
<config name="testVersion" value="7.4-"/>
<!-- Enable colors in output -->
<arg name="colors"/>
<!-- Use PSR-12 standard -->
<rule ref="PSR12"/>
<!-- WordPress plugin bootstrap files intentionally have side effects -->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>plugin.php</exclude-pattern>
</rule>
<!-- Check PHP 7.4 compatibility -->
<rule ref="PHPCompatibility">
<!-- Exclude functions that are polyfilled in wordpress/php-ai-client -->
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_is_listFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound"/>
</rule>
<!-- Enforce namespace best practices -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
</ruleset>