cutenode / delice

📑 A CLI to help you get insight into your projects' licenses
MIT License
55 stars 5 forks source link

Better error messages for custom (valid) license declarations #3

Closed gantoine closed 1 year ago

gantoine commented 5 years ago

The NPM docs for package.json consider the following license formats as valid:

{ "license" : "SEE LICENSE IN <filename>" }
{ "license": "UNLICENSED" }

This PR adds support for those license types in the form of custom info/warning messages:

Screen Shot 2019-08-03 at 12 08 15 AM Screen Shot 2019-08-02 at 11 33 55 PM Screen Shot 2019-08-02 at 11 33 45 PM

I'm interested in people's thoughts on this change as a whole (is this a positive change?), and on the colour changes for non-errors.

bnb commented 5 years ago

I think this is super valuable and I really appreciate you PRing it!

I also think that it may be less of a missing feature in delice and more of a missing feature in liblice, the underlying module that is intended to do this parsing.

As I said, I really appreciate your work on this. If you don't feel you have the time or energy to convert this to an implementation in liblice, I'd be more than willing to base such an implementation off your work and credit you fully for the work and implementation. Otherwise, if you do have time and energy to implement there, I'd be more than happy to accept a PR on liblice that implements this ❤️

For reference, in liblice you'd likely want to implement this kind of functionality in the parseLicense file, but you'd also need to not directly pass the parsed license to conformance in modules.js.