mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Add lefthook for handling git hooks
This commit is contained in:
parent
559848299c
commit
63bf49b3c4
2 changed files with 17 additions and 0 deletions
4
Makefile
4
Makefile
|
@ -37,6 +37,10 @@ setup: Jamstash-master
|
||||||
@which goreman || (echo "Installing Goreman" && GO111MODULE=off go get -u github.com/mattn/goreman)
|
@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 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 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
|
go mod download
|
||||||
@(cd ./ui && npm ci)
|
@(cd ./ui && npm ci)
|
||||||
.PHONY: setup
|
.PHONY: setup
|
||||||
|
|
13
lefthook.yml
Normal file
13
lefthook.yml
Normal 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}
|
Loading…
Add table
Add a link
Reference in a new issue