licensee
licensee copied to clipboard
Uncertain detection alternatives preferred over 100% match
Describe the bug
licensee rather chooses the license of a semi-matching file, than the obvious real license.
tested with licensee (9.15.2). Possible related to #553.
Steps to reproduce the behavior
- Have GPL-v3 in file LICENSE.
- Have COPYING file with the GPL-3 author list, e.g. like this:
Some Project Name
Copyright (C) 2022 Me <[email protected]>
Copyright (C) 2022 Somebody Else <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
- no other files in the directory
- run licensee in that directory and observe:
the
COPYINGfile will lead the resulting license to be NOASSERTION (the same happens when README.md somehow contains license-like stuff):
License: NOASSERTION
Matched files: LICENSE, COPYING
LICENSE:
Content hash: 7d4cdf499d39e2e1ce27b2878e22872f0f5a74dd
Confidence: 100.00%
Matcher: Licensee::Matchers::Exact
License: GPL-3.0
COPYING:
Content hash: 2f29ec33661722c9edad2933efae8941595dd67d
License: NOASSERTION
Closest non-matching licenses:
ISC similarity: 29.33%
Zlib similarity: 28.24%
MIT-0 similarity: 27.84%
Expected behavior
It should obviously detect GPL-3 instead of NOASSERTION.
This is by design. When licensee sees a possible license indicator it is uncertain about, it does not make an overall license assertion. As mentioned in https://github.com/licensee/licensee/issues/555#issuecomment-1100929646= it conceivably could detect standard license headers that complement licenses that they are paired with, which may be the case here.