From 286a2a1852dc678f88afd6b30ddf6c36c1e7d2d2 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 2 Jun 2019 21:33:24 -0400 Subject: [PATCH] registration: Deprecate ParserTestFiles in extension.json Warnings will be emitted whenever validation is checked or unit tests are run. Bug: T192154 Change-Id: Ib968f696890667841d850ef5562e05989cb4f431 --- docs/extension.schema.v1.json | 2 +- docs/extension.schema.v2.json | 2 +- includes/registration/ExtensionJsonValidator.php | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json index cf02f2be2c..86fa1b3da8 100644 --- a/docs/extension.schema.v1.json +++ b/docs/extension.schema.v1.json @@ -793,7 +793,7 @@ }, "ParserTestFiles": { "type": "array", - "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it" + "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it" }, "ServiceWiringFiles": { "type": "array", diff --git a/docs/extension.schema.v2.json b/docs/extension.schema.v2.json index f29f8501b0..60765814d3 100644 --- a/docs/extension.schema.v2.json +++ b/docs/extension.schema.v2.json @@ -884,7 +884,7 @@ }, "ParserTestFiles": { "type": "array", - "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it" + "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it" }, "ServiceWiringFiles": { "type": "array", diff --git a/includes/registration/ExtensionJsonValidator.php b/includes/registration/ExtensionJsonValidator.php index ba5df52854..0d95b2277b 100644 --- a/includes/registration/ExtensionJsonValidator.php +++ b/includes/registration/ExtensionJsonValidator.php @@ -141,6 +141,12 @@ class ExtensionJsonValidator { } } + // Deprecated stuff + if ( isset( $data->ParserTestFiles ) ) { + // phpcs:ignore Generic.Files.LineLength.TooLong + $extraErrors[] = '[ParserTestFiles] DEPRECATED: see '; + } + $validator = new Validator; $validator->check( $data, (object)[ '$ref' => 'file://' . $schemaPath ] ); if ( $validator->isValid() && !$extraErrors ) { -- 2.20.1