Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for LICENSE files. #28

Open
rerdavies opened this issue Aug 24, 2021 · 1 comment
Open

Check for LICENSE files. #28

rerdavies opened this issue Aug 24, 2021 · 1 comment

Comments

@rerdavies
Copy link

It would be really nice if you could look for LICENSE files in npm packages, and use the contents of those files as default content for files under a directory that does contain such a file.

npm packages are required to have a file in the root of the package directory named LICENSE, LICENSE., license or license..

The standard convention in NPM pagckages seems to be to add the following header text in js files;

   /*
   Copyright 2018 Google LLC
   See LICENSE for license text. (or some variant of that).
   */

licensecheck gets the copyright string, but, of course returns UNKNOWN for license type. But licensecheck manages to get the license type right almost always, when run against the LICENSE file.

The suggested fix: if licensecheck returns UNKNOWN for a given file, search the directory and parent directories, looking for a (LICENSE|license).* file, and use the license type reported by running licensecheck on THAT file instead.

Needless to say, this has broad applicability to projects of other types as well.

@dod38fr
Copy link
Owner

dod38fr commented Sep 7, 2021

okay, that makes sense.

There's already a similar algorithm, but it can only take "main" copyright and license info from the same file (i.e. from README or LICENSE).

I'll improve this algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants