diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-04 14:30:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-04 14:30:22 +0900 |
| commit | c59a923669c57adbf6e5eecce7feae59afcf0aac (patch) | |
| tree | edecd7142497841bd9fa7b39c29ea5a3cb28ad8d /crates/mozart-core | |
| parent | 0f381821e3ec32d82e9ad3d574caac1e4182c423 (diff) | |
| download | php-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')
| -rw-r--r-- | crates/mozart-core/src/validation.rs | 4 |
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) } |
