2023-02-20 04:45:09 +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
|
2024-01-20 07:11:51 +00:00
|
|
|
GOLANGCI_LINT_VERSION := 1.55.2
|
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
|