soundcloud/harpoon — pull request #16 by bernerdschaefer (2014-07-30 09:13:07+00:00)
Title: Provide pre-commit and prepare-commit-msg hooks

`./misc/install-hooks.sh` sets up the following git hooks:

- `pre-commit`: this hooks checks that any files being committed pass gofmt. It also verifies that the codebase passes `go vet`. Note that the vet check is not scoped to the changed files (this is actually tricky to do), so you may want to `git commit --no-verify` if vet returns errors for changes that are not yours.
- `prepare-commit-msg`: this hooks adds any warnings from `golint` as comments in the commit message editor.

---

Examples:

```
$ git commit -av
Go files must be vetted. Check these problems:
harpoon-container/main.go:103: unreachable code
exit status 1

$ git commit -av
Go files must be formatted with gofmt. Please run:
gofmt -w /home/bernerd/src/github.com/soundcloud/harpoon/harpoon-container/main.go

$ git commit -av # editor screen below

# Go files should be linted. Consider these warnings:
# harpoon-agent/lib/agent.go:29:6: exported type ContainerConfig should have comment or be unexported

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch git-hooks
```

/cc @peterbourgon @jmyounker