ryanuber / go-license

Software licensing standardization library for Golang
MIT License
69 stars 15 forks source link

Unable to detect MPL20 in markdown format #14

Closed client9 closed 7 years ago

client9 commented 8 years ago

You might recognize this one :-)

https://github.com/mitchellh/packer/blob/master/LICENSE

there are a number of others:

https://github.com/client9/gosupplychain/blob/master/reports/github-users.md#mitchellh

satreix commented 7 years ago

The following solves the issue.

-   case scan(comp, "mozilla public license, version 2.0"):
+   case scan(comp, "mozilla public license version 2.0"):

We might want to go from using litteral license extracts to using looser regex or fuzzy lookup with a short distance.

ryanuber commented 7 years ago

15 fixes this by normalizing the text a bit more. I plan on bringing that in this week. Fixing all white space and/or newlines to a single space, lowercasing everything, and stripping quotes and other punctuation solves the 95% case without getting too complicated. Also FWIW, I just merged #19 that fixes this exact issue on master.