Skip to content

Commit

Permalink
[Added] pre-commit hook
Browse files Browse the repository at this point in the history
Allow LicenseFinder to be run conveniently as a Git hook via the
pre-commit framework by teams that don't use Ruby.
  • Loading branch information
Kurt-von-Laven committed Oct 18, 2022
1 parent 0d6a603 commit 2fd5ac8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- id: license-finder
name: Audit licenses of dependencies
entry: license_finder
language: ruby
pass_filenames: false
description: >
LicenseFinder works with your package managers to find dependencies, detect
the licenses of the packages in them, compare those licenses against a
user-defined list of permitted licenses, and give you an actionable
exception report.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,19 @@ and give you an actionable exception report.

## 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://github.com/raw/Homebrew/install/master/install)"
Expand All @@ -70,7 +81,7 @@ then:
$ 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
Expand Down

0 comments on commit 2fd5ac8

Please sign in to comment.