xref: /dokuwiki/_test/phpcs.xml (revision 99c1e5dfccb8bb708456a37d23f09fcb9a67bdfb)
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
30    <!-- rules on top of PSR-2 -->
31    <rule ref="PSR2">
32        <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
33        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
34
35        <!-- we have lots of legacy classes without name spaces -->
36        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
37    </rule>
38
39    <!-- disable some rules for certain paths, for legacy support -->
40    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
41        <exclude-pattern>*/inc/parser/*</exclude-pattern>
42
43        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
44        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
45        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
46        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
47        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
48        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
49        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
50        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
51    </rule>
52    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
53        <exclude-pattern>*/inc/parser/*</exclude-pattern>
54
55        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
56        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
57        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
58        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
59        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
60        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
61        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
62        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
63    </rule>
64
65</ruleset>
66