README.md in license_finder-7.0.1 vs README.md in license_finder-7.1.0
- old
+ new
@@ -55,24 +55,35 @@
* Python (via `Conda`, `pipenv`)
* Flutter (via `flutter pub`)
## Installation
-License Finder requires Ruby 2.4.0 or greater to run. If you have an older
-version of Ruby installed, you can update via Homebrew:
+License Finder may be run as a [pre-commit](https://pre-commit.com) hook by
+adding the following to your `.pre-commit-config.yaml`:
+```yaml
+repos:
+ - repo: https://github.com/pivotal/LicenseFinder
+ rev: v7.1.0 # You probably want the latest tag.
+ hooks:
+ - id: license-finder
+```
+
+Running License Finder directly requires Ruby 2.4.0 or greater. If you have an
+older version of Ruby installed, you can update via Homebrew:
+
```sh
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
then:
```sh
$ brew install ruby
```
-The easiest way to use `license_finder` is to install it as a command
+The easiest way to use `license_finder` directly is to install it as a command
line tool, like brew, awk, gem or bundler:
```sh
$ gem install license_finder
```
@@ -152,11 +163,12 @@
$ dlf "bundle install && license_finder"
```
You can better understand the way this script works by looking at its source, but for
reference it will mount your current directory at the path `/scan` and run any commands
-passed to it from that directory.
+passed to it from that directory. If your command has `&&`, ensure you quote the command.
+If it does not, ensure the command is not quoted.
Note that the docker image will run the gem which is installed within it.
So the docker image tagged `7.0.0` will run *License Finder Version 7.0.0*
See the [contributing guide](https://github.com/pivotal/LicenseFinder/blob/master/CONTRIBUTING.md) for information on development.
@@ -193,11 +205,11 @@
* `yarn.lock` file (for `yarn`)
* `conanfile.txt` file (for `conan`)
* `build.sbt` file (for `sbt`)
* `Cargo.lock` file (for `cargo`)
* `composer.lock` file (for `composer`)
-* `environment,yml` file (for `conda`)
+* `environment.yml` file (for `conda`)
* `pubspec.yaml & .pub cache locaton through ENV variable` (for `flutter`)
### Continuous Integration
`license_finder` will return a non-zero exit status if there are unapproved
@@ -331,15 +343,43 @@
When `license_finder` reports that a dependency's license is 'unknown',
you should manually research what the actual license is. When you
have established the real license, you can record it with:
```sh
-$ license_finder licenses add my_unknown_dependency MIT --homepage="www.unknown-code.org"
+$ license_finder licenses add my_unknown_dependency MIT
```
-This command would assign the MIT license to the dependency
-`my_unknown_dependency`. It will also set its homepage to `www.unknown-code.org`.
+This command would assign the MIT license to all versions of the dependency
+`my_unknown_dependency`. If you prefer, you could instead assign the license
+to only a specific version of the dependency:
+```sh
+$ license_finder licenses add my_unknown_dependency MIT --version=1.0.0
+```
+
+Please note that adding a license to a specific version of a dependency will
+cause any licenses previously added to all versions of that dependency to be
+forgotten. Similarly, adding a license to all versions of a dependency will
+override any licenses previously added to specific versions of that dependency.
+
+There are several ways in which you can remove licenses that were previously
+added through the `licenses add` command:
+
+```sh
+# Removes all licenses from any version of the dependency
+$ license_finder licenses remove my_unknown_dependency
+
+# Removes just the MIT license from any version of the dependency
+$ license_finder licenses remove my_unknown_dependency MIT
+
+# Removes all licenses from only version 1.0.0 of the dependency
+# This has no effect if you had last added a license to all versions of the dependency
+$ license_finder licenses remove my_unknown_dependency --version=1.0.0
+
+# Removes just the MIT license from only version 1.0.0 of the dependency
+# This has no effect if you had last added a license to all versions of the dependency
+$ license_finder licenses remove my_unknown_dependency MIT --version=1.0.0
+```
### Adding Hidden Dependencies
`license_finder` can track dependencies that your package managers
don't know about (JS libraries that don't appear in your