Byte-snake-engine/Makefile

32 lines
739 B
Makefile
Raw Normal View History

2023-02-20 04:23:42 +00:00
GOPATH ?= $(shell $$(go env GOPATH))
2023-02-20 00:25:17 +00:00
2023-02-20 04:23:42 +00:00
GOLANGCI_LINT_PATH := ${GOPATH}/bin/golangci-lint
2023-02-20 04:04:04 +00:00
GOLANGCI_LINT_VERSION := 1.51.1
2023-02-20 04:16:05 +00:00
nonsense:
echo "Installing golangci-lint to ${GOPATH} ${GOLANGCI_LINT_PATH} ${GOLANGCI_LINT_VERSION}"
.PHONY: nonsense
2023-02-20 04:04:04 +00:00
${GOLANGCI_LINT_PATH}:
2023-02-20 00:25:17 +00:00
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v${GOLANGCI_LINT_VERSION}
2023-02-20 04:04:04 +00:00
install-cli:
2023-02-20 00:25:17 +00:00
go install ./cli/battlesnake
2023-02-20 04:04:04 +00:00
.PHONY: install-cli
2023-02-20 00:25:17 +00:00
test-format:
2023-02-20 04:04:04 +00:00
test -z $$(gofmt -l .) || (gofmt -l . && exit 1)
2023-02-20 00:25:17 +00:00
.PHONY: test-format
2023-02-20 04:04:04 +00:00
test-lint: ${GOLANGCI_LINT_PATH}
golangci-lint run -v ./...
2023-02-20 00:25:17 +00:00
.PHONY: test-lint
test-unit:
go test -race ./...
.PHONY: test-unit
2023-02-20 04:04:04 +00:00
test: test-format test-lint test-unit
.PHONY: test