2025-04-07 11:24:19 +02:00
|
|
|
.PHONY: test lint
|
2018-07-08 08:14:15 +10:00
|
|
|
|
2021-10-15 09:35:15 +01:00
|
|
|
GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
|
|
|
|
|
GIT_VERSION ?= $(shell git describe --tags --always --dirty="-dev")
|
|
|
|
|
DATE ?= $(shell date -u '+%Y-%m-%d %H:%M UTC')
|
|
|
|
|
BUILDER ?= Makefile
|
2022-04-04 14:37:43 +01:00
|
|
|
VERSION_FLAGS := -X "github.com/mgechev/revive/cli.version=$(GIT_VERSION)" -X "github.com/mgechev/revive/cli.date=$(DATE)" -X "github.com/mgechev/revive/cli.commit=$(GIT_COMMIT)" -X "github.com/mgechev/revive/cli.builtBy=$(BUILDER)"
|
2021-10-15 09:35:15 +01:00
|
|
|
|
2025-04-07 11:24:19 +02:00
|
|
|
all: test lint build
|
|
|
|
|
|
2018-09-17 12:23:14 -07:00
|
|
|
install:
|
2018-09-17 12:32:54 -07:00
|
|
|
@go mod vendor
|
2018-05-26 16:36:23 -07:00
|
|
|
|
2025-11-07 17:43:44 +02:00
|
|
|
tidy:
|
|
|
|
|
@go mod tidy -diff
|
|
|
|
|
|
|
|
|
|
build: tidy
|
2021-10-15 09:35:15 +01:00
|
|
|
@go build -ldflags='$(VERSION_FLAGS)'
|
2018-05-26 16:36:23 -07:00
|
|
|
|
2025-04-07 11:24:19 +02:00
|
|
|
lint:
|
|
|
|
|
revive --config revive.toml ./...
|
2025-07-12 17:32:39 +03:00
|
|
|
golangci-lint run
|
|
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
|
golangci-lint fmt
|
2025-04-07 11:24:19 +02:00
|
|
|
|
2018-07-08 08:14:15 +10:00
|
|
|
test:
|
2022-04-10 09:06:59 +02:00
|
|
|
@go test -v -race ./...
|