Add lefthook for handling git hooks

This commit is contained in:
Deluan 2020-04-03 14:48:14 -04:00
parent 559848299c
commit 63bf49b3c4
2 changed files with 17 additions and 0 deletions

View File

@ -37,6 +37,10 @@ setup: Jamstash-master
@which goreman || (echo "Installing Goreman" && GO111MODULE=off go get -u github.com/mattn/goreman)
@which ginkgo || (echo "Installing Ginkgo" && GO111MODULE=off go get -u github.com/onsi/ginkgo/ginkgo)
@which goose || (echo "Installing Goose" && GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose)
@which lefthook || (echo "Installing Lefthook" && GO111MODULE=off go get -u github.com/Arkweid/lefthook)
@lefthook install
@lefthook add pre-commit
@lefthook add pre-push
go mod download
@(cd ./ui && npm ci)
.PHONY: setup

13
lefthook.yml Normal file
View File

@ -0,0 +1,13 @@
pre-push:
commands:
unit-tests:
tags: tests
run: go test ./...
pre-commit:
parallel: false
commands:
gofmt:
tags: style
glob: "*.go"
run: gofmt -w {staged_files}