mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
removed golint from static checks and added checks for required tool for the static_check target
This commit is contained in:
committed by
Jean-Philippe Bossuat
parent
7b0c9e3b75
commit
b8f142e4bb
32
Makefile
32
Makefile
@@ -23,13 +23,27 @@ test_examples:
|
||||
@echo ok
|
||||
|
||||
.PHONY: static_check
|
||||
static_check:
|
||||
static_check: check_tools
|
||||
@echo Checking correct formatting of files
|
||||
out=`go fmt ./...`; echo "$$out"; [ -z "$$out" ]
|
||||
|
||||
@FMTOUT=$$(go fmt ./...); \
|
||||
if [ -z $$FMTOUT ]; then\
|
||||
echo "gofmt: OK";\
|
||||
else \
|
||||
echo "gofmt: problems in files:";\
|
||||
echo $$FMTOUT;\
|
||||
false;\
|
||||
fi
|
||||
go vet ./...
|
||||
out=`golint ./...`; echo "$$out"; [ -z "$$out" ]
|
||||
out=`goimports -l .`; echo "$$out"; [ -z "$$out" ]
|
||||
staticcheck -go 1.17 ./...
|
||||
@GOIMPORTSOUT=$$(goimports -l .); \
|
||||
if [ -z "$$GOIMPORTSOUT" ]; then\
|
||||
echo "goimports: OK";\
|
||||
else \
|
||||
echo "goimports: problems in files:";\
|
||||
echo "$$GOIMPORTSOUT";\
|
||||
false;\
|
||||
fi
|
||||
staticcheck -go 1.17 -checks all ./...
|
||||
go mod tidy
|
||||
out=`git status --porcelain`; echo "$$out"; [ -z "$$out" ]
|
||||
|
||||
@@ -39,8 +53,12 @@ test: test_gotest test_examples
|
||||
.PHONY: ci_test
|
||||
ci_test: static_checks test_gotest test_examples
|
||||
|
||||
EXECUTABLES = goimports staticcheck
|
||||
.PHONY: get_tools
|
||||
get_tools:
|
||||
go install golang.org/x/lint/golint@latest
|
||||
go install golang.org/x/tools/cmd/goimports@latest
|
||||
go install honnef.co/go/tools/cmd/staticcheck@2022.1.1
|
||||
go install honnef.co/go/tools/cmd/staticcheck@2022.1.1
|
||||
.PHONY: check_tools
|
||||
check_tools:
|
||||
@$(foreach exec,$(EXECUTABLES),\
|
||||
$(if $(shell which $(exec)),true,$(error "$(exec) not found in PATH, consider running `make get_tools`.")))
|
||||
Reference in New Issue
Block a user