github.com/SpiderOak/wwhrd@v0.2.2-0.20181011170608-77c9537cbd49/README.md (about) 1 # WWHRD? (What Would Henry Rollins Do?) [![Build Status](https://travis-ci.org/frapposelli/wwhrd.svg)](https://travis-ci.org/frapposelli/wwhrd) [![codecov](https://codecov.io/gh/frapposelli/wwhrd/branch/master/graph/badge.svg)](https://codecov.io/gh/frapposelli/wwhrd) 2 3 ![WWHRD?](http://frapposelli.github.io/wwhrd/img/wwhrd.png) 4 5 Have Henry Rollins check vendored licenses in your Go project. 6 7 Please note that `wwhrd` **only checks** packages stored under `vendor/`. 8 9 ## Installation 10 11 ```console 12 $ go get -u github.com/frapposelli/wwhrd 13 ``` 14 15 Using [Brew](https://brew.sh) on macOS: 16 17 ```console 18 $ brew install frapposelli/tap/wwhrd 19 ``` 20 21 ## Configuration file 22 23 Configuration for `wwhrd` is stored in `.wwhrd.yml` at the root of the repo you want to check. 24 25 The format is borrowed from [Anderson](https://github.com/xoebus/anderson) and it's 1:1 compatible (just run `wwhrd check -f .anderson.yml`). 26 27 ```yaml 28 --- 29 blacklist: 30 - GPL-2.0 31 32 whitelist: 33 - Apache-2.0 34 - MIT 35 36 exceptions: 37 - github.com/jessevdk/go-flags 38 - github.com/pmezard/go-difflib/difflib 39 ``` 40 41 Having a license in the `blacklist` section will fail the check, unless the package is listed under `exceptions`. 42 43 `exceptions` can also be listed as wildcards: 44 45 ```yaml 46 exceptions: 47 - github.com/davecgh/go-spew/spew/... 48 ``` 49 50 Will make a blanket exception for all the packages under `github.com/davecgh/go-spew/spew`. 51 52 Use it in your CI! 53 54 ```console 55 $ wwhrd check 56 INFO[0000] Found Approved license license=MIT package=github.com/stretchr/testify/assert 57 ERRO[0000] Found Non-Approved license license=FreeBSD package=github.com/pmezard/go-difflib/difflib 58 INFO[0000] Found Approved license license=MIT package=github.com/ryanuber/go-license 59 INFO[0000] Found Approved license license=Apache-2.0 package=github.com/cloudfoundry-incubator/candiedyaml 60 WARN[0000] Found exceptioned package license=NewBSD package=github.com/jessevdk/go-flags 61 FATA[0000] Exiting: Non-Approved license found 62 $ echo $? 63 1 64 ``` 65 66 ## Usage 67 68 ```console 69 $ wwhrd 70 Usage: 71 wwhrd [OPTIONS] <check | list> 72 73 What would Henry Rollins do? 74 75 Help Options: 76 -h, --help Show this help message 77 78 Available commands: 79 check Check licenses against config file (aliases: chk) 80 list List licenses (aliases: ls) 81 ``` 82 83 ## Acknowledgments 84 85 WWHRD? graphic by [Mitch Clem](http://mitchclem.tumblr.com/), used with permission, [support him!](https://store.silversprocket.net/collections/mitchclem).