-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 #1084 from sundowndev/chore/makefile
Add Makefile
- Loading branch information
Showing
9 changed files
with
65 additions
and
12 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 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 |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
.DS_Store | ||
coverage | ||
coverage.* | ||
unit-tests.xml | ||
.idea | ||
api/assets.go | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Use bash syntax | ||
SHELL=/bin/bash | ||
# Go parameters | ||
GOCMD=go | ||
GOBINPATH=$(shell $(GOCMD) env GOPATH)/bin | ||
GOMOD=$(GOCMD) mod | ||
GOBUILD=$(GOCMD) build | ||
GOCLEAN=$(GOCMD) clean | ||
GOTEST=gotestsum | ||
GOGET=$(GOCMD) get | ||
GOINSTALL=$(GOCMD) install | ||
GOTOOL=$(GOCMD) tool | ||
GOFMT=$(GOCMD) fmt | ||
|
||
.PHONY: FORCE | ||
|
||
.PHONY: all | ||
all: fmt lint test build go.mod | ||
|
||
.PHONY: build | ||
build: | ||
go generate ./... | ||
go build -v . | ||
|
||
.PHONY: test | ||
test: | ||
$(GOTEST) --format testname --junitfile unit-tests.xml -- -mod=readonly -race -coverprofile=./c.out -covermode=atomic -coverpkg=.,./... ./... | ||
|
||
.PHONY: coverage | ||
coverage: test | ||
$(GOTOOL) cover -func=cover.out | ||
|
||
.PHONY: mocks | ||
mocks: | ||
rm -rf mocks | ||
mockery --all | ||
|
||
.PHONY: fmt | ||
fmt: | ||
$(GOFMT) ./... | ||
|
||
.PHONY: clean | ||
clean: | ||
$(GOCLEAN) | ||
rm -f bin/* | ||
|
||
.PHONY: lint | ||
lint: | ||
@which golangci-lint > /dev/null 2>&1 || (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOBINPATH) v1.46.2) | ||
golangci-lint run -v --timeout=10m | ||
|
||
.PHONY: install-tools | ||
install-tools: | ||
$(GOINSTALL) gotest.tools/gotestsum@v1.6.3 | ||
$(GOINSTALL) github.com/vektra/mockery/v2@latest | ||
|
||
go.mod: FORCE | ||
$(GOMOD) tidy | ||
$(GOMOD) verify | ||
go.sum: go.mod |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/sundowndev/phoneinfoga/v2 | ||
|
||
go 1.13 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/PuerkitoBio/goquery v1.6.1 | ||
|