golang hooks for http://pre-commit.com/
Add this to your .pre-commit-config.yaml
- repo: https://github.com/iost-official/pre-commit-golang
sha: HEAD
hooks:
- id: go-fmt
- id: go-metalinter
args:
- --exclude=corefoundation.go
- --deadline=60s
- --vendor
- --cyclo-over=20
- --dupl-threshold=100
go-fmt
- Runsgofmt
, requires golanggo-vet
- Runsgo vet
, requires golanggo-lint
- Runsgolint
, requires https://github.com/golang/lintgo-metalinter
- Runsgometalinter
, requires https://github.com/alecthomas/gometalinter
- Runs on all files by default not just changed files (since the metalinter only operates on folders)
- Use args to override default options