<ruleset name="MediaWiki">
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Generic.ControlStructures.InlineControlStructure" />
+ <exclude name="MediaWiki.Commenting.FunctionAnnotations.UnrecognizedAnnotation" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
+ <exclude name="MediaWiki.Commenting.PhpunitAnnotations.NotClassTrait" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
+ <exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
- <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
- <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
<exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
- <exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
+ <exclude name="MediaWiki.Usage.ForbiddenFunctions.passthru" />
<exclude name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle" />
+ <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
+ <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
- <exclude name="Squiz.Scope.MemberVarScope.Missing" />
- <exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
<property name="ignoreList" type="array" value="$IP,$messageMemc" />
</properties>
</rule>
+ <rule ref="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix">
+ <exclude-pattern>profileinfo\.php</exclude-pattern>
+ <exclude-pattern>maintenance/language/checkLanguage\.inc</exclude-pattern>
+ <exclude-pattern>maintenance/doMaintenance\.php</exclude-pattern>
+ <exclude-pattern>maintenance/mergeMessageFileList\.php</exclude-pattern>
+ <exclude-pattern>maintenance/commandLine\.inc</exclude-pattern>
+ </rule>
<rule ref="Generic.Files.LineLength">
<exclude-pattern>*/languages/messages/Messages*\.php</exclude-pattern>
</rule>
<exclude-pattern>*/includes/specials/SpecialMostinterwikis\.php</exclude-pattern>
<exclude-pattern>*/includes/cache/CacheDependency\.php</exclude-pattern>
<exclude-pattern>*/includes/cache/CacheHelper\.php</exclude-pattern>
+ <exclude-pattern>*/includes/compat/XMPReader\.php</exclude-pattern>
<exclude-pattern>*/includes/diff/DairikiDiff\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialAncientpages\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialBrokenRedirects\.php</exclude-pattern>
<exclude-pattern>*/maintenance/7zip.inc</exclude-pattern>
<exclude-pattern>*/maintenance/CodeCleanerGlobalsPass.inc</exclude-pattern>
<exclude-pattern>*/maintenance/archives/upgradeLogging\.php</exclude-pattern>
- <exclude-pattern>*/maintenance/backup.inc</exclude-pattern>
<exclude-pattern>*/maintenance/benchmarks/bench_HTTP_HTTPS\.php</exclude-pattern>
<exclude-pattern>*/maintenance/benchmarks/bench_Wikimedia_base_convert\.php</exclude-pattern>
<exclude-pattern>*/maintenance/benchmarks/bench_delete_truncate\.php</exclude-pattern>
<exclude-pattern>*/includes/AuthPlugin\.php</exclude-pattern>
<exclude-pattern>*/includes/cache/CacheDependency\.php</exclude-pattern>
<exclude-pattern>*/includes/cache/CacheHelper\.php</exclude-pattern>
+ <exclude-pattern>*/includes/compat/XMPReader\.php</exclude-pattern>
<exclude-pattern>*/includes/deferred/CdnCacheUpdate\.php</exclude-pattern>
<exclude-pattern>*/includes/diff/DairikiDiff\.php</exclude-pattern>
<exclude-pattern>*/includes/diff/DiffEngine\.php</exclude-pattern>
<rule ref="MediaWiki.Usage.AssignmentInReturn.AssignmentInReturn">
<exclude-pattern>*/tests/phpunit/*\.php</exclude-pattern>
</rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.escapeshellarg">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>*/includes/libs/filebackend/FSFileBackend\.php</exclude-pattern>
+ <exclude-pattern>*/includes/shell/Command\.php</exclude-pattern>
+ <exclude-pattern>*/includes/shell/Shell\.php</exclude-pattern>
+ <exclude-pattern>*/tests/phpunit/structure/StructureTest\.php</exclude-pattern>
+ </rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.exec">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>*/tests/phpunit/structure/StructureTest\.php</exclude-pattern>
+ </rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.popen">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>*/includes/GlobalFunctions\.php</exclude-pattern>
+ <exclude-pattern>*/includes/libs/filebackend/FSFileBackend\.php</exclude-pattern>
+ <exclude-pattern>*/maintenance/7zip\.inc</exclude-pattern>
+ <exclude-pattern>*/maintenance/populateImageSha1\.php</exclude-pattern>
+ </rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.proc_open">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>includes/export/DumpPipeOutput\.php</exclude-pattern>
+ <exclude-pattern>includes/resourceloader/ResourceLoaderImage\.php</exclude-pattern>
+ <exclude-pattern>includes/shell/Command\.php</exclude-pattern>
+ <exclude-pattern>includes/tidy/RaggettExternal\.php</exclude-pattern>
+ <exclude-pattern>maintenance/dumpTextPass\.php</exclude-pattern>
+ <exclude-pattern>maintenance/mysql\.php</exclude-pattern>
+ <exclude-pattern>maintenance/storage/recompressTracked\.php</exclude-pattern>
+ <exclude-pattern>tests/parser/editTests\.php</exclude-pattern>
+ </rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.shell_exec">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>*/maintenance/mwdocgen\.php</exclude-pattern>
+ <exclude-pattern>*/maintenance/updateCredits\.php</exclude-pattern>
+ </rule>
+ <rule ref="MediaWiki.Usage.ForbiddenFunctions.system">
+ <!--
+ Whitelist existing violations, but enable the sniff to prevent
+ any new occurrences.
+ -->
+ <exclude-pattern>*/maintenance/mwdocgen\.php</exclude-pattern>
+ </rule>
<file>.</file>
<arg name="encoding" value="UTF-8"/>
<arg name="extensions" value="php,php5,inc,sample"/>
<exclude-pattern type="relative">^skins/</exclude-pattern>
<exclude-pattern>AdminSettings\.php</exclude-pattern>
<exclude-pattern>LocalSettings\.php</exclude-pattern>
- <exclude-pattern>StartProfiler\.php</exclude-pattern>
</ruleset>