Giter VIP home page Giter VIP logo

licensei's Introduction

Licensei

Build Status Go Report Card GolangCI GoDoc

Library and various tools for working with project licenses.

Installation

Install the latest pre-built binary from the Releases page.

Alternatively, place the following code in your Makefile:

LICENSEI_VERSION = 0.8.0
bin/licensei: bin/licensei-${LICENSEI_VERSION}
	@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
bin/licensei-${LICENSEI_VERSION}:
	@mkdir -p bin
	curl -sfL https://git.io/licensei | bash -s v${LICENSEI_VERSION}
	@mv bin/licensei $@

Usage

Usage:
  licensei [command]

Available Commands:
  cache       Cache licenses of dependencies in the project
  check       Check licenses of dependencies in the project
  header      Check license header of files
  help        Help about any command
  list        List licenses of dependencies in the project

Flags:
      --config string   config file (default is $PWD/.licensei.yaml)
  -h, --help            help for licensei

Use "licensei [command] --help" for more information about a command.

See an example integration into CircleCI here.

Configuration example

Place the following content into .licensei.toml.

approved = [
  "mit",
  "apache-2.0",
  "bsd-3-clause",
  "bsd-2-clause",
  "mpl-2.0",
]

ignored = [
  "github.com/aliyun/aliyun-oss-go-sdk",
  "github.com/ghodss/yaml",
  "github.com/gogo/protobuf",
  "github.com/golang/protobuf",
  "github.com/stretchr/testify",

  "github.com/davecgh/go-spew", # ISC license
  "github.com/howeyc/gopass", # ISC license
  "github.com/oracle/oci-go-sdk", # UPL-1.0
]

[header]
ignorePaths = ["vendor", "client", ".gen"]
ignoreFiles = ["mock_*.go", "*_gen.go"]
template = """// Copyright © :YEAR: OWNER
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License."""

GitHub Authentication

Licensei uses Github to lookup licenses for most of the packages. The used parts of GitHub API does not require authentication, but it's easy to get rate limited, so it is recommended to configure a personal access token in your environment:

export GITHUB_TOKEN=xyz

Development

The project uses Go Modules, so the minimum Go version is 1.11.4.

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

licensei's People

Contributors

sagikazarmark avatar dependabot[bot] avatar panyuenlau avatar nishantapatil3 avatar kunalsin9h avatar pepov avatar rumenvasilev avatar tarokkk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.