forked from wikimedia/mediawiki-extensions-Wikibase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
74 lines (65 loc) · 2.69 KB
/
phpcs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0"?>
<ruleset name="Wikibase">
<!-- See https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml -->
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment" />
</rule>
<rule ref="Generic.Classes.DuplicateClassName.Found">
<exclude-pattern>DataAccess.Scribunto.Scribunto_LuaWikibaseLibraryTestCase\.php</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement">
<exclude-pattern>WikibaseClient\.example\.php</exclude-pattern>
</rule>
<rule ref="Generic.ControlStructures" />
<rule ref="Generic.Files.InlineHTML" />
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140" />
</properties>
<!-- Exclude auto-generated files from the Translate extension, see magic-export.php. -->
<exclude-pattern>\.i18n\.magic\.php</exclude-pattern>
<exclude-pattern>view.resources.templates\.php</exclude-pattern>
</rule>
<rule ref="Generic.Files.OneInterfacePerFile" />
<rule ref="Generic.Files.OneTraitPerFile" />
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="16" />
</properties>
<exclude-pattern>(RdfWriterFactory|UrlSchemeValidators)\.php</exclude-pattern>
</rule>
<rule ref="Generic.Metrics.NestingLevel" />
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
<rule ref="PSR1">
<exclude name="PSR1.Files.SideEffects" />
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>DataAccess.Scribunto.Scribunto_LuaWikibaseLibraryTestCase\.php</exclude-pattern>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<!-- Exclude test methods like "testGivenInvalidInput_methodThrowsException". -->
<exclude-pattern>tests.phpunit*Test*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.Files" />
<rule ref="Squiz.Classes.DuplicateProperty" />
<rule ref="Squiz.Classes.SelfMemberReference" />
<!-- This sniff is included in PSR1 but needs an exception. -->
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>DataAccess.Scribunto.Scribunto_LuaWikibase*Library</exclude-pattern>
</rule>
<rule ref="Squiz.ControlStructures.ControlSignature" />
<rule ref="Squiz.Functions.FunctionDuplicateArgument" />
<rule ref="Squiz.Functions.GlobalFunction" />
<rule ref="Squiz.Scope" />
<rule ref="Squiz.WhiteSpace.CastSpacing" />
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
</ruleset>