xref: /dokuwiki/_test/phpcs.xml (revision 36faf6960da95d20701a18669dffb86c9d8fc6b5)
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
10b196d8deSAndreas Gohr    <ini name="memory_limit" value="-1"/>
11b196d8deSAndreas Gohr
1299c1e5dfSAndreas Gohr    <!-- where to look -->
13994e9d4eSAndreas Gohr    <file>../inc</file>
14994e9d4eSAndreas Gohr    <file>../lib</file>
15994e9d4eSAndreas Gohr    <file>../bin</file>
16994e9d4eSAndreas Gohr    <file>../doku.php</file>
17994e9d4eSAndreas Gohr    <file>../index.php</file>
18994e9d4eSAndreas Gohr    <file>../feed.php</file>
19994e9d4eSAndreas Gohr    <file>../install.php</file>
2099c1e5dfSAndreas Gohr
2199c1e5dfSAndreas Gohr    <!-- skip these completely -->
22994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
23994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
24994e9d4eSAndreas Gohr    <exclude-pattern>*/_test/*</exclude-pattern>
2599c1e5dfSAndreas Gohr
2699c1e5dfSAndreas Gohr    <!-- 3rd party libs, these should be moved to composer some day -->
2799c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
2899c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
2999c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JSON.php</exclude-pattern>
3099c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
3109d57d5aSAndreas Gohr    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
3299c1e5dfSAndreas Gohr
33dd8af038SAndreas Gohr    <!-- deprecated files to be removed soon -->
34dd8af038SAndreas Gohr    <exclude-pattern>*/inc/cli.php</exclude-pattern>
3527f63a23SAndreas Gohr    <exclude-pattern>*/inc/parser/*</exclude-pattern>
36dd8af038SAndreas Gohr
37*36faf696SMichael Große    <!-- rules on top of PSR-12 -->
38903d43feSMichael Große    <rule ref="PSR12">
39*36faf696SMichael Große        <!-- This rule breaks the single line guard pattern that we prefer to keep using -->
40994e9d4eSAndreas Gohr        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
414b3d1701SAndreas Gohr
424b3d1701SAndreas Gohr        <!-- we have lots of legacy classes without name spaces -->
434b3d1701SAndreas Gohr        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
44994e9d4eSAndreas Gohr    </rule>
4599c1e5dfSAndreas Gohr
4699c1e5dfSAndreas Gohr    <!-- disable some rules for certain paths, for legacy support -->
4799c1e5dfSAndreas Gohr    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
4899c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
4999c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
50dd8af038SAndreas Gohr        <exclude-pattern>*/inc/PluginTrait.php</exclude-pattern>
51e79ce394SAndreas Gohr
5282f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*.php</exclude-pattern>
5399c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
54e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
5599c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
56e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
5799c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
58e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
5999c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
60e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
61e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
62e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
6399c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
64e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
6599c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
66e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
6799c1e5dfSAndreas Gohr    </rule>
6882f7cb05SAndreas Gohr
6982f7cb05SAndreas Gohr    <!-- underscore skips exposing public methods to remote api -->
7082f7cb05SAndreas Gohr    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
711dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/RemotePlugin.php</exclude-pattern>
7282f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
7382f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
7482f7cb05SAndreas Gohr    </rule>
7582f7cb05SAndreas Gohr
7699c1e5dfSAndreas Gohr    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
771dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginInterface.php</exclude-pattern>
781dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginTrait.php</exclude-pattern>
7999c1e5dfSAndreas Gohr    </rule>
80994e9d4eSAndreas Gohr</ruleset>
81