forked from codesnippetspro/code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
62 lines (51 loc) · 2.32 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
<?xml version="1.0"?>
<ruleset name="Code-Snippets">
<config name="testVersion" value="7.0-" />
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress/ruleset.xml -->
<!-- Include the WordPress ruleset, with exclusions. -->
<rule ref="WordPress">
<!-- allow hooks containing forward slashes -->
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
<!-- necessary for core plugin function -->
<exclude name="Squiz.PHP.Eval.Discouraged" />
<!-- allow embedding PHP within HTML attribute values -->
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
<!-- database table names should be interpolated -->
<exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared" />
<!-- handle this through editor autoformatting -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<!-- allow smart tabs -->
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<!-- allow modern PHP syntax -->
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<!-- todo -->
<exclude name="WordPress.Security.NonceVerification.Recommended" />
<exclude name="WordPress.Security.NonceVerification.Missing" />
</rule>
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<!-- class files don't need an additional file comment -->
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>class-*\.php$</exclude-pattern>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="maxColumn" value="300" />
</properties>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery">
<properties>
<property name="customCacheDeleteFunctions" type="array">
<element value="clean_snippets_cache" />
<element value="clean_active_snippets_cache" />
</property>
</properties>
</rule>
</ruleset>