aboutcode-org / aboutcode-org/scancode-toolkit

Disambiguate closely related and versioned licenses

Đang mở
#2,399 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
license scan new feature
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

#### Problem

There is a class of license notice that is problematic, for instance short GPL notices such as this one (which is not a real one but made up for illustration):

> we prefer to use the GPL
> therefore this is licensed under the GPL 2.0

The scan yields these licenses (scan has been edited for brevity):
```JSON
"licenses": [
{
"key": "gpl-1.0-plus",
"score": 85.0,
"start_line": 1,
"end_line": 1,
"matched_text": "the gpl"
},
{
"key": "gpl-3.0-plus",
"score": 4.0,
"start_line": 2,
"end_line": 2,
"matched_text": "therefore [this] is licensed under [the] gpl"
},
{
"key": "gpl-2.0",
"score": 100.0,
"start_line": 2,
"end_line": 2,
"matched_text": "licensed under the gpl 2."
}
],
```

This is obviously both more or less correct and superbly wrong. The right answer
should be GPL-2.0 and nothing else.
The licenses involved with this class of ambiguous detections are:
- mostly the A/L/GPL with and without versions
- to a lesser extent, other GFDL license

#### Solution elements

While I would hate to have code that is specific to the A/L/GPL licenses these are likely two few licenses and too common not to treat these specially, though there may be some ways to address this in some data-driven way:

1. using the upcoming https://github.com/nexB/scancode-results-analyzer/ should be helpful and is generic for a start
2. today there is no explicit relationship stored in the data between a) the versions of a license (GPL 1,2,3 and or-later variants b) closely related licenses such as the A/L/GPL or closely related BSD variants or MITs. Tracking this explicitly as extra attributes in the License record could then enable data-driven refined disambiguation and merging

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.