summaryrefslogtreecommitdiff
blob: c41cf6031fd6fe8e9817c21e9ed2330a279fc6cc (plain)
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
<?xml version="1.0"?>
<ruleset>
	<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
		<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected"/>
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
		<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
		<exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
		<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" />
		<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" />
		<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingVar" />
		<exclude name="MediaWiki.Commenting.PropertyDocumentation.WrongStyle" />
		<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage" />
		<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
	</rule>
	<rule ref="Generic.Files.LineLength">
		<exclude-pattern>Translate\.alias\.php</exclude-pattern>
		<exclude-pattern>Translate\.i18n\.magic\.php</exclude-pattern>
		<exclude-pattern>*/tests/phpunit/data/Example*\.php</exclude-pattern>
	</rule>
	<rule ref="MediaWiki.NamingConventions.ValidGlobalName">
		<properties>
			<property name="ignoreList" type="array" value="$IP" />
		</properties>
	</rule>
	<!-- New code uses parameter and return type hints. Repeating them in tags adds no additional value. -->
	<rule ref="MediaWiki.Commenting.FunctionComment.MissingParamTag">
		<exclude-pattern>*/src/*</exclude-pattern>
		<exclude-pattern>*/tests/*</exclude-pattern>
	</rule>
	<!-- Same as above. No idea why it is named without "Tag". -->
	<rule ref="MediaWiki.Commenting.FunctionComment.MissingReturn">
		<exclude-pattern>*/src/*</exclude-pattern>
		<exclude-pattern>*/tests/*</exclude-pattern>
	</rule>
	<rule ref="MediaWiki.Files.ClassMatchesFilename.NotMatch">
		<exclude-pattern>tests/|ttmserver/|scripts/|Message\.php</exclude-pattern>
	</rule>
	<file>.</file>
	<arg name="extensions" value="php"/>
	<arg name="encoding" value="UTF-8"/>

	<!-- See https://github.com/slevomat/coding-standard#sniffs-included-in-this-standard -->
	<config name="installed_paths" value="../../slevomat/coding-standard"/>
	<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
	<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
	<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
	<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
		<properties>
			<property name="minLinesCountBeforeWithComment" value="0"/>
			<property name="maxLinesCountBeforeWithComment" value="0"/>
			<property name="minLinesCountBeforeWithoutComment" value="0"/>
			<property name="maxLinesCountBeforeWithoutComment" value="0"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.Commenting.RequireOneLineDocComment" />
	<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces" />
</ruleset>