aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-04 14:30:22 +0900
committernsfisis <nsfisis@gmail.com>2026-05-04 14:30:22 +0900
commitc59a923669c57adbf6e5eecce7feae59afcf0aac (patch)
treeedecd7142497841bd9fa7b39c29ea5a3cb28ad8d /crates/mozart-core/src
parent0f381821e3ec32d82e9ad3d574caac1e4182c423 (diff)
downloadphp-mozart-c59a923669c57adbf6e5eecce7feae59afcf0aac.tar.gz
php-mozart-c59a923669c57adbf6e5eecce7feae59afcf0aac.tar.zst
php-mozart-c59a923669c57adbf6e5eecce7feae59afcf0aac.zip
feat(validate): warn on deprecated SPDX license identifiers
Mirror Composer's Util\ConfigValidator::validate() license handling: treat empty string and empty array as missing, accept array form, and emit deprecation warnings (with GPL-specific -only/-or-later suggestions) for identifiers flagged deprecated in the SPDX database.
Diffstat (limited to 'crates/mozart-core/src')
-rw-r--r--crates/mozart-core/src/validation.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/mozart-core/src/validation.rs b/crates/mozart-core/src/validation.rs
index 24f1705..7b97666 100644
--- a/crates/mozart-core/src/validation.rs
+++ b/crates/mozart-core/src/validation.rs
@@ -55,6 +55,10 @@ pub fn validate_license(s: &str) -> bool {
mozart_spdx_licenses::spdx().validate(s)
}
+pub fn is_license_deprecated(s: &str) -> bool {
+ mozart_spdx_licenses::spdx().is_deprecated(s)
+}
+
pub fn validate_autoload_path(s: &str) -> bool {
AUTOLOAD_PATH_RE.is_match(s)
}