From 35ae3f4e40dadfe85f34584242396356decc0f24 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 10 Feb 2022 15:29:59 +0100 Subject: [PATCH] Support non-English licenses Improve in tests. Add a language tag there too. Fix licenses with incorrect or missing metadata Reference: https://github.com/nexB/scancode-toolkit/issues/139 Signed-off-by: Philippe Ombredanne --- .../licenses/avisynth-c-interface-exception.yml | 2 +- .../licenses/broadcom-linking-exception-2.0.yml | 2 +- src/licensedcode/data/licenses/cc-by-nc-3.0-de.yml | 2 +- .../data/licenses/cc-by-nc-nd-2.0-at.yml | 2 ++ .../data/licenses/cc-by-nc-nd-3.0-de.yml | 2 +- .../data/licenses/cc-by-nc-sa-2.0-fr.yml | 2 +- .../data/licenses/cc-by-nc-sa-3.0-de.yml | 2 +- src/licensedcode/data/licenses/cc-by-nd-3.0-de.yml | 2 +- src/licensedcode/data/licenses/cc-by-sa-3.0-de.yml | 2 +- src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml | 1 + src/licensedcode/data/licenses/cc-lgpl-2.1-pt.yml | 2 ++ src/licensedcode/data/licenses/etalab-2.0-fr.yml | 4 ++-- src/licensedcode/data/licenses/etalab-2.0.yml | 4 ++-- src/licensedcode/data/licenses/nysl-0.9982-jp.yml | 1 + .../data/licenses/ogl-canada-2.0-fr.yml | 4 ++-- src/licensedcode/data/licenses/scilab-fr.yml | 3 ++- src/licensedcode/data/licenses/scola-fr.yml | 5 +++-- src/licensedcode/data/rules/cc-by-3.0-at.yml | 5 +++-- src/licensedcode/data/rules/cc-by-nc-nd-2.0-at.yml | 3 ++- src/licensedcode/data/rules/cc-by-nc-sa-3.0_zh.yml | 3 ++- src/licensedcode/data/rules/cc-by-nc-sa-4.0_zh.yml | 4 +++- src/licensedcode/data/rules/gfdl-1.1_fr_gnome_1.yml | 13 ++++++++++--- src/licensedcode/models.py | 4 ++-- .../datadriven/external/atarashi/CECILL-C.c.yml | 2 +- .../external/fossology-licenses/cecill-b.txt.yml | 2 +- .../external/fossology-licenses/cecill-c.txt.yml | 2 +- .../external/fossology-tests/MS/MS-LPL.txt.yml | 2 +- .../fossology-tests/SPDX/LAL-1.2.spdx.txt.yml | 2 +- .../external/fossology-tests/SPDX/LAL-1.3.yml | 2 +- .../external/fossology-tests/SPDX/LiLiQ-P-1.1.yml | 2 +- .../external/fossology-tests/SPDX/LiLiQ-R-1.1.yml | 2 +- .../fossology-tests/SPDX/LiLiQ-Rplus-1.1.yml | 2 +- .../data/datadriven/external/glc/CECILL-B.t1.yml | 2 +- .../data/datadriven/external/glc/CECILL-C.t1.yml | 2 +- .../data/datadriven/lic1/french_gfdl.docbook.yml | 5 +++-- .../data/datadriven/lic3/nysl-0.9982.txt.yml | 3 ++- .../data/datadriven/lic3/nysl-0.9982_jp.txt.yml | 3 ++- .../licensedcode/data/datadriven/lic4/D-FSL-1.0.yml | 3 ++- .../data/datadriven/unknown/cclrc.txt.yml | 3 +-- .../data/datadriven/unknown/opl-1.0.txt.yml | 11 +---------- tests/licensedcode/licensedcode_test_utils.py | 4 ++++ tests/licensedcode/test_models.py | 2 +- tests/scancode/data/altpath/copyright.expected.json | 3 ++- 43 files changed, 76 insertions(+), 57 deletions(-) diff --git a/src/licensedcode/data/licenses/avisynth-c-interface-exception.yml b/src/licensedcode/data/licenses/avisynth-c-interface-exception.yml index 5bf4647dd1b..088c9e9a4b8 100644 --- a/src/licensedcode/data/licenses/avisynth-c-interface-exception.yml +++ b/src/licensedcode/data/licenses/avisynth-c-interface-exception.yml @@ -5,4 +5,4 @@ category: Copyleft Limited owner: Kevin Atkinson homepage_url: http://www.kevina.org/avisynth_c/readme.txt is_exception: yes -spdx_license_key: LicenseRef-scancode-avisynth-c-interface-exception +spdx_license_key: LicenseRef-scancode-avisynth-c-exception diff --git a/src/licensedcode/data/licenses/broadcom-linking-exception-2.0.yml b/src/licensedcode/data/licenses/broadcom-linking-exception-2.0.yml index c448ab0f592..6ce9fc39eec 100644 --- a/src/licensedcode/data/licenses/broadcom-linking-exception-2.0.yml +++ b/src/licensedcode/data/licenses/broadcom-linking-exception-2.0.yml @@ -4,7 +4,7 @@ name: Broadcom Linking Exception to GPL 2.0 category: Copyleft Limited owner: Broadcom is_exception: yes -spdx_license_key: LicenseRef-scancode-broadcom-linking-exception-2.0 +spdx_license_key: LicenseRef-scancode-bcm-linking-exception-2.0 standard_notice: | Copyright (c) 2006-2007 Broadcom Corporation All Rights Reserved diff --git a/src/licensedcode/data/licenses/cc-by-nc-3.0-de.yml b/src/licensedcode/data/licenses/cc-by-nc-3.0-de.yml index 2855bf2b1fd..2fe06386a4e 100644 --- a/src/licensedcode/data/licenses/cc-by-nc-3.0-de.yml +++ b/src/licensedcode/data/licenses/cc-by-nc-3.0-de.yml @@ -1,8 +1,8 @@ key: cc-by-nc-3.0-de language: de +short_name: CC-BY-NC-3.0-DE category: Free Restricted owner: Creative Commons -short_name: Creative Commons Attribution Non Commercial 3.0 Germany name: Creative Commons Attribution Non Commercial 3.0 Germany spdx_license_key: CC-BY-NC-3.0-DE other_urls: diff --git a/src/licensedcode/data/licenses/cc-by-nc-nd-2.0-at.yml b/src/licensedcode/data/licenses/cc-by-nc-nd-2.0-at.yml index 6f46e35f771..869b9e1c5d4 100644 --- a/src/licensedcode/data/licenses/cc-by-nc-nd-2.0-at.yml +++ b/src/licensedcode/data/licenses/cc-by-nc-nd-2.0-at.yml @@ -7,3 +7,5 @@ owner: Creative Commons homepage_url: https://creativecommons.org/licenses/by-nc-nd/2.0/ text_urls: - https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode.at +spdx_license_key: LicenseRef-scancode-cc-by-nc-nd-2.0-at + \ No newline at end of file diff --git a/src/licensedcode/data/licenses/cc-by-nc-nd-3.0-de.yml b/src/licensedcode/data/licenses/cc-by-nc-nd-3.0-de.yml index 0deb324df3b..c78efacc210 100644 --- a/src/licensedcode/data/licenses/cc-by-nc-nd-3.0-de.yml +++ b/src/licensedcode/data/licenses/cc-by-nc-nd-3.0-de.yml @@ -2,7 +2,7 @@ key: cc-by-nc-nd-3.0-de language: de category: Free Restricted owner: Creative Commons -short_name: Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany +short_name: CC-BY-NC-ND-3.0-DE name: Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany spdx_license_key: CC-BY-NC-ND-3.0-DE other_urls: diff --git a/src/licensedcode/data/licenses/cc-by-nc-sa-2.0-fr.yml b/src/licensedcode/data/licenses/cc-by-nc-sa-2.0-fr.yml index 003c480ce7c..11b3475d292 100644 --- a/src/licensedcode/data/licenses/cc-by-nc-sa-2.0-fr.yml +++ b/src/licensedcode/data/licenses/cc-by-nc-sa-2.0-fr.yml @@ -2,7 +2,7 @@ key: cc-by-nc-sa-2.0-fr language: fr category: Free Restricted owner: Creative Commons -short_name: Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France +short_name: CC-BY-NC-SA-2.0-FR name: Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France spdx_license_key: CC-BY-NC-SA-2.0-FR other_urls: diff --git a/src/licensedcode/data/licenses/cc-by-nc-sa-3.0-de.yml b/src/licensedcode/data/licenses/cc-by-nc-sa-3.0-de.yml index ad075654b77..351d993b377 100644 --- a/src/licensedcode/data/licenses/cc-by-nc-sa-3.0-de.yml +++ b/src/licensedcode/data/licenses/cc-by-nc-sa-3.0-de.yml @@ -2,7 +2,7 @@ key: cc-by-nc-sa-3.0-de category: Free Restricted owner: Creative Commons language: de -short_name: Creative Commons Attribution Non Commercial Share Alike 3.0 Germany +short_name: CC-BY-NC-SA-3.0-DE name: Creative Commons Attribution Non Commercial Share Alike 3.0 Germany spdx_license_key: CC-BY-NC-SA-3.0-DE other_urls: diff --git a/src/licensedcode/data/licenses/cc-by-nd-3.0-de.yml b/src/licensedcode/data/licenses/cc-by-nd-3.0-de.yml index 59f2e340c91..ee6f8c1d300 100644 --- a/src/licensedcode/data/licenses/cc-by-nd-3.0-de.yml +++ b/src/licensedcode/data/licenses/cc-by-nd-3.0-de.yml @@ -2,7 +2,7 @@ key: cc-by-nd-3.0-de category: Free Restricted owner: Creative Commons language: de -short_name: Creative Commons Attribution No Derivatives 3.0 Germany +short_name: CC-BY-ND-3.0-DE name: Creative Commons Attribution No Derivatives 3.0 Germany spdx_license_key: CC-BY-ND-3.0-DE other_urls: diff --git a/src/licensedcode/data/licenses/cc-by-sa-3.0-de.yml b/src/licensedcode/data/licenses/cc-by-sa-3.0-de.yml index dd36df1cf7b..9af78613113 100644 --- a/src/licensedcode/data/licenses/cc-by-sa-3.0-de.yml +++ b/src/licensedcode/data/licenses/cc-by-sa-3.0-de.yml @@ -1,7 +1,7 @@ key: cc-by-sa-3.0-de language: de category: Copyleft Limited -short_name: Creative Commons Attribution Share Alike 3.0 Germany +short_name: CC-BY-SA-3.0-DE name: Creative Commons Attribution Share Alike 3.0 Germany spdx_license_key: CC-BY-SA-3.0-DE other_urls: diff --git a/src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml b/src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml index f7b09a89d99..4673caeea1a 100644 --- a/src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml +++ b/src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml @@ -7,3 +7,4 @@ owner: Creative Commons homepage_url: https://creativecommons.org/licenses/GPL/2.0/ text_urls: - https://creativecommons.org/licenses/GPL/2.0/legalcode.pt +spdx_license_key: LicenseRef-scancode-cc-gpl-2.0-pt diff --git a/src/licensedcode/data/licenses/cc-lgpl-2.1-pt.yml b/src/licensedcode/data/licenses/cc-lgpl-2.1-pt.yml index 90fd1fdebd3..3744121673c 100644 --- a/src/licensedcode/data/licenses/cc-lgpl-2.1-pt.yml +++ b/src/licensedcode/data/licenses/cc-lgpl-2.1-pt.yml @@ -7,3 +7,5 @@ owner: Creative Commons homepage_url: https://creativecommons.org/licenses/LGPL/2.1/ text_urls: - https://creativecommons.org/licenses/LGPL/2.1/legalcode.pt +spdx_license_key: LicenseRef-scancode-cc-lgpl-2.1-pt + \ No newline at end of file diff --git a/src/licensedcode/data/licenses/etalab-2.0-fr.yml b/src/licensedcode/data/licenses/etalab-2.0-fr.yml index 18381b2b8e7..2148490d955 100644 --- a/src/licensedcode/data/licenses/etalab-2.0-fr.yml +++ b/src/licensedcode/data/licenses/etalab-2.0-fr.yml @@ -2,8 +2,8 @@ key: etalab-2.0-fr language: fr owner: France category: Unstated License -short_name: Etalab Open License 2.0 -name: Etalab Open License 2.0 +short_name: Etalab Open License 2.0 French +name: Etalab Open License 2.0 French spdx_license_key: etalab-2.0 other_urls: - https://github.com/DISIC/politique-de-contribution-open-source/blob/master/LICENSE.pdf diff --git a/src/licensedcode/data/licenses/etalab-2.0.yml b/src/licensedcode/data/licenses/etalab-2.0.yml index f7f9ee319e6..cfa6fd7db90 100644 --- a/src/licensedcode/data/licenses/etalab-2.0.yml +++ b/src/licensedcode/data/licenses/etalab-2.0.yml @@ -1,7 +1,7 @@ key: etalab-2.0 language: en -short_name: Etalab Open License 2.0 -name: Etalab Open License 2.0 +short_name: Etalab Open License 2.0 English +name: Etalab Open License 2.0 English category: Permissive owner: DINUM homepage_url: https://raw.githubusercontent.com/DISIC/politique-de-contribution-open-source/master/LICENSE diff --git a/src/licensedcode/data/licenses/nysl-0.9982-jp.yml b/src/licensedcode/data/licenses/nysl-0.9982-jp.yml index 8410b2f1384..b89734f46b2 100644 --- a/src/licensedcode/data/licenses/nysl-0.9982-jp.yml +++ b/src/licensedcode/data/licenses/nysl-0.9982-jp.yml @@ -3,6 +3,7 @@ language: jp short_name: NYSL 0.9982 JP name: NYSL 0.9982 Japanese category: Permissive +spdx_license_key: LicenseRef-scancode-nysl-0.9982-jp owner: Kazuhiro Inaba homepage_url: http://www.kmonos.net/nysl/index.en.html text_urls: diff --git a/src/licensedcode/data/licenses/ogl-canada-2.0-fr.yml b/src/licensedcode/data/licenses/ogl-canada-2.0-fr.yml index 63bd03cb6a1..3d9cdce5182 100644 --- a/src/licensedcode/data/licenses/ogl-canada-2.0-fr.yml +++ b/src/licensedcode/data/licenses/ogl-canada-2.0-fr.yml @@ -1,8 +1,8 @@ key: ogl-canada-2.0-fr language: fr -short_name: OGL Canada 2.0 +short_name: OGL Canada 2.0 Francais name: Licence du gouvernement ouvert Canada 2.0 category: Permissive owner: Canada Government homepage_url: https://ouvert.canada.ca/fr/licence-du-gouvernement-ouvert-canada - +spdx_license_key: LicenseRef-scancode-ogl-canada-2.0-fr diff --git a/src/licensedcode/data/licenses/scilab-fr.yml b/src/licensedcode/data/licenses/scilab-fr.yml index ed0633bf101..f87db80b761 100644 --- a/src/licensedcode/data/licenses/scilab-fr.yml +++ b/src/licensedcode/data/licenses/scilab-fr.yml @@ -6,4 +6,5 @@ category: Proprietary Free owner: INRIA/ENPC homepage_url: http://web.archive.org/web/20051212214843/http://www.scilab.org/legal/license.html text_urls: - - https://directory.fsf.org/wiki/License:Scilab-old \ No newline at end of file + - https://directory.fsf.org/wiki/License:Scilab-old +spdx_license_key: LicenseRef-scancode-scilab-fr diff --git a/src/licensedcode/data/licenses/scola-fr.yml b/src/licensedcode/data/licenses/scola-fr.yml index 3c54c4db41e..e560db75589 100644 --- a/src/licensedcode/data/licenses/scola-fr.yml +++ b/src/licensedcode/data/licenses/scola-fr.yml @@ -1,7 +1,8 @@ key: scola-fr language: fr -short_name: Statistics Canada Open Licence Agreement +short_name: Statistics Canada Open Licence name: Entente de licence ouverte de Statistique Canada owner: Statistique Canada homepage_url: https://www.statcan.gc.ca/fra/reference/licence -category: Unstated License \ No newline at end of file +category: Unstated License +spdx_license_key: LicenseRef-scancode-scola-fr diff --git a/src/licensedcode/data/rules/cc-by-3.0-at.yml b/src/licensedcode/data/rules/cc-by-3.0-at.yml index 23ac89da83d..83bdca5f2a9 100644 --- a/src/licensedcode/data/rules/cc-by-3.0-at.yml +++ b/src/licensedcode/data/rules/cc-by-3.0-at.yml @@ -1,3 +1,4 @@ license_expression: cc-by-3.0-at -language: de -is_license_text: yes \ No newline at end of file +is_license_text: yes +ignorable_urls: + - https://creativecommons.org/ diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-2.0-at.yml b/src/licensedcode/data/rules/cc-by-nc-nd-2.0-at.yml index 514d87ebaab..9b3eb6251b1 100644 --- a/src/licensedcode/data/rules/cc-by-nc-nd-2.0-at.yml +++ b/src/licensedcode/data/rules/cc-by-nc-nd-2.0-at.yml @@ -1,3 +1,4 @@ license_expression: cc-by-nc-nd-2.0-at -language: de is_license_notice: yes +ignorable_urls: + - https://creativecommons.org/ diff --git a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_zh.yml b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_zh.yml index 1c7e4369958..d354350b8cf 100644 --- a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_zh.yml +++ b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_zh.yml @@ -1,3 +1,4 @@ license_expression: cc-by-nc-sa-3.0 -language: zh is_license_notice: yes +ignorable_urls: + - http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh diff --git a/src/licensedcode/data/rules/cc-by-nc-sa-4.0_zh.yml b/src/licensedcode/data/rules/cc-by-nc-sa-4.0_zh.yml index 35a1a73864e..73ceb772f81 100644 --- a/src/licensedcode/data/rules/cc-by-nc-sa-4.0_zh.yml +++ b/src/licensedcode/data/rules/cc-by-nc-sa-4.0_zh.yml @@ -1,3 +1,5 @@ license_expression: cc-by-nc-sa-4.0 -language: zh is_license_notice: yes +ignorable_urls: + - http://creativecommons.org/licenses/by-nc-sa/4.0 + - https://github.com/kesenhoo/android-training-course-in-chinese diff --git a/src/licensedcode/data/rules/gfdl-1.1_fr_gnome_1.yml b/src/licensedcode/data/rules/gfdl-1.1_fr_gnome_1.yml index ad947be66ae..910e0e1af53 100644 --- a/src/licensedcode/data/rules/gfdl-1.1_fr_gnome_1.yml +++ b/src/licensedcode/data/rules/gfdl-1.1_fr_gnome_1.yml @@ -1,5 +1,12 @@ license_expression: gfdl-1.1 is_license_notice: yes -language: fr -notes: plain text conversion with pandoc of desktop-docs/fdl/fr/index.docbook - from https://download.gnome.org/sources/gnome-desktop/3.14/gnome-desktop-3.14.2.tar.xz +notes: plain text conversion with pandoc of desktop-docs/fdl/fr/index.docbook from https://download.gnome.org/sources/gnome-desktop/3.14/gnome-desktop-3.14.2.tar.xz +ignorable_copyrights: + - Copyright (c) ANNEE +ignorable_holders: + - ANNEE +ignorable_urls: + - http://www.gnu.org/copyleft + - http://www.gnu.org/copyleft/ + - http://www.gnu.org/copyleft/gpl.html + - http://www.gnu.org/fsf/fsf.html diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index ccd5a4474e5..a8ea556fad9 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -531,7 +531,7 @@ def validate(licenses, verbose=False, no_dupe_urls=False): if lic.key != lic.key.lower(): error('Incorrect license key case. Should be lowercase.') - if len(lic.key) >= 50: + if len(lic.key) > 50: error('key must be 50 characters or less.') if not lic.short_name: @@ -605,7 +605,7 @@ def validate(licenses, verbose=False, no_dupe_urls=False): # SPDX consistency if lic.spdx_license_key: - if len(lic.spdx_license_key) >= 50: + if len(lic.spdx_license_key) > 50: error('spdx_license_key must be 50 characters or less.') by_spdx_key[lic.spdx_license_key].append(key) diff --git a/tests/licensedcode/data/datadriven/external/atarashi/CECILL-C.c.yml b/tests/licensedcode/data/datadriven/external/atarashi/CECILL-C.c.yml index f840a5fc417..48002d467c4 100644 --- a/tests/licensedcode/data/datadriven/external/atarashi/CECILL-C.c.yml +++ b/tests/licensedcode/data/datadriven/external/atarashi/CECILL-C.c.yml @@ -1,3 +1,3 @@ license_expressions: - cecill-c - - cecill-c + - cecill-c-en diff --git a/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-b.txt.yml b/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-b.txt.yml index 46a1a867345..761dcc3d04e 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-b.txt.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-b.txt.yml @@ -1,3 +1,3 @@ license_expressions: - - cecill-b + - cecill-b-en notes: this is a license from fossology license reference CECILL-B (CeCILL-B License) http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt diff --git a/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-c.txt.yml b/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-c.txt.yml index 93220b14a80..6228c8969b2 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-c.txt.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-licenses/cecill-c.txt.yml @@ -1,3 +1,3 @@ license_expressions: - - cecill-c + - cecill-c-en notes: this is a license from fossology license reference CECILL-C (CeCILL-C License) http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.txt diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/MS/MS-LPL.txt.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/MS/MS-LPL.txt.yml index bf903d005a8..85bf83a64bb 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/MS/MS-LPL.txt.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/MS/MS-LPL.txt.yml @@ -1,2 +1,2 @@ license_expressions: - - ms-lpl + - ms-office-extensible-file diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.2.spdx.txt.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.2.spdx.txt.yml index b30327c1af1..d6413805166 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.2.spdx.txt.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.2.spdx.txt.yml @@ -1,2 +1,2 @@ license_expressions: - - unknown-spdx + - lal-1.2 diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.3.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.3.yml index b30327c1af1..e58ab16b4a0 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.3.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LAL-1.3.yml @@ -1,2 +1,2 @@ license_expressions: - - unknown-spdx + - lal-1.3 diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-P-1.1.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-P-1.1.yml index b30327c1af1..3aefbb7b328 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-P-1.1.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-P-1.1.yml @@ -1,2 +1,2 @@ license_expressions: - - unknown-spdx + - liliq-p-1.1 diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-R-1.1.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-R-1.1.yml index b30327c1af1..ca53f5fc719 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-R-1.1.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-R-1.1.yml @@ -1,2 +1,2 @@ license_expressions: - - unknown-spdx + - liliq-r-1.1 diff --git a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-Rplus-1.1.yml b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-Rplus-1.1.yml index b30327c1af1..102739f4ac9 100644 --- a/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-Rplus-1.1.yml +++ b/tests/licensedcode/data/datadriven/external/fossology-tests/SPDX/LiLiQ-Rplus-1.1.yml @@ -1,2 +1,2 @@ license_expressions: - - unknown-spdx + - liliq-rplus-1.1 diff --git a/tests/licensedcode/data/datadriven/external/glc/CECILL-B.t1.yml b/tests/licensedcode/data/datadriven/external/glc/CECILL-B.t1.yml index 0cc9536fc67..2f527acffd8 100644 --- a/tests/licensedcode/data/datadriven/external/glc/CECILL-B.t1.yml +++ b/tests/licensedcode/data/datadriven/external/glc/CECILL-B.t1.yml @@ -1,5 +1,5 @@ license_expressions: - - cecill-b + - cecill-b-en notes: | License test derived from a file of the BSD-licensed repository at: https://raw.githubusercontent.com/google/licensecheck/v0.3.1/testdata/CECILL-B.t1 diff --git a/tests/licensedcode/data/datadriven/external/glc/CECILL-C.t1.yml b/tests/licensedcode/data/datadriven/external/glc/CECILL-C.t1.yml index 1ec1af6e964..c4e64fff262 100644 --- a/tests/licensedcode/data/datadriven/external/glc/CECILL-C.t1.yml +++ b/tests/licensedcode/data/datadriven/external/glc/CECILL-C.t1.yml @@ -1,5 +1,5 @@ license_expressions: - - cecill-c + - cecill-c-en notes: | License test derived from a file of the BSD-licensed repository at: https://raw.githubusercontent.com/google/licensecheck/v0.3.1/testdata/CECILL-C.t1 diff --git a/tests/licensedcode/data/datadriven/lic1/french_gfdl.docbook.yml b/tests/licensedcode/data/datadriven/lic1/french_gfdl.docbook.yml index 4bee3c7fbea..8bfa33fcd95 100644 --- a/tests/licensedcode/data/datadriven/lic1/french_gfdl.docbook.yml +++ b/tests/licensedcode/data/datadriven/lic1/french_gfdl.docbook.yml @@ -1,6 +1,7 @@ +language: fr license_expressions: - gfdl-1.1 - gfdl-1.1 - - gfdl-1.1-plus + - gfdl-1.1 + - gfdl-1.1 - gpl-1.0-plus - diff --git a/tests/licensedcode/data/datadriven/lic3/nysl-0.9982.txt.yml b/tests/licensedcode/data/datadriven/lic3/nysl-0.9982.txt.yml index 0c73bfc3733..2979c0cbd9d 100644 --- a/tests/licensedcode/data/datadriven/lic3/nysl-0.9982.txt.yml +++ b/tests/licensedcode/data/datadriven/lic3/nysl-0.9982.txt.yml @@ -1,3 +1,4 @@ +language: jp license_expressions: - - nysl-0.9982 + - nysl-0.9982-jp - nysl-0.9982 diff --git a/tests/licensedcode/data/datadriven/lic3/nysl-0.9982_jp.txt.yml b/tests/licensedcode/data/datadriven/lic3/nysl-0.9982_jp.txt.yml index 92fa16c5ea3..b6a7c1e3d8c 100644 --- a/tests/licensedcode/data/datadriven/lic3/nysl-0.9982_jp.txt.yml +++ b/tests/licensedcode/data/datadriven/lic3/nysl-0.9982_jp.txt.yml @@ -1,2 +1,3 @@ +language: jp license_expressions: - - nysl-0.9982 + - nysl-0.9982-jp diff --git a/tests/licensedcode/data/datadriven/lic4/D-FSL-1.0.yml b/tests/licensedcode/data/datadriven/lic4/D-FSL-1.0.yml index 678dd4d7051..51c007a027f 100644 --- a/tests/licensedcode/data/datadriven/lic4/D-FSL-1.0.yml +++ b/tests/licensedcode/data/datadriven/lic4/D-FSL-1.0.yml @@ -1,2 +1,3 @@ +language: de license_expressions: - - d-fsl-1.0-en + - d-fsl-1.0-de diff --git a/tests/licensedcode/data/datadriven/unknown/cclrc.txt.yml b/tests/licensedcode/data/datadriven/unknown/cclrc.txt.yml index 08c47be739c..dc2f68b8416 100644 --- a/tests/licensedcode/data/datadriven/unknown/cclrc.txt.yml +++ b/tests/licensedcode/data/datadriven/unknown/cclrc.txt.yml @@ -1,4 +1,3 @@ license_expressions: - - unknown - - warranty-disclaimer + - cclrc notes: this is a license from fossology license reference CCLRC (CCLRC License) http://www2-pcmdi.llnl.gov/cdat/docs/cdat-license diff --git a/tests/licensedcode/data/datadriven/unknown/opl-1.0.txt.yml b/tests/licensedcode/data/datadriven/unknown/opl-1.0.txt.yml index 3a7648a4787..ba8a97c6ffa 100644 --- a/tests/licensedcode/data/datadriven/unknown/opl-1.0.txt.yml +++ b/tests/licensedcode/data/datadriven/unknown/opl-1.0.txt.yml @@ -1,12 +1,3 @@ license_expressions: - - mpl-1.1 - - mpl-1.1 - - unknown-license-reference - - unknown - - free-unknown - - warranty-disclaimer - - unknown - - unknown-license-reference - - generic-trademark + - openi-pl-1.0 notes: this is an mpl-1.1 derivative which is very rare. - diff --git a/tests/licensedcode/licensedcode_test_utils.py b/tests/licensedcode/licensedcode_test_utils.py index 68e4c67b04b..6b4080fcc08 100644 --- a/tests/licensedcode/licensedcode_test_utils.py +++ b/tests/licensedcode/licensedcode_test_utils.py @@ -50,6 +50,7 @@ class LicenseTest(object): license_expressions = attr.attrib(default=attr.Factory(list)) notes = attr.attrib(default=None) expected_failure = attr.attrib(default=False) + language = attr.attrib(default='en') licensing = Licensing() @@ -67,6 +68,7 @@ def __attrs_post_init__(self, *args, **kwargs): raise Exception(f'Failed to read: file://{self.data_file}', e) self.license_expressions = data.pop('license_expressions', []) + self.language = data.pop('language', 'en') self.notes = data.pop('notes', None) # True if the test is expected to fail self.expected_failure = data.pop('expected_failure', False) @@ -105,6 +107,8 @@ def to_dict(self): dct = {} if self.license_expressions: dct['license_expressions'] = self.license_expressions + if self.language and self.language != 'en': + dct['language'] = self.language if self.expected_failure: dct['expected_failure'] = self.expected_failure if self.notes: diff --git a/tests/licensedcode/test_models.py b/tests/licensedcode/test_models.py index 80fc96eebe9..9564d7c6fb9 100644 --- a/tests/licensedcode/test_models.py +++ b/tests/licensedcode/test_models.py @@ -107,7 +107,7 @@ def test_build_rules_from_licenses(self): def test_validate_license_library(self): errors, warnings, infos = models.License.validate( - cache.get_licenses_db(), + licenses=models.load_licenses(), verbose=False, ) assert errors == {} diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index dd8ac974679..b9238f9a0a2 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -14,7 +14,8 @@ "message": null, "errors": [], "extra_data": { - "spdx_license_list_version": "3.15", + "spdx_license_list_version": "3.16", + "OUTDATED": "WARNING: Outdated ScanCode Toolkit version! You are using an outdated version of ScanCode Toolkit: 31.0.0 released on: 2021-09-24. A new version is available with important improvements including bug and security fixes, updated license, copyright and package detection, and improved scanning accuracy. Please download and install the latest version of ScanCode. Visit https://github.com/nexB/scancode-toolkit/releases for details.", "files_count": 1 } }