-
Notifications
You must be signed in to change notification settings - Fork 21
/
phpcs.xml.dist
59 lines (51 loc) · 2.19 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
<?xml version="1.0"?>
<ruleset name="GenerateBlocks">
<description>Rules for GenerateBlocks</description>
<arg name="extensions" value="php" />
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/wordpress*/*</exclude-pattern>
<exclude-pattern>*/dist*/*</exclude-pattern>
<exclude-pattern>/tests/**</exclude-pattern>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<!--
We may want a middle ground though. The best way to do this is add the
entire ruleset, then rule by rule, remove ones that don't suit a project.
We can do this by running `phpcs` with the '-s' flag, which allows us to
see the names of the sniffs reporting errors.
Once we know the sniff names, we can opt to exclude sniffs which don't
suit our project like so.
-->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict"/>
<exclude name="Generic.Files.LineEndings" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
</rule>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<rule ref="PHPCompatibility"/>
<config name="minimum_supported_wp_version" value="5.0.0"/>
<config name="testVersion" value="7.2"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" value="generateblocks"/>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="generateblocks"/>
</property>
</properties>
</rule>
<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
</ruleset>