boyter / lc

licensechecker (lc) a command line application which scans directories and identifies what software license things are under producing reports as either SPDX, CSV, JSON, XLSX or CLI Tabular output. Dual-licensed under MIT or the UNLICENSE.
GNU Affero General Public License v3.0
124 stars 17 forks source link

lc thinks MIT is JSON if there are 2 copyright lines #36

Closed maxice8 closed 6 years ago

maxice8 commented 6 years ago

with 2 copyright lines

File     License  Confidence  Size
masterdir/builddir/libmaa-1.4.2/doc/  LICENSE  JSON     92.85%      1.1K

with 1 copyright line

File     License  Confidence  Size
masterdir/builddir/libmaa-1.4.2/doc/  LICENSE  MIT      94.29%      1.1K

LICENSE file

Copyright (c) 1995-2002 Rik Faith <rikfaith@gmail.com>
Copyright (c) 2002-2018 Aleksey Cheusov <vle@gmx.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
boyter commented 6 years ago

MIT and JSON. The bane of my existence. Annoyingly on the failing case it is so close to being correct as well with the generic method of checking.

{JSON 0.928547293335935} {MIT 0.9224754899801437}

Going to add in a special case specifically for this situation. I believe that's how other tools handle this situation anyway. Since the licenses shouldn't change rather there will be a new one rather than the old one being updated this isn't the worst option in the world.

boyter commented 6 years ago

https://github.com/boyter/lc/pull/37

Waiting for CI to process, and if all good will be merged in. Hope you don't mind me using the emails in the above example as test cases. If you do let me know and ill change them.

boyter commented 6 years ago

Not sure if you are building from source, but if you grab the latest and install it the results should be correct for your case now. Ill package it up into an official release now.

maxice8 commented 6 years ago

On Thu, Mar 08, 2018 at 09:28:06PM +0000, Ben Boyter wrote:

Not sure if you are building from source, but if you grab the latest and install it the results should be correct for your case now. Ill package it up into an official release now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.*

Thanks, i'm getting the binary package from Void Linux, i am pushing to using SPDX titles for our license= keys in the package templates. we have a few thousand packages that wrongly indicate BSD so i'm using lc to correctly identify the license.

boyter commented 6 years ago

No problem ill push it out now.

boyter commented 6 years ago

And done https://github.com/boyter/lc/releases/tag/v1.3.1

boyter commented 6 years ago

After looking at the above a little more closely they look more like MIT-feh than MIT which is what they are being picked up as in the application with the new tweaks.

Going to leave it as MIT-feh as one of the signals used to determine the difference is that MIT starts with The MIT License and MIT-feh does not.