Pre-commit and Makefile improvements #68

Merged
fyrchik merged 6 commits from fyrchik/frostfs-api-go:gitlint into master 2024-09-04 19:51:16 +00:00
Showing only changes of commit a7bcad6aa9 - Show all commits

View file

@ -9,15 +9,12 @@ VERSION ?= $(shell git describe --tags --match "v*" --abbrev=8 --dirty --always)
dep:
@printf "⇒ Tidy requirements : "
CGO_ENABLED=0 \
GO111MODULE=on \
go mod tidy -v && echo OK
@printf "⇒ Download requirements: "
CGO_ENABLED=0 \
GO111MODULE=on \
go mod download && echo OK
@printf "⇒ Install test requirements: "
CGO_ENABLED=0 \
GO111MODULE=on \
go test ./... && echo OK
# Run all code formatters
@ -27,14 +24,14 @@ fmts: fmt imports
fmt:
@echo "⇒ Processing gofmt check"
@for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \
GO111MODULE=on gofmt -s -w $$f; \
gofmt -s -w $$f; \
done
# Reformat imports
imports:
@echo "⇒ Processing goimports check"
@for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \
GO111MODULE=on goimports -w $$f; \
goimports -w $$f; \
done
# Regenerate code for proto files
@ -56,7 +53,7 @@ protoc:
# Run Unit Test with go test
test:
@echo "⇒ Running go test"
@GO111MODULE=on go test ./... -count=1
@go test ./... -count=1
# Run linters
lint: