registration: Improve license-name validation
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 28 Sep 2016 02:56:07 +0000 (19:56 -0700)
committerLegoktm <legoktm.wikipedia@gmail.com>
Wed, 28 Sep 2016 20:50:48 +0000 (20:50 +0000)
commitf6644c07cbfcbc6f82d6656905f58dca35fa4fec
treef00b2c4de4c3d3162853409a4a8a4423eeaeb18e
parentfcf58d766db9228a4c4e79c74a0fe1b9340a385d
registration: Improve license-name validation

Our hardcoded enum list in the extension.json schema for license-name
values was incomplete and did not cover the full SPDX license identifier
specification, which includes things like "AND" for specifying multiple
licenses.

Composer already has solid code in a library to do this validation, so
let's use it! This updates both the validateRegistrationFile.php and
ExtensionJsonValidationTest.php to use the composer/spdx-licenses
library (a new development dependency) to ensure the license-name field
is a valid SPDX identifier.

Also fix a silly typo in the validateRegistrationFile script which
prevented it from running, and use ::class so it will be easier to
detect typos like that in the future.

Bug: T146862
Change-Id: Ibb8973ed7950ae81c90558f9630f73746b2aff2c
composer.json
docs/extension.schema.json
docs/extension.schema.v1.json
maintenance/validateRegistrationFile.php
tests/phpunit/structure/ExtensionJsonValidationTest.php