-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.phpcs.xml
103 lines (80 loc) · 3.68 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<rule ref="MediaWiki.Arrays.TrailingComma">
<properties>
<property name="singleLine" value="false" />
<property name="multiLine" value="true" />
</properties>
</rule>
<rule ref="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment">
<severity>0</severity>
</rule>
<!-- BEGIN rules copied from wikibase-codesniffer (T268831) -->
<!-- The function comment sniff is way too rigorous about way too many details that need
exceptions:
* It complains about missing documentation on fully self-explanatory function headers
with strict type hints.
* It complains about missing documentation if there is a proper @see tag.
* It complains about duplicate spaces in "@param <type> $<var>", but removing these
doesn't make the code easier to read.
* It does not understand "@param <type> [$optional,…]. -->
<rule ref="MediaWiki.Commenting.FunctionComment">
<severity>0</severity>
</rule>
<!-- Starting a function's body with an empty line can be helpful after a very large header.
The code is not guaranteed to be easier to read if this is disallowed. -->
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace">
<severity>0</severity>
</rule>
<!-- END rules copied from wikibase-codesniffer (T268831) -->
<rule ref="Generic.Files.LineLength">
<exclude-pattern>resources/templates\.php</exclude-pattern>
</rule>
<rule ref="Generic.Classes.DuplicateClassName">
<exclude-pattern>WikibaseLexemeLibraryTestCase</exclude-pattern>
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile">
<exclude-pattern>WikibaseLexemeLibraryTestCase</exclude-pattern>
</rule>
<rule ref="Generic.Metrics.CyclomaticComplexity" />
<rule ref="Generic.Metrics.NestingLevel" />
<!-- BEGIN rules copied from wikibase-codesniffer (T268831) -->
<!-- NOTE: We purposely decided against additional Generic.CodeAnalysis.… sniffs, because they
all have possible exceptions, and are not meant to block patches from being merged. -->
<rule ref="MediaWiki.NamingConventions.LowerCamelFunctionsName">
<!-- Exclude test methods like "testGivenInvalidInput_methodThrowsException". -->
<exclude-pattern>tests*Test*\.php</exclude-pattern>
</rule>
<!-- NOTE: We can not use the Squiz.Arrays.ArrayBracketSpacing sniff because it conflicts with
the MediaWiki style that encourages to use spaces inside brackets, see
https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Whitespace -->
<rule ref="Squiz.Functions.GlobalFunction" />
<!-- NOTE: Do not add the Squiz.Strings.DoubleQuoteUsage sniff. Even if we encourage to prefer
single quotes, we don't think double quotes should block patches from being merged. -->
<!-- Enforces one empty line before and after each method in a class. -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<!-- The sniffs default is two empty lines. -->
<property name="spacing" value="1" />
</properties>
</rule>
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
<!-- END rules copied from wikibase-codesniffer (T268831) -->
<!-- BEGIN equivalent rules based on wikibase-codesniffer (T268831) -->
<rule ref="MediaWiki.Classes.FullQualifiedClassName">
<severity>5</severity>
<properties>
<property name="allowFunctions" value="false" />
</properties>
</rule>
<rule ref="MediaWiki.Commenting.ClassLevelLicense">
<properties>
<property name="license" value="GPL-2.0-or-later" />
</properties>
</rule>
<!-- END equivalent rules based on wikibase-codesniffer (T268831) -->
<file>.</file>
<exclude-pattern type="relative">^resources/special/new-lexeme/*</exclude-pattern>
</ruleset>