Skip to content

Latest commit

 

History

History
112 lines (75 loc) · 3.7 KB

CONTRIBUTING.md

File metadata and controls

112 lines (75 loc) · 3.7 KB

Contributing

TL;DR

  • Fork the project from https://github.com/pivotal/LicenseFinder
  • Create a feature branch.
  • Make your feature addition or bug fix. Please make sure there is appropriate test coverage.
  • Rebase on top of master.
  • Send a pull request.

Running Tests

You can use the LicenseFinder docker image to run the tests.

$ docker run -it licensefinder/license_finder /bin/bash --login

# inside the container...

$ cd /LicenseFinder
$ rake

Adding Package Managers

There are a few steps to adding a new package manager. Here is how support was added for rebar, an erlang package manager.

Adding Licenses

Add new licenses to lib/license_finder/license/definitions.rb. There are existing tools for matching licenses; see, for example, the MIT license, which can be detected in many different ways.

Adding Reports

If you need license_finder to output additional package data, consider submitting a pull request which adds new columns to lib/license_finder/reports/csv_report.rb.

It is also possible to generate a custom report from an ERB template. Use this example as a starting point. These reports will have access to the helpers in LicenseFinder::ErbReport.

If you need a report with more detailed data or in a different format, we recommend writing a custom ruby script. This example will get you started.

If you come up with something useful, consider posting it to the Google Group [email protected].

Development Dependencies

To successfully run the test suite, you will need the following installed:

  • NPM (requires Node)
  • Bower (requires Node and NPM)
  • Maven (requires Java)
  • Gradle (requires Java)
  • Pip (requires python)
  • Rebar (requires erlang)
  • GoDep, GoWorkspace, and GoVendor (requires golang)
  • CocoaPods (requires ruby)
  • Bundler (requires ruby)

The LicenseFinder docker image already contains these dependencies.

If you run rake check_dependencies, you'll see exactly which package managers you're missing.

Python

For the python dependency tests you will want to have virtualenv installed, to allow pip to work without sudo. For more details, see this post on virtualenv.

You'll need a pip version >= 6.0.

JRuby

If you're running the test suite with jruby, you're probably going to want to set up some environment variables:

JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'

Gradle

You'll need a gradle version >= 1.8.

CocoaPods

LicenseFinder supports CocoaPods 0.39 and below. If you are using a later version of CocoaPods, you will need to downgrade CocoaPods/Specs repository in order to use LicenseFinder. This article describes the breaking change between CocoaPods 0.39 and 1.0. You will need to use an older, archived CocoaPods/Specs repo.

If you see the following error, try switching to the archived repo.

[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.34.0)

Example of how to switch to the archived repo:

mv ~/.cocoapods/repos/master ~/.cocoapods/repos/master.bak
git clone https://github.com/CocoaPods/Old-Specs.git ~/.cocoapods/repos/master