-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml.dist
91 lines (80 loc) · 3.5 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
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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="lumiere_phpcs" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Lumière WordPress Plugin PHP Code Sniffer configuration file.</description>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/assets/js/*</exclude-pattern>
<exclude-pattern>*/assets/css/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>dist/*</exclude-pattern>
<exclude-pattern>.phan/*</exclude-pattern>
<!-- Add PHP Post-5.6 ruleset, not supported by WordPress core, but perfect for plugins. -->
<rule ref="NeutronStandard">
<!-- I use @TODOs in my comments, unactivate it -->
<exclude name="Generic.Commenting.Todo"/>
<!-- I do comment out my code, deactivate that security -->
<exclude name="Squiz.PHP.CommentedOutCode"/>
<!-- I have functions longer than 40 lines, and I'm ok with that -->
<exclude name="NeutronStandard.Functions.LongFunction.LongFunction"/>
<!-- Do not report 'Closing PHP tag must be on a line by itself' -->
<exclude name="Squiz.PHP.EmbeddedPhp"/>
<!-- Exclude those rules, because we run WordPress-Extra which will conflict with NeutronStandard -->
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
</rule>
<!-- Include the WordPress-Extra standard.-->
<rule ref="WordPress-Extra">
<!-- I want to use short array [] -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- Yoda conditions to the bin, you go -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- Covers rule: Put spaces on both sides of the opening and closing parenthesis of
if, elseif, foreach, for, and switch blocks. I don't want it. -->
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
<!-- I want to use call_user_func() -->
<exclude name="NeutronStandard.Functions.DisallowCallUserFunc.CallUserFunc"/>
<!-- Followig rule should be commented out, therefore active
<exclude name="WordPress.Security.NonceVerification"/> -->
<!-- I want to use define() -->
<exclude name="NeutronStandard.Constants.DisallowDefine.Define"/>
</rule>
<!-- Let's also check that everything is properly documented.
<rule ref="WordPress-Docs">
<exclude-pattern>src/**/*</exclude-pattern>
</rule>
-->
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<!--
<rule ref="Generic.Commenting.Todo"/>
-->
<!--
Let's play with WP Coding standards and fit Lumiere needs
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<config name="minimum_supported_wp_version" value="8.0"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="lumiere-movies"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="lumiere"/>
<element value="lum"/>
</property>
</properties>
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<property name="customEscapingFunctions" type="array">
<!--<element value="wp_kses"/>-->
</property>
<property name="customAutoEscapedFunctions" type="array">
<!--<element value="lumiere_check_taxo_template"/>-->
</property>
</properties>
</rule>
</ruleset>