diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-22 12:27:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-22 12:37:41 +0900 |
| commit | 1ef1ebdcf50ae1358ec06e3c6a2fb797a8461617 (patch) | |
| tree | 97cc47fc216dc7e64697ffa74b6a2bb70f395abe /crates/mozart-core | |
| parent | 92fdff257d2c64f94600ba70bf17e429d46474b2 (diff) | |
| download | php-mozart-1ef1ebdcf50ae1358ec06e3c6a2fb797a8461617.tar.gz php-mozart-1ef1ebdcf50ae1358ec06e3c6a2fb797a8461617.tar.zst php-mozart-1ef1ebdcf50ae1358ec06e3c6a2fb797a8461617.zip | |
feat(spdx): add mozart-spdx-licenses crate for SPDX license validation
Add new workspace crate that validates SPDX license expressions using
data from composer/spdx-licenses (git submodule). Includes build.rs
codegen from JSON, recursive descent expression parser supporting
AND/OR/WITH/LicenseRef, and integrates into mozart-core's
validate_license function.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-core')
| -rw-r--r-- | crates/mozart-core/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/mozart-core/src/validation.rs | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/mozart-core/Cargo.toml b/crates/mozart-core/Cargo.toml index 25210be..885fdf4 100644 --- a/crates/mozart-core/Cargo.toml +++ b/crates/mozart-core/Cargo.toml @@ -7,6 +7,7 @@ edition.workspace = true anyhow.workspace = true colored.workspace = true dialoguer.workspace = true +mozart-spdx-licenses.workspace = true regex.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/mozart-core/src/validation.rs b/crates/mozart-core/src/validation.rs index 7f946ae..24f1705 100644 --- a/crates/mozart-core/src/validation.rs +++ b/crates/mozart-core/src/validation.rs @@ -52,8 +52,7 @@ pub fn validate_stability(s: &str) -> bool { } pub fn validate_license(s: &str) -> bool { - // TODO: check SPDX Identifier - !s.is_empty() + mozart_spdx_licenses::spdx().validate(s) } pub fn validate_autoload_path(s: &str) -> bool { |
