summaryrefslogtreecommitdiffstats
path: root/dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile')
-rw-r--r--dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile b/dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile
new file mode 100644
index 0000000..bd42d46
--- /dev/null
+++ b/dependencies/pkg/mod/github.com/creasty/defaults@v1.6.0/Makefile
@@ -0,0 +1,30 @@
+SHELL := /bin/bash -eu -o pipefail
+
+GO_TEST_FLAGS := -v
+
+PACKAGE_DIRS := $(shell go list ./... 2> /dev/null | grep -v /vendor/)
+SRC_FILES := $(shell find . -name '*.go' -not -path './vendor/*')
+
+
+# Tasks
+#-----------------------------------------------
+.PHONY: lint
+lint:
+ @gofmt -e -d -s $(SRC_FILES) | awk '{ e = 1; print $0 } END { if (e) exit(1) }'
+ @echo $(SRC_FILES) | xargs -n1 golint -set_exit_status
+ @go vet $(PACKAGE_DIRS)
+
+.PHONY: test
+test: lint
+ @go test $(GO_TEST_FLAGS) $(PACKAGE_DIRS)
+
+.PHONY: ci-test
+ci-test: lint
+ @echo > coverage.txt
+ @for d in $(PACKAGE_DIRS); do \
+ go test -coverprofile=profile.out -covermode=atomic -race -v $$d; \
+ if [ -f profile.out ]; then \
+ cat profile.out >> coverage.txt; \
+ rm profile.out; \
+ fi; \
+ done