Skip to content

Check for LICENSE files. #28

Description

@rerdavies

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions