xref: /dokuwiki/_test/phpcs.xml (revision e79ce39497538c309a6db18f49ad72d287a8dd09)
1994e9d4eSAndreas Gohr<?xml version="1.0"?>
2994e9d4eSAndreas Gohr<ruleset name="DokuWiki Coding Standard Standard" namespace="DokuWiki\CS\Standard">
3994e9d4eSAndreas Gohr    <description>Coding Standard used for DokuWiki</description>
499c1e5dfSAndreas Gohr
599c1e5dfSAndreas Gohr    <!-- default config -->
699c1e5dfSAndreas Gohr    <arg name="colors"/>
799c1e5dfSAndreas Gohr    <arg value="sp"/>
899c1e5dfSAndreas Gohr    <arg name="extensions" value="php"/>
999c1e5dfSAndreas Gohr
1099c1e5dfSAndreas Gohr    <!-- where to look -->
11994e9d4eSAndreas Gohr    <file>../inc</file>
12994e9d4eSAndreas Gohr    <file>../lib</file>
13994e9d4eSAndreas Gohr    <file>../bin</file>
14994e9d4eSAndreas Gohr    <file>../doku.php</file>
15994e9d4eSAndreas Gohr    <file>../index.php</file>
16994e9d4eSAndreas Gohr    <file>../feed.php</file>
17994e9d4eSAndreas Gohr    <file>../install.php</file>
1899c1e5dfSAndreas Gohr
1999c1e5dfSAndreas Gohr    <!-- skip these completely -->
20994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
21994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
22994e9d4eSAndreas Gohr    <exclude-pattern>*/_test/*</exclude-pattern>
2399c1e5dfSAndreas Gohr
2499c1e5dfSAndreas Gohr    <!-- 3rd party libs, these should be moved to composer some day -->
2599c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
2699c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
2799c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JSON.php</exclude-pattern>
2899c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
2909d57d5aSAndreas Gohr    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
3099c1e5dfSAndreas Gohr
31994e9d4eSAndreas Gohr    <!-- rules on top of PSR-2 -->
32994e9d4eSAndreas Gohr    <rule ref="PSR2">
33994e9d4eSAndreas Gohr        <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
34994e9d4eSAndreas Gohr        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
354b3d1701SAndreas Gohr
364b3d1701SAndreas Gohr        <!-- we have lots of legacy classes without name spaces -->
374b3d1701SAndreas Gohr        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
38994e9d4eSAndreas Gohr    </rule>
3999c1e5dfSAndreas Gohr
4099c1e5dfSAndreas Gohr    <!-- disable some rules for certain paths, for legacy support -->
4199c1e5dfSAndreas Gohr    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
4299c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
4399c1e5dfSAndreas Gohr
4499c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
4599c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
46*e79ce394SAndreas Gohr
4799c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
48*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
4999c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
50*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
5199c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
52*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
5399c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
54*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
55*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
56*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
5799c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
58*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
5999c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
60*e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
6199c1e5dfSAndreas Gohr    </rule>
6299c1e5dfSAndreas Gohr    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
6399c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
6499c1e5dfSAndreas Gohr    </rule>
6599c1e5dfSAndreas Gohr
66994e9d4eSAndreas Gohr</ruleset>
67