build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
authorJames D. Forrester <jforrester@wikimedia.org>
Sat, 2 Jun 2018 22:38:38 +0000 (15:38 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Mon, 4 Jun 2018 15:43:58 +0000 (08:43 -0700)
Disable MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam and
MediaWiki.Commenting.PhpunitAnnotations.NotClassTrait for now, and
whitelist all failing files MediaWiki.Usage.ForbiddenFunctions.*.

Change-Id: Ib55ba3a70a1f922662c94895ab59eb02830faf3e

.phpcs.xml
composer.json

index 7d8bec6..e15eca0 100644 (file)
@@ -7,7 +7,9 @@
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam" />
                <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" />
        <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"/>
index 3ed41cf..669007c 100644 (file)
@@ -60,7 +60,7 @@
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
                "justinrainbow/json-schema": "~5.2",
-               "mediawiki/mediawiki-codesniffer": "18.0.0",
+               "mediawiki/mediawiki-codesniffer": "20.0.0",
                "monolog/monolog": "~1.22.1",
                "nikic/php-parser": "3.1.3",
                "nmred/kafka-php": "0.1.5",