Skip to content

Commit 1f7fafd

Browse files
authored
Merge pull request #2776 from fangxlmr/fix-yaml-dup-keys
Fix invalid license yaml files by resolving duplicated keys
2 parents 1fdf40f + ae95367 commit 1f7fafd

10 files changed

Lines changed: 9 additions & 18 deletions

File tree

src/licensedcode/data/licenses/agpl-1.0-plus.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ other_spdx_license_keys:
1515
text_urls:
1616
- http://www.affero.org/oagpl.html
1717
faq_url: http://www.affero.org/oagf.html
18-
minimum_coverage: 99
1918
ignorable_copyrights:
2019
- Copyright (c) 2002 Affero Inc.
2120
- copyright (c) 1989, 1991 Free Software Foundation, Inc.

src/licensedcode/data/licenses/agpl-3.0-plus.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ other_urls:
2020
- http://www.opensource.org/licenses/AGPL-3.0
2121
- https://opensource.org/licenses/AGPL-3.0
2222
- https://www.gnu.org/licenses/agpl.txt
23-
ignorable_urls:
24-
- http://www.gnu.org/licenses/
2523
minimum_coverage: 99
2624
ignorable_copyrights:
2725
- Copyright (c) 2007 Free Software Foundation, Inc. <https://fsf.org/>
@@ -31,4 +29,3 @@ ignorable_urls:
3129
- http://www.gnu.org/licenses/
3230
- https://fsf.org/
3331
- https://www.gnu.org/licenses/
34-

src/licensedcode/data/licenses/ecos.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ name: GPL 2.0 or later with eCos Exception
55
category: Copyleft Limited
66
owner: eCos
77
homepage_url: http://ecos.sourceware.org/ecos-license/
8-
notes: Per SPDX.org, this is really GPL v2 or later + an exception
98
is_exception: yes
109
spdx_license_key: eCos-2.0
1110
text_urls:
1211
- http://www.fsf.org/licensing/licenses/ecos-license.html
1312
- http://www.gnu.org/licenses/ecos-license.html
1413
faq_url: http://ecos.sourceware.org/license-overview.html
1514
minimum_coverage: 100
16-
notes: replaced by ecos-exception-2.0
15+
notes: |
16+
Per SPDX.org, this is really GPL v2 or later + an exception.
17+
Replaced by ecos-exception-2.0.

src/licensedcode/data/licenses/ekioh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ short_name: Ekioh License
44
name: Ekioh License
55
category: Permissive
66
owner: Ekioh
7-
notes: see also https://kryogenix.org/code/browser/licence.html
87
notes: |
98
Obsolete License -- do not use. Except for the dangling ", subject to the
109
following conditions:" text, this license is essentially identical to the
1110
MIT-0-Clause (mit-0) license, which has been accepted in the open source
1211
community relatively recently.
12+
See also https://kryogenix.org/code/browser/licence.html.

src/licensedcode/data/licenses/gpl-2.0-plus-openssl.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ owner: magnumripper
77
homepage_url: https://github.com/magnumripper/JohnTheRipper/blob/1.8.0/doc/LICENSE
88
notes: replaced by openssl-exception-gpl-2.0-plus
99
is_exception: yes
10-
notes: replaced by openssl-exception-gpl-2.0-plus

src/licensedcode/data/licenses/gpl-3.0-plus.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ other_urls:
1616
- http://www.opensource.org/licenses/GPL-3.0
1717
- https://opensource.org/licenses/GPL-3.0
1818
- https://www.gnu.org/licenses/gpl-3.0-standalone.html
19-
ignorable_urls:
20-
- http://www.gnu.org/licenses/
2119
minimum_coverage: 99
2220
ignorable_copyrights:
2321
- Copyright (c) 2007 Free Software Foundation, Inc. <https://fsf.org/>
@@ -28,4 +26,3 @@ ignorable_urls:
2826
- https://fsf.org/
2927
- https://www.gnu.org/licenses/
3028
- https://www.gnu.org/licenses/why-not-lgpl.html
31-

src/licensedcode/data/licenses/lgpl-2.1-spell-checker.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ standard_notice: |-
2020
this file, you may extend this exception to your version of the
2121
file, but you are not obligated to do so. If you do not wish to
2222
do so, delete this exception statement from your version.
23-
notes: replaced by spell-checker-exception-lgpl-2.1-plus

src/licensedcode/data/licenses/openssl.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ spdx_license_key: LicenseRef-scancode-openssl
1212
faq_url: http://www.openssl.org/support/faq.html
1313
other_urls:
1414
- http://www.openssl.org/source/license.html
15-
minimum_coverage: 30
1615
ignorable_authors:
1716
- the OpenSSL Project
1817
ignorable_urls:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
license_expression: bsd-new OR gpl-2.0
22
is_license_notice: yes
33
relevance: 99
4-
notes: this is also rarely seen with the bsd-simplified license, hence the lowered relevance
54
referenced_filenames:
65
- LICENSE
76
- COPYING
8-
notes: this is used sometimes with a bsd-new and sometimes with a
9-
bsd-simplified and is both long enough and vaguely defined
7+
notes: |
8+
This is used sometimes with a bsd-new and is both long enough and vaguely defined.
9+
This is also rarely seen with the bsd-simplified license, hence the lowered relevance.

src/licensedcode/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def load(self):
258258
"""
259259
try:
260260
with io.open(self.data_file, encoding='utf-8') as f:
261-
data = saneyaml.load(f.read())
261+
data = saneyaml.load(f.read(), allow_duplicate_keys=False)
262262

263263
for k, v in data.items():
264264
if k == 'minimum_coverage':
@@ -1228,7 +1228,7 @@ def load(self):
12281228
"""
12291229
try:
12301230
with io.open(self.data_file, encoding='utf-8') as f:
1231-
data = saneyaml.load(f.read())
1231+
data = saneyaml.load(f.read(), allow_duplicate_keys=False)
12321232
except Exception as e:
12331233
print('#############################')
12341234
print('INVALID LICENSE RULE FILE:', f'file://{self.data_file}')

0 commit comments

Comments
 (0)