[#159] Tidy Makefile

- Remove help target. Help target will always ignore variable targets,
  it is confusing.
- Remove imports target. Go fmt is enough.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-06-07 20:10:23 +03:00 committed by Alex Vanin
parent 5baa2774d5
commit 40e86fbfd6
2 changed files with 4 additions and 21 deletions

View file

@ -3,6 +3,7 @@
REPO ?= $(shell go list -m)
VERSION ?= $(shell git describe --tags --dirty --always)
GO_VERSION ?= 1.17
LINT_VERSION ?= 1.46.2
BUILD ?= $(shell date -u --iso=seconds)
HUB_IMAGE ?= nspccdev/neofs-http-gw
@ -13,7 +14,7 @@ BINDIR = bin
DIRS = $(BINDIR)
BINS = $(BINDIR)/neofs-http-gw
.PHONY: help all $(BINS) $(DIRS) docker/$(BINS) dep test cover fmts fmt imports image image-push dirty-image lint docker/lint version clean
.PHONY: all $(BINS) $(DIRS) docker/$(BINS) dep test cover fmt image image-push dirty-image lint docker/lint version clean
# Make all binaries
all: $(BINS)
@ -59,19 +60,11 @@ cover:
@go test -v -race ./... -coverprofile=coverage.txt -covermode=atomic
@go tool cover -html=coverage.txt -o coverage.html
# Run all code formatters
fmts: fmt imports
# Reformat code
fmt:
@echo "⇒ Processing gofmt check"
@GO111MODULE=on gofmt -s -w ./
# Reformat imports
imports:
@echo "⇒ Processing goimports check"
@GO111MODULE=on goimports -w ./
# Build clean Docker image
image:
@echo "⇒ Build NeoFS HTTP Gateway docker image "
@ -107,22 +100,12 @@ docker/lint:
-v `pwd`:/src \
-u `stat -c "%u:%g" .` \
--env HOME=/src \
golangci/golangci-lint:v1.46.2 bash -c 'cd /src/ && make lint'
golangci/golangci-lint:v$(LINT_VERSION) bash -c 'cd /src/ && make lint'
# Print version
version:
@echo $(VERSION)
# Show this help prompt
help:
@echo ' Usage:'
@echo ''
@echo ' make <target>'
@echo ''
@echo ' Targets:'
@echo ''
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u
# Clean up
clean:
rm -rf vendor

View file

@ -30,7 +30,7 @@ Other notable make targets:
dep Check and ensure dependencies
image Build clean docker image
dirty-image Build dirty docker image with host-built binaries
fmts Run all code formatters
fmt Format the code
lint Run linters
version Show current version
```