Add a specific message for stupid users that put useless spaces in license
parent
00a6b7c794
commit
5cd080dfac
|
@ -84,10 +84,16 @@ class ConfigValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
$licenseValidator = new SpdxLicenses();
|
$licenseValidator = new SpdxLicenses();
|
||||||
if ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license'])) {
|
if ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license']) && $licenseValidator->validate(trim($manifest['license']))) {
|
||||||
|
$warnings[] = sprintf(
|
||||||
|
'Trim the license identifier (remove useless spaces, etc).',
|
||||||
|
json_encode($manifest['license'])
|
||||||
|
);
|
||||||
|
} else if ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license'])) {
|
||||||
$warnings[] = sprintf(
|
$warnings[] = sprintf(
|
||||||
'License %s is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.'
|
'License %s is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.'
|
||||||
."\nIf the software is closed-source, you may use \"proprietary\" as license.",
|
. PHP_EOL .
|
||||||
|
'If the software is closed-source, you may use "proprietary" as license.',
|
||||||
json_encode($manifest['license'])
|
json_encode($manifest['license'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue