-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from libsv/update/tidy_code_new_make
Tidy code, new makefile
- Loading branch information
Showing
23 changed files
with
73 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
# Common makefile commands & variables between projects | ||
include .make/common.mk | ||
SHELL=/bin/bash | ||
|
||
# Common Golang makefile commands & variables between projects | ||
include .make/go.mk | ||
help: | ||
@egrep -h '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#' | ||
|
||
## Not defined? Use default repo name which is the application | ||
ifeq ($(REPO_NAME),) | ||
REPO_NAME="go-bc" | ||
endif | ||
run-all-tests: run-linter run-unit-tests | ||
|
||
## Not defined? Use default repo owner | ||
ifeq ($(REPO_OWNER),) | ||
REPO_OWNER="libsv" | ||
endif | ||
pre-commit: vendor-deps run-all-tests | ||
|
||
.PHONY: clean | ||
run-unit-tests: | ||
@go clean -testcache && go test -v ./... -race | ||
|
||
all: ## Runs multiple commands | ||
@$(MAKE) test | ||
run-unit-tests-cover: | ||
@go test ./... -race -v -coverprofile cover.out && \ | ||
go tool cover -html=cover.out -o cover.html && \ | ||
open file:///$(shell pwd)/cover.html | ||
|
||
clean: ## Remove previous builds and any test cache data | ||
@go clean -cache -testcache -i -r | ||
@test $(DISTRIBUTIONS_DIR) | ||
@if [ -d $(DISTRIBUTIONS_DIR) ]; then rm -r $(DISTRIBUTIONS_DIR); fi | ||
run-linter: | ||
@golangci-lint run --deadline=480s --skip-dirs=vendor --tests | ||
|
||
release:: ## Runs common.release then runs godocs | ||
@$(MAKE) godocs | ||
install-linter: | ||
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.35.2 | ||
|
||
go-doc-mac: | ||
@open http://localhost:6060 && \ | ||
godoc -http=:6060 | ||
|
||
go-doc-linux: | ||
@xdg-open http://localhost:6060 && \ | ||
godoc -http=:6060 | ||
|
||
vendor-deps: | ||
@go mod tidy && go mod vendor | ||
|
||
tag: ## Generate a new tag and push (tag version=0.0.0) | ||
@run-all-tests | ||
@git tag -a v$(version) -m "Pending full release..." | ||
@git push origin v$(version) | ||
@git fetch --tags -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.