xref: /dokuwiki/_test/phpcs.xml (revision 3dc2d50c5fda9c4bf708ff4c26e266ba239af62c)
1<?xml version="1.0"?>
2<ruleset name="DokuWiki Coding Standard Standard" namespace="DokuWiki\CS\Standard">
3    <description>Coding Standard used for DokuWiki</description>
4
5    <!-- default config -->
6    <arg name="colors"/>
7    <arg value="sp"/>
8    <arg name="extensions" value="php"/>
9
10    <!-- where to look -->
11    <file>../inc</file>
12    <file>../lib</file>
13    <file>../bin</file>
14    <file>../doku.php</file>
15    <file>../index.php</file>
16    <file>../feed.php</file>
17    <file>../install.php</file>
18
19    <!-- skip these completely -->
20    <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
21    <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
22    <exclude-pattern>*/_test/*</exclude-pattern>
23
24    <!-- 3rd party libs, these should be moved to composer some day -->
25    <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
26    <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
27    <exclude-pattern>*/inc/JSON.php</exclude-pattern>
28    <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
29    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
30
31    <!-- rules on top of PSR-2 -->
32    <rule ref="PSR2">
33        <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
34        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
35
36        <!-- we have lots of legacy classes without name spaces -->
37        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
38    </rule>
39
40    <!-- disable some rules for certain paths, for legacy support -->
41    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
42        <exclude-pattern>*/inc/parser/*</exclude-pattern>
43
44        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
45        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
46        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
47        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
48        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
49        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
50        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
51        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
52    </rule>
53    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
54        <exclude-pattern>*/inc/parser/*</exclude-pattern>
55
56        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
57        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
58        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
59        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
60        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
61        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
62        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
63        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
64    </rule>
65
66</ruleset>
67