<?xml version="1.0"?>
<ruleset>

	<!-- This rule set includes all rules from the MediaWiki rule set, see
		https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml
		-->
	<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">

		<!-- The function comment sniff is way to rigorous about way to 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,…]. -->
		<exclude name="MediaWiki.Commenting.FunctionComment" />

		<!-- Even if we encourage to use spaces in comments, we don't think this sniff should block
			patches from being merged. -->
		<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment" />

		<exclude name="MediaWiki.Commenting.FunctionAnnotations.UnrecognizedAnnotation" />
	</rule>

	<!-- Metrics are intentionally not part of the base Wikibase CodeSniffer rule set. -->
	<rule ref="Generic.Metrics.CyclomaticComplexity" />
	<rule ref="Generic.Metrics.NestingLevel" />

	<rule ref="MediaWiki.Commenting.ClassLevelLicense">
		<properties>
			<property name="license" value="GPL-2.0-or-later" />
		</properties>
	</rule>

	<rule ref="Generic.Files.LineLength">
		<properties>
			<property name="lineLimit" value="120" />
		</properties>
	</rule>

	<file>.</file>
</ruleset>
