Skip to content

Commit 7b7dec3

Browse files
Merge branch 'develop' into update-license-rules
2 parents f4cf291 + 4bca665 commit 7b7dec3

File tree

9,639 files changed

+26802
-30259
lines changed

Some content is hidden

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

9,639 files changed

+26802
-30259
lines changed

.github/ISSUE_TEMPLATE/--doc-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: "Documentation Improvement"
2+
name: Documentation Improvement
33
about: Your suggestions for improving the scancode-toolkit Documentation.
44
title: ''
5-
labels: 'documentation'
5+
labels: documentation
66
assignees: ''
77

88
---
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: New License Request
3+
about: Request a new license for scancode detection purposes
4+
title: 'New license request: '
5+
labels: new-license
6+
assignees: DennisClark
7+
8+
---
9+
10+
**License Name**
11+
The full name of the license, preferably as provided by the original authors.
12+
13+
**License Homepage URL**
14+
The primary and/or most reliable URL that contains the text of this license and/or information about it. This is ideally a web page dedicated to the license, but it may also be a source file that contains the license text.
15+
16+
**Reference URLs**
17+
Optionally provide URLs that contain references to the license.
18+
19+
**License Notes**
20+
Optionally describe any aspects of the license that deserve special attention.

.github/workflows/about-files-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ permissions:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-24.04
1111

1212
strategy:
1313
max-parallel: 4
1414
matrix:
15-
python-version: [3.9]
15+
python-version: [3.11]
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Set up Python ${{ matrix.python-version }}
2222
uses: actions/setup-python@v4

azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- template: etc/ci/azure-posix.yml
1515
parameters:
1616
job_name: core_tests
17-
image_name: ubuntu-20.04
17+
image_name: ubuntu-24.04
1818
python_versions: ['3.10']
1919
test_suites:
2020
misc_and_scancode: |
@@ -197,8 +197,8 @@ jobs:
197197

198198
- template: etc/ci/azure-posix.yml
199199
parameters:
200-
job_name: ubuntu20_test_all_supported_click_versions
201-
image_name: ubuntu-20.04
200+
job_name: ubuntu22_test_all_supported_click_versions
201+
image_name: ubuntu-22.04
202202
python_versions: ['3.9', '3.10', '3.11', '3.12']
203203
python_architecture: x64
204204
test_suites:
@@ -225,8 +225,8 @@ jobs:
225225

226226
- template: etc/ci/azure-posix.yml
227227
parameters:
228-
job_name: ubuntu20_cpython_latest_from_pip
229-
image_name: ubuntu-20.04
228+
job_name: ubuntu24_cpython_latest_from_pip
229+
image_name: ubuntu-24.04
230230
python_versions: ['3.9', '3.10', '3.11', '3.12']
231231
test_suites:
232232
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py

docs/source/how-to-guides/add_new_license_detection_rule.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ More (advanced) rules options:
7373
be present in the result license detections. These just have the license text and a
7474
`is_false_positive` flag set to True.
7575

76-
- you can specify key phrases by surrounding one or more words between the `{{`
76+
- you can specify required phrases by surrounding one or more words between the `{{`
7777
and `}}` tags. Key phrases are words that **must** be matched/present in order
7878
for a RULE to be considered a match.
7979

etc/scripts/licenses/buildrules.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from licensedcode import models
1717
from licensedcode import match_hash
1818
from licensedcode import frontmatter
19+
from licensedcode.models import get_rule_id_for_text
1920
from license_expression import Licensing
2021

2122
"""
@@ -130,23 +131,6 @@ def load_data(location="00-new-licenses.txt"):
130131
return rules
131132

132133

133-
def rule_exists(text):
134-
"""
135-
Return the matched rule identifier if the text is an existing rule matched
136-
exactly, False otherwise.
137-
"""
138-
idx = cache.get_index()
139-
140-
matches = idx.match(query_string=text)
141-
if not matches:
142-
return False
143-
if len(matches) > 1:
144-
return False
145-
match = matches[0]
146-
if match.matcher == match_hash.MATCH_HASH and match.score() == 100:
147-
return match.rule.identifier
148-
149-
150134
def all_rule_by_tokens():
151135
"""
152136
Return a mapping of {tuples of tokens: rule id}, with one item for each
@@ -347,7 +331,7 @@ def cli(licenses_file, dump_to_file_on_errors=False):
347331

348332
text = rule.text
349333

350-
existing_rule = rule_exists(text)
334+
existing_rule = get_rule_id_for_text(text)
351335
skinny_text = " ".join(text[:80].split()).replace("{", " ").replace("}", " ")
352336

353337
existing_msg = (

etc/scripts/licenses/report_license_rules.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"is_license_reference",
6363
"is_license_intro",
6464
"is_license_clue",
65+
"is_required_phrase",
66+
"skip_for_required_phrase_generation",
6567
"is_deprecated",
6668
"has_unknown",
6769
"only_known_words",

respective.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This software is (C) by the respective authors, and licensed under the GPL
2+
License.
3+

setup-mini.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ console_scripts =
158158
scancode-reindex-licenses = licensedcode.reindex:reindex_licenses
159159
scancode-license-data = licensedcode.license_db:dump_scancode_license_data
160160
regen-package-docs = packagedcode.regen_package_docs:regen_package_docs
161+
add-required-phrases = licensedcode.required_phrases:add_required_phrases
161162

162163
# These are configurations for ScanCode plugins as setuptools entry points.
163164
# Each plugin entry hast this form:

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ console_scripts =
158158
scancode-reindex-licenses = licensedcode.reindex:reindex_licenses
159159
scancode-license-data = licensedcode.license_db:dump_scancode_license_data
160160
regen-package-docs = packagedcode.regen_package_docs:regen_package_docs
161+
add-required-phrases = licensedcode.required_phrases:add_required_phrases
162+
gen-new-required-phrases-rules = licensedcode.required_phrases:gen_required_phrases_rules
161163

162164
# These are configurations for ScanCode plugins as setuptools entry points.
163165
# Each plugin entry hast this form:

0 commit comments

Comments
 (0)