A Ruby gem to cache and verify the licenses of dependencies
Перейти к файлу
Jon Ruskin dcfaa4d9a6
Merge pull request #485 from github/npm-workspaces
Initial support for npm workspaces
2022-03-16 13:44:28 -07:00
.github Bump nanasess/setup-php from 3.1.0 to 3.1.1 2022-03-15 09:26:55 +00:00
.licenses/bundler Auto-update license files 2022-03-15 21:20:29 +00:00
docker chore(ci) : update dependencies and define caches 2021-08-20 22:11:29 +02:00
docs Merge pull request #485 from github/npm-workspaces 2022-03-16 13:44:28 -07:00
exe v1.0.0 2018-02-20 08:20:41 -07:00
lib Merge pull request #485 from github/npm-workspaces 2022-03-16 13:44:28 -07:00
script add yarn enumerator for berry version 2021-11-26 19:55:45 -07:00
test Merge pull request #485 from github/npm-workspaces 2022-03-16 13:44:28 -07:00
.gitignore add yarn enumerator for berry version 2021-11-26 19:55:45 -07:00
.licensed.test.yml move test licensed yaml to .licensed.test.yml 2021-11-23 14:03:25 -07:00
.licensed.yml fix license errors 2021-11-24 11:30:44 -07:00
.rubocop.yml exclude test fixtures and local gems 2018-04-05 10:17:31 -07:00
.ruby-version Update .ruby-version 2021-09-03 21:01:16 -07:00
CHANGELOG.md release 3.5.0 2022-02-24 13:52:33 -07:00
CODE_OF_CONDUCT.md v1.0.0 2018-02-20 08:20:41 -07:00
CONTRIBUTING.md update release workflow 2020-10-04 11:31:18 -07:00
Gemfile v1.0.0 2018-02-20 08:20:41 -07:00
LICENSE Update Datum in LICENSE 2019-10-03 17:03:15 +02:00
README.md fix broken link in readme 2021-08-22 13:15:31 -07:00
Rakefile don't run any source tests in test:core 2022-01-15 22:56:11 -07:00
licensed.gemspec enforce using licensee >= 9.15.2 2022-02-24 10:34:09 -07:00

README.md

Licensed

Licensed caches the licenses of dependencies and checks their status.

Licensed is available as a Ruby gem for Ruby environments, and as a self-contained executable for non-Ruby environments.

Licensed is not a complete open source license compliance solution. Please understand the important disclaimer below to make appropriate use of Licensed.

Current Status

Build status

Licensed is in active development and currently used at GitHub. See the open issues for a list of potential work.

Licensed v3

Licensed v3 includes a breaking change if both of the following are true:

  1. a project uses bundler to manage ruby dependencies
  2. a project uses the self-contained executable build of licensed

All other usages of licensed should not encounter any major changes migrating from the latest 2.x build to 3.0.

See CHANGELOG.md for more details on what's changed. See the v3 migration documentation for more info on migrating to v3.

Licensed v2

Licensed v2 includes many internal changes intended to make licensed more extensible and easier to update in the future. While not too much has changed externally, v2 is incompatible with configuration files and cached records from previous versions. Fortunately, migrating is easy using the licensed migrate command.

See CHANGELOG.md for more details on what's changed. See the v2 migration documentation for more info on migrating to v2, or run licensed help migrate.

Installation

Dependencies

Licensed uses the libgit2 bindings for Ruby provided by rugged. rugged requires cmake and pkg-config which you may need to install before you can install Licensed.

# Ubuntu
sudo apt-get install cmake pkg-config

# macOS
brew install cmake pkg-config

With a Gemfile

Add this line to your application's Gemfile:

gem 'licensed', :group => 'development'

And then execute:

$> bundle

As an executable

Download a package from GitHub and extract the executable. Executable packages are available for each release starting with version 1.2.0.

$> curl -sSL https://github.com/github/licensed/releases/download/<version>/licensed-<version>-<os>-x64.tar.gz > licensed.tar.gz
$> tar -xzf licensed.tar.gz
$> rm -f licensed.tar.gz
$> ./licensed list

For system wide usage, install licensed to a location on $PATH, e.g. /usr/local/bin.

Usage

Available commands

See the commands documentation for documentation on available commands, or run licensed -h to see all of the current available commands.

Configuration options

A configuration file is required for most commands. See the configuration file documentation for more details on the configuration format and available configuration options.

Available dependency sources

Licensed can enumerate dependency for many languages, package managers, and frameworks. See the sources documentation for the list of currently available sources. Sources can be explicitly enabled and disabled as a configuration option.

Automation

Bundler

The bundler-licensed plugin runs licensed cache automatically when using bundler. See the linked repo for usage and details.

GitHub Actions

The licensed-ci GitHub Action runs licensed as part of an opinionated CI workflow and can be configured to run on any GitHub Action event. See the linked actions for usage and details.

The setup-licensed GitHub Action installs licensed to the workflow environment. See the linked actions for usage and details.

Development

To get started after checking out the repo, run

  1. script/bootstrap to install dependencies
  2. script/setup to setup test fixtures.
  • script/setup -f will force a clean test fixture environment
  1. script/cibuild to run the tests

You can also run script/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Adding a new source

See the documentation on adding new sources for detailed information on what's required to add a new dependency source enumerator.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/github/licensed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct. See CONTRIBUTING for more details.

Disclaimer

Licensed is not a complete open source license compliance solution. Like any bug, licensing issues are far cheaper to fix if found early. Licensed is intended to provide automation around documenting the licenses of dependencies and whether they are configured to be allowed by a user of licensed, in other words, to surface the most obvious licensing issues early.

Licensed is not a substitute for human review of each dependency for licensing or any other issues. It is not the goal of Licensed or GitHub, Inc. to provide legal advice about licensing or any other issues. If you have any questions regarding licensing compliance for your code or any other legal issues relating to it, its up to you to do further research or consult with a professional.

License

The gem is available as open source under the terms of the MIT License.