-
Notifications
You must be signed in to change notification settings - Fork 318
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 683 Bytes
/
Makefile
File metadata and controls
28 lines (20 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: test lint
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
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)"
all: test lint build
install:
@go mod vendor
tidy:
@go mod tidy -diff
build: tidy
@go build -ldflags='$(VERSION_FLAGS)'
lint:
revive --config revive.toml ./...
golangci-lint run
fmt:
golangci-lint fmt
test:
@go test -v -race ./...