golang hooks for http://pre-commit.com/
Add this to your .pre-commit-config.yaml
- repo: git://github.com/dnephin/pre-commit-golang
sha: HEAD
hooks:
- id: go-fmt
- id: go-vet
- id: go-lint
- id: validate-toml
- id: no-go-testing
- id: gometalinter
- id: golangci-lint
- id: go-critic
- id: go-unit-tests
- id: go-build
go-fmt
- Runsgofmt
, requires golanggo-vet
- Runsgo vet
, requires golanggo-lint
- Runsgolint
, requires https://github.com/golang/lintvalidate-toml
- Runstomlv
, requires https://github.com/BurntSushi/toml/tree/master/cmd/tomlvno-go-testing
- Checks that no files are usingtesting.T
, if you want developers to use a different testing frameworkgometalinter
- rungometalinter --config gometalinter.json ./...
golangci-lint
- rungolangci-lint run ./...
, requires golangci-lintgo-critic
- rungocritic check-project .
, requires go-criticgo-unit-tests
- rungo test -tags=unit -timeout 30s -short -v
go-build
- rungo build
, requires golang