cosmos-sdk/contrib/githooks
Alessio Treglia 6469447d52
add pre-commit hook (#6041)
* add pre-commit hook

Co-authored-by: Gianguido Sora <gsora@users.noreply.github.com>

* add go tools installation notes

* Update CONTRIBUTING.md

* run both go mod and golangci-lint

* silence which

* add go.mod go.sum after go mod tidy

* update README

* look up golangci-lint specifically in GOPATH/bin

* don't run golangci-lint

* exclude proto files

Co-authored-by: Gianguido Sora <gsora@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-04-28 14:51:42 +00:00
..
README.md add pre-commit hook (#6041) 2020-04-28 14:51:42 +00:00
pre-commit add pre-commit hook (#6041) 2020-04-28 14:51:42 +00:00

README.md

Git hooks

Installation:

$ git config core.hooksPath contrib/githooks

pre-commit

The hook automatically runs gofmt, goimports, and misspell to correctly format the .go files included in the commit, provided that all the aforementioned commands are installed and available in the user's search $PATH environment variable:

$ go get golang.org/x/tools/cmd/goimports
$ go get github.com/golangci/misspell/cmd/misspell@master

It also runs go mod tidy and golangci-lint if available.