licensecheck

The licensecheck package classifies license files and heuristically determines how well they correspond to known open source licenses.

  • Owner: google/licensecheck
  • Platform:
  • License:: BSD 3-Clause "New" or "Revised" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

The licensecheck package classifies license files and heuristically
determines how well they correspond to known open source licenses.

The design aims never to give a false positive. It uses a soft text
matching algorithm, though, which means it can miss valid licenses
that have been modified more than usual. It also recognizes licenses
identified by URL.

To use this package, the client first identifies a file or text
that might contain a license, then calls the Cover function for a
description of what licenses are present in the text. The description
returned by Cover lists the licenses in the order they appear in
the text. By convention in most open source repositories, the first
license present describes the main body of the work, while subsequent
licenses apply to borrowed subcomponents.

The output of go doc Cover and go doc Coverage provides more
information:

func Cover(input []byte, opts Options) (Coverage, bool)
    Cover computes the coverage of the text according to the license set
    compiled into the package.

    An input text may match multiple licenses. If that happens, Match contains
    only disjoint matches. If multiple licenses match a particular section of
    the input, the best match is chosen so the returned coverage describes at
    most one match for each section of the input.

type Coverage struct {
	// Percent is the fraction of the total text, in normalized words, that
	// matches any valid license, expressed as a percentage across all of the
	// licenses matched.
	Percent float64

	// Match describes, in sequential order, the matches of the input text
	// across the various licenses. Typically it will be only one match long,
	// but if the input text is a concatenation of licenses it will contain
	// a match value for each element of the concatenation.
	Match []Match
}
    Coverage describes how the text matches various licenses.

The licenses subdirectory contains canonical forms of the licenses
recognized by the package. The list covers most open source software
but is not comprehensive. More licenses may be added by copying
their text to the subdirectory as individual files and running go generate in the root.

Main metrics

Overview
Name With Ownergoogle/licensecheck
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2019-04-15 23:50:20
Pushed At2024-04-14 19:19:16
Last Commit At
Release Count5
Last Release Namev0.3.1 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count466
Watchers Count19
Fork Count79
Commits Count147
Has Issues Enabled
Issues Count30
Issue Open Count9
Pull Requests Count12
Pull Requests Open Count9
Pull Requests Close Count8
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private