golang hooks for http://pre-commit.com/
Add this to your .pre-commit-config.yaml
- repo: git://github.com/dnephin/pre-commit-golang
rev: master
hooks:
- id: go-fmt
- id: validate-toml
- id: go-unit-tests
- id: go-build
- id: go-mod-tidy
- id: revive
go-fmt
- Runsgofmt
, requires golangvalidate-toml
- Runstomlv
, requires https://github.com/BurntSushi/toml/tree/master/cmd/tomlvgo-unit-tests
- rungo test -tags=unit -timeout 30s -short -v
go-build
- rungo build
, requires golangrevive
- runrevive -config defaults.toml --formatter friendly ./...
, requires revivebuf
- runbuf lint
, requires buf
This project fork from https://github.com/dnephin/pre-commit-golang