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> 25*fa4b9dc1SAndreas Gohr <exclude-pattern>*/vendor/*</exclude-pattern> 2699c1e5dfSAndreas Gohr 2799c1e5dfSAndreas Gohr <!-- 3rd party libs, these should be moved to composer some day --> 2899c1e5dfSAndreas Gohr <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern> 2999c1e5dfSAndreas Gohr <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern> 3009d57d5aSAndreas Gohr <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern> 3199c1e5dfSAndreas Gohr 32dd8af038SAndreas Gohr <!-- deprecated files to be removed soon --> 3395078f23SAndreas Gohr <exclude-pattern>*/inc/parser/parser.php</exclude-pattern> 34dd8af038SAndreas Gohr 3536faf696SMichael Große <!-- rules on top of PSR-12 --> 36903d43feSMichael Große <rule ref="PSR12"> 3736faf696SMichael Große <!-- This rule breaks the single line guard pattern that we prefer to keep using --> 38994e9d4eSAndreas Gohr <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/> 394b3d1701SAndreas Gohr 404b3d1701SAndreas Gohr <!-- we have lots of legacy classes without name spaces --> 414b3d1701SAndreas Gohr <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/> 42994e9d4eSAndreas Gohr </rule> 4399c1e5dfSAndreas Gohr 4499c1e5dfSAndreas Gohr <!-- disable some rules for certain paths, for legacy support --> 4599c1e5dfSAndreas Gohr <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps"> 4699c1e5dfSAndreas Gohr <exclude-pattern>*/inc/Plugin.php</exclude-pattern> 4799c1e5dfSAndreas Gohr <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern> 48dd8af038SAndreas Gohr <exclude-pattern>*/inc/PluginTrait.php</exclude-pattern> 49e79ce394SAndreas Gohr 5082f7cb05SAndreas Gohr <exclude-pattern>*/lib/plugins/*.php</exclude-pattern> 5199c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern> 52e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern> 5399c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern> 54e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern> 5599c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern> 56e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern> 5799c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern> 58e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern> 59e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern> 60e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern> 6199c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern> 62e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern> 6399c1e5dfSAndreas Gohr <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern> 64e79ce394SAndreas Gohr <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern> 6595078f23SAndreas Gohr 6695078f23SAndreas Gohr <exclude-pattern>*/inc/parser/*</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> 7495078f23SAndreas Gohr 7595078f23SAndreas Gohr <exclude-pattern>*/inc/parser/*</exclude-pattern> 7695078f23SAndreas Gohr </rule> 7795078f23SAndreas Gohr 7895078f23SAndreas Gohr <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> 7995078f23SAndreas Gohr <exclude-pattern>*/inc/parser/*</exclude-pattern> 8082f7cb05SAndreas Gohr </rule> 8182f7cb05SAndreas Gohr 8299c1e5dfSAndreas Gohr <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> 831dce0478SAndreas Gohr <exclude-pattern>*/inc/Extension/PluginInterface.php</exclude-pattern> 841dce0478SAndreas Gohr <exclude-pattern>*/inc/Extension/PluginTrait.php</exclude-pattern> 8595078f23SAndreas Gohr 8695078f23SAndreas Gohr <exclude-pattern>*/inc/parser/*</exclude-pattern> 8799c1e5dfSAndreas Gohr </rule> 88994e9d4eSAndreas Gohr</ruleset> 89