-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathphpcs.xml.dist
66 lines (54 loc) · 2.86 KB
/
phpcs.xml.dist
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
<?xml version="1.0" ?>
<ruleset name="WordPress.org Meta Coding Standards">
<!--
Setup instructions:
1) Install PHPCS & all required code standards using `composer install`
2) Run `composer run lint`. You can use the `-a` flag to run it interactively.
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="psn" />
<arg name="colors" />
<!-- Scan all (php) files in the current folder and subfolders -->
<file>.</file>
<arg name="extensions" value="php" />
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_print_r" />
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" />
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="Squiz.Commenting.VariableComment.MissingVar" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<!-- The translators comment requires no space after `//` -->
<exclude name="Squiz.Commenting.InlineComment.NoSpaceBefore" />
</rule>
<!-- Verify that the text_domain is set to the desired text-domain. Multiple valid text domains can be
provided as a comma-delimited list. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="wporg" />
</properties>
</rule>
<rule ref="PHPCompatibilityWP">
<config name="testVersion" value="7.4-" />
</rule>
<!-- Custom project rules go here -->
</ruleset>