Skip to content

Commit 427e8ae

Browse files
Merge pull request #4215 from aboutcode-org/4190-license-licence
Support equivalent words in license detection #4190
2 parents 41c06e9 + d81f2b5 commit 427e8ae

File tree

2,102 files changed

+18118
-9559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,102 files changed

+18118
-9559
lines changed

CHANGELOG.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Changelog
22
=========
33

4-
v33.0.0 (next next, roadmap)
5-
----------------------------
6-
74
- We now support new package manifest formats:
85

96
- OpenWRT packages.
107
- Yocto/BitBake .bb recipes.
118

129

10+
v33.0.0 (next next, roadmap)
11+
----------------------------
12+
1313
- Fallback packages for non-native dependencies of SCTK.
1414
- Dependencies for
1515
- Support for copyright detection objects.
@@ -26,9 +26,14 @@ v33.0.0 (next next, roadmap)
2626

2727
- `--unknown-licenses` is removed and this is always enabled
2828
and only used in case of improper detections automatically.
29-
Also tag all license rules with required phrases to improve
30-
license detection and reduce false positives.
31-
See https://github.com/nexB/scancode-toolkit/issues/3300
29+
30+
- All license rules have been tagged with required phrases to improve detection accuracy
31+
and reduce false positives. See https://github.com/nexB/scancode-toolkit/issues/3300
32+
33+
- Equivalent words like license and licence, as well as plurals are now treated as the same in
34+
license detection. With this, many redundant rules have been deprecated.
35+
36+
- The license detection accuracy of Maven POMS has been improved fixing corner cases.
3237

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

49+
4450
v32.3.3 - 2025-03-06
4551
--------------------
4652

etc/scripts/licenses/buildrules.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from licensedcode import cache
1616
from licensedcode import models
17-
from licensedcode import match_hash
1817
from licensedcode import frontmatter
1918
from licensedcode.models import get_rule_id_for_text
2019
from license_expression import Licensing
@@ -73,7 +72,13 @@ def __attrs_post_init__(self, *args, **kwargs):
7372
print(rdat)
7473
print("########################################################")
7574
raise
76-
self.data = {k: v for k, v in self.data.items() if v is not None or (v is None and k == "license_expression")}
75+
if "referenced_filenames" in self.data and not self.data["referenced_filenames"]:
76+
self.data.pop("referenced_filenames")
77+
self.data = {
78+
k: v for k, v in self.data.items()
79+
if v is not None
80+
or (v is None and k == "license_expression")
81+
}
7782

7883

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

134139
def all_rule_by_tokens():
135140
"""
136-
Return a mapping of {tuples of tokens: rule id}, with one item for each
141+
Return a mapping of {(tuple of token id): rule id}, with one item for each
137142
existing and added rules. Used to avoid duplicates.
138143
"""
139144
rule_tokens = {}
@@ -143,7 +148,7 @@ def all_rule_by_tokens():
143148
except Exception as e:
144149
rf = f" file://{rule.rule_file()}"
145150
raise Exception(
146-
f"Failed to to get tokens from rule:: {rule.identifier}\n" f"{rf}"
151+
f"Failed to get tokens from rule:: {rule.identifier}\n" f"{rf}"
147152
) from e
148153
return rule_tokens
149154

src/formattedcode/output_cyclonedx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
from typing import List
2121

2222
import attr
23+
from lxml import etree
2324
from commoncode.cliutils import OUTPUT_GROUP
2425
from commoncode.cliutils import PluggableCommandLineOption
25-
from lxml import etree
2626
from plugincode.output import OutputPlugin
2727
from plugincode.output import output_impl
2828

src/licensedcode/cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def build_licensing(licenses_db=None):
284284
from licensedcode.models import load_licenses
285285

286286
licenses_db = licenses_db or load_licenses()
287-
return Licensing((LicenseSymbolLike(lic) for lic in licenses_db.values()))
287+
return Licensing(symbols=(LicenseSymbolLike(lic) for lic in licenses_db.values()))
288288

289289

290290
def build_spdx_symbols(licenses_db=None):
@@ -324,7 +324,6 @@ def get_licenses_by_spdx_key(
324324
325325
Optionally include deprecated if ``include_deprecated`` is True.
326326
327-
328327
Optionally make the keys lowercase if ``lowercase_keys`` is True.
329328
330329
Optionally include the license "other_spdx_license_keys" if present and

src/licensedcode/data/licenses/agpl-3.0-bacula.LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
key: agpl-3.0-bacula
33
is_deprecated: yes
4+
replaced_by:
5+
- bacula-exception
6+
- bsd-simplified
7+
- bsd-simplified
8+
- bsd-simplified
9+
- agpl-3.0-plus
10+
- agpl-3.0-plus
11+
- agpl-3.0
412
short_name: AGPL 3.0 with Bacula exception
513
name: AGPL 3.0 with Bacula exception
614
category: Copyleft

src/licensedcode/data/licenses/agpl-3.0-linking-exception.LICENSE

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
key: agpl-3.0-linking-exception
3+
is_deprecated: yes
4+
replaced_by:
5+
- linking-exception-agpl-3.0
36
short_name: AGPL 3.0 linking exception
47
name: AGPL 3.0 linking exception
58
category: Copyleft Limited
69
owner: Unspecified
7-
is_exception: yes
810
homepage_url: http://mo.morsi.org/blog/2009/08/13/lesser_affero_gplv3/
911
notes: renamed to linking-exception-agpl-3.0
10-
is_deprecated: yes
12+
is_exception: yes
1113
---
1214

1315
Additional permission under the GNU Affero GPL version 3 section 7:

src/licensedcode/data/licenses/agpl-3.0-openssl.LICENSE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
22
key: agpl-3.0-openssl
3+
is_deprecated: yes
4+
replaced_by:
5+
- openssl-exception-agpl-3.0
36
short_name: AGPL 3.0 with OpenSSL exception
47
name: AGPL 3.0 with OpenSSL exception
58
category: Copyleft
69
owner: MongoDB
7-
is_exception: yes
8-
is_deprecated: yes
910
notes: replaced by openssl-exception-agpl-3.0
11+
is_exception: yes
1012
---
1113

12-
1314
As a special exception, the copyright holders give permission to link the
1415
code of portions of this program with the OpenSSL library under certain
1516
conditions as described in each individual source file and distribute

src/licensedcode/data/licenses/aladdin-md5.LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
key: aladdin-md5
33
is_deprecated: yes
4+
replaced_by:
5+
- zlib
46
short_name: Aladdin MD5 License
57
name: Aladdin MD5 License
68
category: Permissive

src/licensedcode/data/licenses/aop-pd.LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
key: aop-pd
3+
is_deprecated: yes
4+
replaced_by:
5+
- cc-pd
36
short_name: AOP-PD
47
name: AOP Public Domain License
5-
is_deprecated: yes
68
category: Public Domain
79
owner: AOP Alliance Project
810
---

src/licensedcode/data/licenses/apache-2.0-linking-exception.LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
key: apache-2.0-linking-exception
3+
is_deprecated: yes
4+
replaced_by:
5+
- compuphase-linking-exception
36
short_name: Apache 2.0 with Linking Exception
47
name: Apache 2.0 with Linking Exception
58
category: Permissive
69
owner: compuphase
710
homepage_url: https://github.com/compuphase/minIni/blob/master/LICENSE
811
is_exception: yes
9-
is_deprecated: yes
1012
---
1113

1214
EXCEPTION TO THE APACHE 2.0 LICENSE

0 commit comments

Comments
 (0)