From 89ebd751ea0653924facf837698d570d1ca18ff7 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 15 May 2025 12:58:57 +0200 Subject: [PATCH] feat(spdx-utils)!: Remove simple license mappings without matching digits In order to remove the already identified ambiguous mappings, stricten the check to require matching digits (disregarding trailing zeros) in keys and values for each mapping. This logic works for all ambiguous mappings except for `ALv2: Apache-2.0`, which is now accepted as being non-ambiguous because "2.0" is reduced to "2" which matches the digit in the key. Additionally, this logic identified 12 previously "Non-ambiguous mappings" to be in fact ambiguous because they have no or too little indication of a version. BREAKING CHANGE: Users who rely on the previous mappings need to create package curations with respective `declaredLicenseMapping`s. Signed-off-by: Sebastian Schuberth --- .../version-resolution-expected-output.yml | 35 +++++++--------- .../npm/node-modules-expected-output.yml | 5 +-- .../project-with-lockfile-expected-output.yml | 5 +-- .../npm/shrinkwrap-expected-output.yml | 5 +-- ...p-skip-excluded-scopes-expected-output.yml | 5 +-- .../pnpm/nested-project-expected-output.yml | 5 +-- .../project-with-lockfile-expected-output.yml | 5 +-- ...e-skip-excluded-scopes-expected-output.yml | 5 +-- .../project-with-lockfile-expected-output.yml | 5 +-- ...e-skip-excluded-scopes-expected-output.yml | 5 +-- .../project-with-lockfile-expected-output.yml | 5 +-- ...e-skip-excluded-scopes-expected-output.yml | 5 +-- .../example-python-flask-expected-output.yml | 14 +++---- .../spdx-tools-python-expected-output.yml | 5 +-- .../synthetic/pip-expected-output.yml | 14 +++---- .../synthetic/pip-python3-expected-output.yml | 7 ++-- .../synthetic/pipenv-expected-output.yml | 21 +++++----- .../pipenv-python3-expected-output.yml | 7 ++-- .../synthetic/poetry-expected-output.yml | 7 ++-- .../python-inspector-expected-output.yml | 14 +++---- .../multi-project-expected-output.yml | 20 ++++------ .../http4s-template-expected-output.yml | 5 +-- ...ickcheck-state-machine-expected-output.yml | 5 +-- .../main/resources/simple-license-mapping.yml | 40 +------------------ .../kotlin/SpdxSimpleLicenseMappingTest.kt | 17 ++++++++ 25 files changed, 104 insertions(+), 162 deletions(-) diff --git a/plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/version-resolution-expected-output.yml b/plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/version-resolution-expected-output.yml index 8f0a214344ab7..9b7c3dfb9ae4b 100644 --- a/plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/version-resolution-expected-output.yml +++ b/plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/version-resolution-expected-output.yml @@ -508,9 +508,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Methods to allow using HTML code with CoreText." homepage_url: "https://github.com/Cocoanetics/DTCoreText" binary_artifact: @@ -538,9 +537,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Methods to allow using HTML code with CoreText." homepage_url: "https://github.com/Cocoanetics/DTCoreText" binary_artifact: @@ -568,9 +566,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Standard toolset classes and categories." homepage_url: "https://github.com/Cocoanetics/DTFoundation" binary_artifact: @@ -598,9 +595,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Standard toolset classes and categories." homepage_url: "https://github.com/Cocoanetics/DTFoundation" binary_artifact: @@ -628,9 +624,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Standard toolset classes and categories." homepage_url: "https://github.com/Cocoanetics/DTFoundation" binary_artifact: @@ -658,9 +653,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Standard toolset classes and categories." homepage_url: "https://github.com/Cocoanetics/DTFoundation" binary_artifact: @@ -716,9 +710,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "A set of in-app debugging and exploration tools for iOS" homepage_url: "https://github.com/Flipboard/FLEX" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/node-modules-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/node-modules-expected-output.yml index 74ae0e89feb4c..413632db778e9 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/node-modules-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/node-modules-expected-output.yml @@ -300,9 +300,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/project-with-lockfile-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/project-with-lockfile-expected-output.yml index 26eeea0b426db..60bcce4e30e60 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/project-with-lockfile-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/project-with-lockfile-expected-output.yml @@ -311,9 +311,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-expected-output.yml index e8938f2b28ad3..eeab68cb14ca4 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-expected-output.yml @@ -300,9 +300,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-skip-excluded-scopes-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-skip-excluded-scopes-expected-output.yml index 036f1e9038ca9..d51926d649bf7 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-skip-excluded-scopes-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/npm/shrinkwrap-skip-excluded-scopes-expected-output.yml @@ -172,9 +172,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/nested-project-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/nested-project-expected-output.yml index 2c62eb15a46c4..83efa58d9b6b1 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/nested-project-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/nested-project-expected-output.yml @@ -335,9 +335,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-expected-output.yml index b519f5df78648..7e5051a6dc558 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-expected-output.yml @@ -311,9 +311,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-skip-excluded-scopes-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-skip-excluded-scopes-expected-output.yml index 3d250626d81b5..5df562854f24a 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-skip-excluded-scopes-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm/project-with-lockfile-skip-excluded-scopes-expected-output.yml @@ -174,9 +174,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-expected-output.yml index 0006e76eee6a8..c70bb551a4c9e 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-expected-output.yml @@ -311,9 +311,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-skip-excluded-scopes-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-skip-excluded-scopes-expected-output.yml index c0390e1f1b56d..cfd50ea0312d9 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-skip-excluded-scopes-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn/project-with-lockfile-skip-excluded-scopes-expected-output.yml @@ -174,9 +174,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-expected-output.yml index 49b4fcd81bc1d..21180eb87aaad 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-expected-output.yml @@ -311,9 +311,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-skip-excluded-scopes-expected-output.yml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-skip-excluded-scopes-expected-output.yml index cf425e0372171..bb4c87dce839a 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-skip-excluded-scopes-expected-output.yml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/yarn2/project-with-lockfile-skip-excluded-scopes-expected-output.yml @@ -174,9 +174,8 @@ packages: declared_licenses: - "BSD-like" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-like: "BSD-3-Clause" + unmapped: + - "BSD-like" description: "a CSS selector compiler/engine" homepage_url: "https://github.com/fb55/css-select#readme" binary_artifact: diff --git a/plugins/package-managers/python/src/funTest/assets/projects/external/example-python-flask-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/external/example-python-flask-expected-output.yml index 7ec7463b6251a..7753bb27b1a24 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/external/example-python-flask-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/external/example-python-flask-expected-output.yml @@ -64,10 +64,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A microframework based on Werkzeug, Jinja2 and good intentions" homepage_url: "http://github.com/pallets/flask/" binary_artifact: @@ -160,10 +159,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A small but fast and easy to use stand-alone template engine written\ \ in pure python." homepage_url: "http://jinja.pocoo.org/" diff --git a/plugins/package-managers/python/src/funTest/assets/projects/external/spdx-tools-python-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/external/spdx-tools-python-expected-output.yml index 6e20f479f5c80..5d4151072ef1c 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/external/spdx-tools-python-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/external/spdx-tools-python-expected-output.yml @@ -70,9 +70,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Python Lex & Yacc" homepage_url: "http://www.dabeaz.com/ply/" binary_artifact: diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-expected-output.yml index 081c53fdbc769..b54a152d7bd11 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-expected-output.yml @@ -70,10 +70,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A simple framework for building complex web applications." homepage_url: "https://www.palletsprojects.com/p/flask/" binary_artifact: @@ -169,10 +168,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "Safely add untrusted strings to HTML/XML markup." homepage_url: "https://www.palletsprojects.com/p/markupsafe/" binary_artifact: diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-python3-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-python3-expected-output.yml index cf638ac2a43ae..93feb27fb9aee 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-python3-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pip-python3-expected-output.yml @@ -31,10 +31,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A high-level Python Web framework that encourages rapid development\ \ and clean, pragmatic design." homepage_url: "https://www.djangoproject.com/" diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-expected-output.yml index aab5cb5cd1936..4fac00449052c 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-expected-output.yml @@ -66,10 +66,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A simple framework for building complex web applications." homepage_url: "https://www.palletsprojects.com/p/flask/" binary_artifact: @@ -132,10 +131,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A small but fast and easy to use stand-alone template engine written\ \ in pure python." homepage_url: "http://jinja.pocoo.org/" @@ -167,10 +165,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "Safely add untrusted strings to HTML/XML markup." homepage_url: "https://www.palletsprojects.com/p/markupsafe/" binary_artifact: diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-python3-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-python3-expected-output.yml index 571dd63720fd8..860b46ec552fc 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-python3-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/pipenv-python3-expected-output.yml @@ -30,10 +30,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A high-level Python Web framework that encourages rapid development\ \ and clean, pragmatic design." homepage_url: "https://www.djangoproject.com/" diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/poetry-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/poetry-expected-output.yml index a40d9fe54602b..9903d5f135a53 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/poetry-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/poetry-expected-output.yml @@ -892,10 +892,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "Module for decorators, wrappers and monkey patching." homepage_url: "https://github.com/GrahamDumpleton/wrapt" binary_artifact: diff --git a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-expected-output.yml b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-expected-output.yml index b8679cab0f3c0..7a2709ed2270f 100644 --- a/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-expected-output.yml +++ b/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-expected-output.yml @@ -66,10 +66,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "A simple framework for building complex web applications." homepage_url: "https://www.palletsprojects.com/p/flask/" binary_artifact: @@ -165,10 +164,9 @@ packages: - "BSD" - "BSD License" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" - BSD License: "BSD-3-Clause" + unmapped: + - "BSD" + - "BSD License" description: "Safely add untrusted strings to HTML/XML markup." homepage_url: "https://www.palletsprojects.com/p/markupsafe/" binary_artifact: diff --git a/plugins/package-managers/sbt/src/funTest/assets/projects/external/multi-project-expected-output.yml b/plugins/package-managers/sbt/src/funTest/assets/projects/external/multi-project-expected-output.yml index 33181a8c741af..3f6d715d9f5dc 100644 --- a/plugins/package-managers/sbt/src/funTest/assets/projects/external/multi-project-expected-output.yml +++ b/plugins/package-managers/sbt/src/funTest/assets/projects/external/multi-project-expected-output.yml @@ -758,9 +758,8 @@ packages: declared_licenses: - "CC0" declared_licenses_processed: - spdx_expression: "CC0-1.0" - mapped: - CC0: "CC0-1.0" + unmapped: + - "CC0" description: "A Protocol for Asynchronous Non-Blocking Data Sequence" homepage_url: "http://www.reactive-streams.org/" binary_artifact: @@ -993,9 +992,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Uniform test interface to Scala/Java test frameworks (specs, ScalaCheck,\ \ ScalaTest, JUnit and other)" homepage_url: "http://www.scala-sbt.org" @@ -1027,9 +1025,8 @@ packages: declared_licenses: - "BSD-style" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-style: "BSD-3-Clause" + unmapped: + - "BSD-style" description: "scalacheck" homepage_url: "http://www.scalacheck.org" binary_artifact: @@ -1139,9 +1136,8 @@ packages: declared_licenses: - "BSD-style" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD-style: "BSD-3-Clause" + unmapped: + - "BSD-style" description: "scalaz-core" homepage_url: "http://scalaz.org" binary_artifact: diff --git a/plugins/package-managers/sbt/src/funTest/assets/projects/synthetic/http4s-template-expected-output.yml b/plugins/package-managers/sbt/src/funTest/assets/projects/synthetic/http4s-template-expected-output.yml index 19912681893b2..f6c641c81db11 100644 --- a/plugins/package-managers/sbt/src/funTest/assets/projects/synthetic/http4s-template-expected-output.yml +++ b/plugins/package-managers/sbt/src/funTest/assets/projects/synthetic/http4s-template-expected-output.yml @@ -1287,9 +1287,8 @@ packages: declared_licenses: - "BSD" declared_licenses_processed: - spdx_expression: "BSD-3-Clause" - mapped: - BSD: "BSD-3-Clause" + unmapped: + - "BSD" description: "Uniform test interface to Scala/Java test frameworks (specs, ScalaCheck,\ \ ScalaTest, JUnit and other)" homepage_url: "http://www.scala-sbt.org" diff --git a/plugins/package-managers/stack/src/funTest/assets/projects/external/quickcheck-state-machine-expected-output.yml b/plugins/package-managers/stack/src/funTest/assets/projects/external/quickcheck-state-machine-expected-output.yml index 2fce67f9bafc7..0273b712f1e15 100644 --- a/plugins/package-managers/stack/src/funTest/assets/projects/external/quickcheck-state-machine-expected-output.yml +++ b/plugins/package-managers/stack/src/funTest/assets/projects/external/quickcheck-state-machine-expected-output.yml @@ -3402,9 +3402,8 @@ packages: declared_licenses: - "LGPL" declared_licenses_processed: - spdx_expression: "LGPL-2.0-or-later" - mapped: - LGPL: "LGPL-2.0-or-later" + unmapped: + - "LGPL" description: "This version, 1.12.1 is a Non-Maintainer Upload (NMU). Report issues\ \ to the Hackage Trustees issue tracker.\n\nA variety of alternative parser combinator\ \ libraries, including\nthe original HuttonMeijer set. The Poly sets have features\ diff --git a/utils/spdx/src/main/resources/simple-license-mapping.yml b/utils/spdx/src/main/resources/simple-license-mapping.yml index 15bcc1d6a5931..9988e49bacb39 100644 --- a/utils/spdx/src/main/resources/simple-license-mapping.yml +++ b/utils/spdx/src/main/resources/simple-license-mapping.yml @@ -22,34 +22,8 @@ # Sort the entries below via IntelliJ's "Edit" -> "Sort Lines". --- -# Ambiguous mappings (mapping reason not obvious without additional information) -ALv2: Apache-2.0 -ASL: Apache-2.0 -Apache-style: Apache-2.0 -Apache: Apache-2.0 -BSD-like: BSD-3-Clause -BSD-style: BSD-3-Clause -BSD: BSD-3-Clause -GPL: GPL-2.0-or-later -MPL: MPL-2.0 -afl: AFL-3.0 -agpl: AGPL-3.0-or-later -apache-license: Apache-2.0 -bsd-license: BSD-3-Clause -bsd-licensed: BSD-3-Clause -cddl: CDDL-1.0 -efl: EFL-2.0 -epl: EPL-1.0 -eupl: EUPL-1.0 -fdl: GFDL-1.3-or-later -gfdl: GFDL-1.3-or-later -gpl-license: GPL-2.0-or-later -psf: PSF-2.0 -psfl: PSF-2.0 -python: Python-2.0 - -# Non-ambiguous mappings AFLv2.1: AFL-2.1 +ALv2: Apache-2.0 APACHEv2: Apache-2.0 APL2: Apache-2.0 APLv2.0: Apache-2.0 @@ -59,11 +33,7 @@ Apache2: Apache-2.0 BSD-3: BSD-3-Clause BSD2: BSD-2-Clause BSD3: BSD-3-Clause -Boost: BSL-1.0 Bouncy: MIT -CC0: CC0-1.0 -CPL: CPL-1.0 -CeCILL: CECILL-1.1 EDL-1.0: BSD-3-Clause FreeBSD: BSD-2-Clause-Views GPL-2: GPL-2.0-only @@ -74,31 +44,24 @@ GPLv3+: GPL-3.0-or-later GPLv3: GPL-3.0-only ISCL: ISC LGPL-3: LGPL-3.0-only -LGPL2: LGPL-2.1-only LGPL3: LGPL-3.0-only -LGPL: LGPL-2.0-or-later -LGPLv2: LGPL-2.1-only LGPLv3+: LGPL-3.0-or-later LGPLv3: LGPL-3.0-only MIT-like: MIT MIT-style: MIT MPLv2.0: MPL-2.0 MPLv2: MPL-2.0 -ODBL: ODbL-1.0 PSF2: PSF-2.0 UNLICENSED: Unlicense Unlicence: Unlicense -Vovida: VSL-1.0 afl-2: AFL-2.0 afl2.0: AFL-2.0 afl2.1: AFL-2.1 afl2: AFL-2.0 bouncy-license: MIT bsl1.0: BSL-1.0 -bsl: BSL-1.0 cddl1.0: CDDL-1.0 cddl1.1: CDDL-1.1 -cpal: CPAL-1.0 epl1.0: EPL-1.0 epl2.0: EPL-2.0 eupl1.0: EUPL-1.0 @@ -113,4 +76,3 @@ mpl2.0: MPL-2.0 mpl2: MPL-2.0 w3cl: W3C wtf: WTFPL -zope: ZPL-2.1 diff --git a/utils/spdx/src/test/kotlin/SpdxSimpleLicenseMappingTest.kt b/utils/spdx/src/test/kotlin/SpdxSimpleLicenseMappingTest.kt index 00ca337db46d4..c0a1e393311cf 100644 --- a/utils/spdx/src/test/kotlin/SpdxSimpleLicenseMappingTest.kt +++ b/utils/spdx/src/test/kotlin/SpdxSimpleLicenseMappingTest.kt @@ -57,6 +57,23 @@ class SpdxSimpleLicenseMappingTest : WordSpec({ if (license.id.endsWith("-only")) key should containADigit() } } + + "contain matching digits disregarding trailing zeros" { + val exceptions = mapOf( + // See https://www.eclipse.org/org/documents/edl-v10.php. + "EDL-1.0" to SpdxLicense.BSD_3_CLAUSE, + // See https://spdx.org/licenses/BSD-2-Clause-Views.html. + "FreeBSD" to SpdxLicense.BSD_2_CLAUSE_VIEWS + ) + + SpdxSimpleLicenseMapping.simpleLicenseMapping.filterNot { + it in exceptions.entries + }.forAll { (key, license) -> + val digitsInKey = key.filter { it.isDigit() }.dropLastWhile { it == '0' } + val digitsInLicense = license.id.filter { it.isDigit() }.dropLastWhile { it == '0' } + digitsInKey shouldBe digitsInLicense + } + } } "The simple expression mapping" should {