Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e01ac70
Support equivalent words in license detection #4190
pombredanne Mar 19, 2025
0d8151b
Merge latest develop branch
pombredanne Apr 10, 2025
471ccc2
Adjust licenses and rules post-merge
pombredanne Apr 10, 2025
8889ab5
Improve license rules and tests
pombredanne Apr 11, 2025
7bdd64c
Add new and improved rules
pombredanne Apr 11, 2025
648c7db
Add new and improved rules
pombredanne Apr 11, 2025
1d7cda6
Add new and improved rules
pombredanne Apr 12, 2025
6944487
Add new license tests
pombredanne Apr 12, 2025
f61a5c8
Fix typo
pombredanne Apr 12, 2025
7b17bb1
Correct license tests
pombredanne Apr 12, 2025
1b508c8
Build licenserules with no referenced_filenames
pombredanne Apr 12, 2025
c85f0f6
Make license rules more selective
pombredanne Apr 12, 2025
1afbeab
Fix typo in doc string
pombredanne Apr 18, 2025
5854716
Explain weird looking expected license test result
pombredanne Apr 18, 2025
7185ecd
Add extended license check
pombredanne Apr 18, 2025
8af86ce
Create correct Python version variables
pombredanne Apr 18, 2025
2829ccc
Simplify matches_have_unknown license function
pombredanne Apr 18, 2025
f2f36d6
Refine debugging output in packages
pombredanne Apr 18, 2025
ed4fbf9
Simplify unknown license presence check
pombredanne Apr 18, 2025
0b340bd
Remove unused import
pombredanne Apr 18, 2025
c4db8f9
Sort imports
pombredanne Apr 18, 2025
5b6998d
Add comments and improve docstrings
pombredanne Apr 20, 2025
16c0e65
Revert changes to licensing.matches_have_unknown
pombredanne Apr 21, 2025
1ff605e
Improve alpine license tests debuggability
pombredanne Apr 21, 2025
9a58a12
Rename rules to avoid merge conflicts
pombredanne Apr 22, 2025
12e8f4c
Merge latest develop
pombredanne Apr 22, 2025
2e46bd9
Update changelog
pombredanne Apr 22, 2025
d81f2b5
Update tests after merge and rename
pombredanne Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 12 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Changelog
=========

v33.0.0 (next next, roadmap)
----------------------------

- We now support new package manifest formats:

- OpenWRT packages.
- Yocto/BitBake .bb recipes.


v33.0.0 (next next, roadmap)
----------------------------

- Fallback packages for non-native dependencies of SCTK.
- Dependencies for
- Support for copyright detection objects.
Expand All @@ -26,9 +26,14 @@ v33.0.0 (next next, roadmap)

- `--unknown-licenses` is removed and this is always enabled
and only used in case of improper detections automatically.
Also tag all license rules with required phrases to improve
license detection and reduce false positives.
See https://github.com/nexB/scancode-toolkit/issues/3300

- All license rules have been tagged with required phrases to improve detection accuracy
and reduce false positives. See https://github.com/nexB/scancode-toolkit/issues/3300

- Equivalent words like license and licence, as well as plurals are now treated as the same in
license detection. With this, many redundant rules have been deprecated.

- The license detection accuracy of Maven POMS has been improved fixing corner cases.

- File categorization support added, a post scan plugin tagging
files with priority levels for review, and also take advantage
Expand All @@ -41,6 +46,7 @@ v33.0.0 (next next, roadmap)
- Update ABOUT files to adapt the ABOUT File Specification.
See https://github.com/aboutcode-org/scancode-toolkit/issues/4181


v32.3.3 - 2025-03-06
--------------------

Expand Down
13 changes: 9 additions & 4 deletions etc/scripts/licenses/buildrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from licensedcode import cache
from licensedcode import models
from licensedcode import match_hash
from licensedcode import frontmatter
from licensedcode.models import get_rule_id_for_text
from license_expression import Licensing
Expand Down Expand Up @@ -73,7 +72,13 @@ def __attrs_post_init__(self, *args, **kwargs):
print(rdat)
print("########################################################")
raise
self.data = {k: v for k, v in self.data.items() if v is not None or (v is None and k == "license_expression")}
if "referenced_filenames" in self.data and not self.data["referenced_filenames"]:
self.data.pop("referenced_filenames")
self.data = {
k: v for k, v in self.data.items()
if v is not None
or (v is None and k == "license_expression")
}


def load_data(location="00-new-licenses.txt"):
Expand Down Expand Up @@ -133,7 +138,7 @@ def load_data(location="00-new-licenses.txt"):

def all_rule_by_tokens():
"""
Return a mapping of {tuples of tokens: rule id}, with one item for each
Return a mapping of {(tuple of token id): rule id}, with one item for each
existing and added rules. Used to avoid duplicates.
"""
rule_tokens = {}
Expand All @@ -143,7 +148,7 @@ def all_rule_by_tokens():
except Exception as e:
rf = f" file://{rule.rule_file()}"
raise Exception(
f"Failed to to get tokens from rule:: {rule.identifier}\n" f"{rf}"
f"Failed to get tokens from rule:: {rule.identifier}\n" f"{rf}"
) from e
return rule_tokens

Expand Down
2 changes: 1 addition & 1 deletion src/formattedcode/output_cyclonedx.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from typing import List

import attr
from lxml import etree
from commoncode.cliutils import OUTPUT_GROUP
from commoncode.cliutils import PluggableCommandLineOption
from lxml import etree
from plugincode.output import OutputPlugin
from plugincode.output import output_impl

Expand Down
3 changes: 1 addition & 2 deletions src/licensedcode/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def build_licensing(licenses_db=None):
from licensedcode.models import load_licenses

licenses_db = licenses_db or load_licenses()
return Licensing((LicenseSymbolLike(lic) for lic in licenses_db.values()))
return Licensing(symbols=(LicenseSymbolLike(lic) for lic in licenses_db.values()))


def build_spdx_symbols(licenses_db=None):
Expand Down Expand Up @@ -324,7 +324,6 @@ def get_licenses_by_spdx_key(

Optionally include deprecated if ``include_deprecated`` is True.


Optionally make the keys lowercase if ``lowercase_keys`` is True.

Optionally include the license "other_spdx_license_keys" if present and
Expand Down
8 changes: 8 additions & 0 deletions src/licensedcode/data/licenses/agpl-3.0-bacula.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
key: agpl-3.0-bacula
is_deprecated: yes
replaced_by:
- bacula-exception
- bsd-simplified
- bsd-simplified
- bsd-simplified
- agpl-3.0-plus
- agpl-3.0-plus
- agpl-3.0
short_name: AGPL 3.0 with Bacula exception
name: AGPL 3.0 with Bacula exception
category: Copyleft
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
key: agpl-3.0-linking-exception
is_deprecated: yes
replaced_by:
- linking-exception-agpl-3.0
short_name: AGPL 3.0 linking exception
name: AGPL 3.0 linking exception
category: Copyleft Limited
owner: Unspecified
is_exception: yes
homepage_url: http://mo.morsi.org/blog/2009/08/13/lesser_affero_gplv3/
notes: renamed to linking-exception-agpl-3.0
is_deprecated: yes
is_exception: yes
---

Additional permission under the GNU Affero GPL version 3 section 7:
Expand Down
7 changes: 4 additions & 3 deletions src/licensedcode/data/licenses/agpl-3.0-openssl.LICENSE
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
key: agpl-3.0-openssl
is_deprecated: yes
replaced_by:
- openssl-exception-agpl-3.0
short_name: AGPL 3.0 with OpenSSL exception
name: AGPL 3.0 with OpenSSL exception
category: Copyleft
owner: MongoDB
is_exception: yes
is_deprecated: yes
notes: replaced by openssl-exception-agpl-3.0
is_exception: yes
---


As a special exception, the copyright holders give permission to link the
code of portions of this program with the OpenSSL library under certain
conditions as described in each individual source file and distribute
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/aladdin-md5.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: aladdin-md5
is_deprecated: yes
replaced_by:
- zlib
short_name: Aladdin MD5 License
name: Aladdin MD5 License
category: Permissive
Expand Down
4 changes: 3 additions & 1 deletion src/licensedcode/data/licenses/aop-pd.LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
key: aop-pd
is_deprecated: yes
replaced_by:
- cc-pd
short_name: AOP-PD
name: AOP Public Domain License
is_deprecated: yes
category: Public Domain
owner: AOP Alliance Project
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
key: apache-2.0-linking-exception
is_deprecated: yes
replaced_by:
- compuphase-linking-exception
short_name: Apache 2.0 with Linking Exception
name: Apache 2.0 with Linking Exception
category: Permissive
owner: compuphase
homepage_url: https://github.com/compuphase/minIni/blob/master/LICENSE
is_exception: yes
is_deprecated: yes
---

EXCEPTION TO THE APACHE 2.0 LICENSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
key: apache-2.0-runtime-library-exception
is_deprecated: yes
replaced_by:
- apple-runtime-library-exception
short_name: Apache 2.0 with Runtime Library Exception
name: Apache 2.0 with Runtime Library Exception
category: Permissive
Expand All @@ -8,7 +11,6 @@ homepage_url: https://github.com/apple/swift/blob/master/LICENSE.txt#L205
is_exception: yes
other_urls:
- https://swift.org/
is_deprecated: yes
---

## Runtime Library Exception to the Apache 2.0 License: ##
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/apache-due-credit.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: apache-due-credit
is_deprecated: yes
replaced_by:
- dom4j
short_name: Apache Due Credit Variant
name: Apache Due Credit Variant
category: Permissive
Expand Down
6 changes: 4 additions & 2 deletions src/licensedcode/data/licenses/apache-exception-llvm.LICENSE
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
key: apache-exception-llvm
is_deprecated: yes
replaced_by:
- llvm-exception
short_name: Apache-Exception-llvm
name: Apache Exception LLVM
category: Permissive
owner: Apache Software Foundation
homepage_url: https://lists.spdx.org
is_exception: yes
is_deprecated: yes
notes: Replaced by llvm-exception
is_exception: yes
text_urls:
- https://lists.spdx.org/pipermail/spdx-legal/2017-December/002421.html
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: apache-patent-provision-exception
is_deprecated: yes
replaced_by:
- apache-patent-exception
short_name: Apache Patent Provision Exception Deprecated
name: Apache Patent Provision Exception Deprecated
category: Permissive
Expand Down
3 changes: 2 additions & 1 deletion src/licensedcode/data/licenses/baekmuk-fonts.LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ignorable_copyrights:
- Copyright (c) Kim Jeong-Hwan
ignorable_holders:
- Kim Jeong-Hwan
minimum_coverage: 80
---

Baekmuk Fonts License
Expand All @@ -26,4 +27,4 @@ derivative works or modified versions, and that the following
acknowledgement appear in supporting documentation:
Baekmuk Batang, Baekmuk Dotum, Baekmuk Gulim, and
Baekmuk Headline are registered trademarks owned by
Kim Jeong-Hwan.
Kim Jeong-Hwan.
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/broadcom-dual.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: broadcom-dual
is_deprecated: yes
replaced_by:
- gpl-2.0 OR commercial-license
short_name: Broadcom Dual GPL-Commercial
name: Broadcom Dual GPL-Commercial
category: Copyleft
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: broadcom-linking-unmodified
is_deprecated: yes
replaced_by:
- broadcom-unmodified-exception
short_name: Broadcom Linking Exception if unmodified
name: Broadcom Linking Exception if unmodified
category: Copyleft Limited
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: broadcom-unpublished-source
is_deprecated: yes
replaced_by:
- unpublished-source
short_name: Broadcom Unpublished Source License
name: Broadcom Unpublished Source License
category: Commercial
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/bsd-2-clause-freebsd.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: bsd-2-clause-freebsd
is_deprecated: yes
replaced_by:
- bsd-2-clause-views
short_name: BSD-2-Clause-FreeBSD
name: BSD-2-Clause-FreeBSD License
category: Permissive
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/bsd-2-clause-netbsd.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: bsd-2-clause-netbsd
is_deprecated: yes
replaced_by:
- bsd-simplified
short_name: BSD-2-Clause-NetBSD
name: BSD-2-Clause-NetBSD License
category: Permissive
Expand Down
4 changes: 3 additions & 1 deletion src/licensedcode/data/licenses/bsd-axis.LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
key: bsd-axis
is_deprecated: yes
replaced_by:
- bsd-source-code
short_name: BSD-Axis
name: BSD-Axis
category: Permissive
owner: Axis Communications
notes: This is a variant composed of clause 1 and 3 of a BSD-Modified found in the Linux kernel
This is now replaced by the bsd-source-code license.
is_deprecated: yes
---

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 3 additions & 1 deletion src/licensedcode/data/licenses/bsd-intel.LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
key: bsd-intel
is_deprecated: yes
replaced_by:
- bsd-new
short_name: BSD Intel License
name: BSD Intel License
category: Permissive
owner: Intel Corporation
is_deprecated: yes
---

Redistribution and use in source and binary forms, with or without modification,
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/bsd-new-far-manager.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: bsd-new-far-manager
is_deprecated: yes
replaced_by:
- bsd-new WITH far-manager-exception
short_name: BSD-3-Clause with Far Manager exception
name: BSD-3-Clause with Far Manager exception
category: Permissive
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/bsd-original-uc-1990.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: bsd-original-uc-1990
is_deprecated: yes
replaced_by:
- bsla
short_name: BSD-Original-UC-1990
name: BSD-Original-UC-1990
category: Permissive
Expand Down
2 changes: 2 additions & 0 deletions src/licensedcode/data/licenses/bzip2-libbzip-1.0.5.LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
key: bzip2-libbzip-1.0.5
is_deprecated: yes
replaced_by:
- bzip2-libbzip-2010
short_name: bzip2 License
name: bzip2 License
category: Permissive
Expand Down
8 changes: 5 additions & 3 deletions src/licensedcode/data/licenses/ccrc-1.0.LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
key: ccrc-1.0
is_deprecated: yes
replaced_by:
- gplcc-1.0
short_name: Common Cure Rights Commitment v1.0
name: Common Cure Rights Commitment v1.0
category: Copyleft
owner: Red Hat, Inc.
homepage_url: https://www.redhat.com/en/about/press-releases/technology-industry-leaders-join-forces-increase-predictability-open-source-licensing
notes: the text of the license itself is under the CC-BY-SA-4.0 license. And this license has
been renamed to gplcc-1.0
text_urls:
- http://git.gluster.org/cgit/glusterfs.git/tree/COMMITMENT
- https://raw.githubusercontent.com/wildfly/wildfly/master/COMMITMENT
other_urls:
- https://www.redhat.com/en/about/press-releases/technology-industry-leaders-join-forces-increase-predictability-open-source-licensing
- https://www.fsf.org/blogs/licensing/red-hat-leads-coalition-supporting-key-part-of-principles-of-community-oriented-gpl-enforcement
notes: the text of the license itself is under the CC-BY-SA-4.0 license. And this license has
been renamed to gplcc-1.0
is_deprecated: yes
---

Common Cure Rights Commitment
Expand Down
Loading