2024-11-29 13:52:53 -07:00
|
|
|
MAIN_PACKAGE_PATH := ./cmd/asdf
|
2024-03-19 17:55:57 -07:00
|
|
|
TARGET_DIR := .
|
|
|
|
TARGET := asdf
|
2024-11-23 12:25:28 -07:00
|
|
|
FULL_VERSION = $(shell ./scripts/asdf-version )
|
|
|
|
LINKER_FLAGS = '-s -X main.version=${FULL_VERSION}'
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
# Not sure what the default location should be for builds
|
2024-11-23 12:25:28 -07:00
|
|
|
build: # test lint
|
|
|
|
go build -ldflags=${LINKER_FLAGS} -o=${TARGET_DIR}/${TARGET} ${MAIN_PACKAGE_PATH}
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
go fmt ./...
|
2024-04-30 07:13:05 -07:00
|
|
|
gofumpt -l -w .
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
verify:
|
|
|
|
go mod verify
|
|
|
|
|
|
|
|
tidy:
|
|
|
|
go mod tidy -v
|
|
|
|
|
|
|
|
audit: verify vet test
|
|
|
|
|
|
|
|
test:
|
2024-05-03 18:42:04 -07:00
|
|
|
go test -coverprofile=/tmp/coverage.out -bench= -race ./...
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
cover: test
|
|
|
|
go tool cover -html=/tmp/coverage.out
|
|
|
|
|
|
|
|
lint: fmt
|
|
|
|
staticcheck -tests -show-ignored ./...
|
2024-04-30 07:13:05 -07:00
|
|
|
revive -set_exit_status ./...
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
vet: fmt
|
2024-11-29 13:52:53 -07:00
|
|
|
go vet ./...
|
2024-03-19 17:55:57 -07:00
|
|
|
|
|
|
|
run: build
|
|
|
|
${TARGET_DIR}/${TARGET}
|
|
|
|
|
|
|
|
.PHONY: fmt lint vet build test run
|