.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / github.com / sergi / go-diff@v1.1.0 / Makefile
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/github.com/sergi/go-diff@v1.1.0/Makefile b/.config/coc/extensions/coc-go-data/tools/pkg/mod/github.com/sergi/go-diff@v1.1.0/Makefile
new file mode 100644 (file)
index 0000000..710bc83
--- /dev/null
@@ -0,0 +1,44 @@
+.PHONY: all clean clean-coverage install install-dependencies install-tools lint test test-verbose test-with-coverage
+
+export ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
+export PKG := github.com/sergi/go-diff
+export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+
+$(eval $(ARGS):;@:) # turn arguments into do-nothing targets
+export ARGS
+
+ifdef ARGS
+       PKG_TEST := $(ARGS)
+else
+       PKG_TEST := $(PKG)/...
+endif
+
+all: install-tools install-dependencies install lint test
+
+clean:
+       go clean -i $(PKG)/...
+       go clean -i -race $(PKG)/...
+clean-coverage:
+       find $(ROOT_DIR) | grep .coverprofile | xargs rm
+install:
+       go install -v $(PKG)/...
+install-dependencies:
+       go get -t -v $(PKG)/...
+       go build -v $(PKG)/...
+install-tools:
+       # Install linting tools
+       go get -u -v golang.org/x/lint/...
+       go get -u -v github.com/kisielk/errcheck/...
+
+       # Install code coverage tools
+       go get -u -v github.com/onsi/ginkgo/ginkgo/...
+       go get -u -v github.com/modocache/gover/...
+       go get -u -v github.com/mattn/goveralls/...
+lint:
+       $(ROOT_DIR)/scripts/lint.sh
+test:
+       go test -race -test.timeout 120s $(PKG_TEST)
+test-verbose:
+       go test -race -test.timeout 120s -v $(PKG_TEST)
+test-with-coverage:
+       ginkgo -r -cover -race -skipPackage="testdata"