golang hooks for http://pre-commit.com/
Add this to your .pre-commit-config.yaml
- repo: git://github.com/jcchavezs/pre-commit-golang
sha: HEAD
hooks:
- id: go-fmt
- id: go-vet
- id: govendor-status
- id: golangci-lint
args:
- --config .golangci.yml
go-fmt
: Runsgofmt
, requires golang.go-vet
: Runsgo vet
, requires golang.go-lint
: Runsgolint
, requires https://github.com/golang/lintvalidate-toml
: Runstomlv
, requires https://github.com/BurntSushi/toml/tree/master/cmd/tomlv.no-go-testing
: Checks that no files are usingtesting.T
, if you want developers to use a different testing framework.gometalinter
: Runsgometalinter [--arg1=value1 ...] ./...
. Use the arguments for setting a configuration file. It is highly recommended to include--vendor
for excludevendor
folder and--errors
flags to avoid warningsgovendor-status
: Runsgovendor status
to verify the status of the vendoring, requires golang.golangci-lint
: Runsgolangci-lint run
, requires golang. 5x faster than gometalinter.