mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 14:03:45 +03:00
31 lines
560 B
Makefile
31 lines
560 B
Makefile
GOVER=$(shell go version | perl -nle '/(go\d\S+)/; print $$1;')
|
|
LINTBIN=bin/golangci-lint
|
|
|
|
define lint
|
|
@if [ -f "$(1)/go.mod" ]; then \
|
|
output=$$(${LINTBIN} --config=.golangci.yaml run $(1)/... 2>&1); \
|
|
exit_code=$$?; \
|
|
echo "$$output"; \
|
|
if [ $$exit_code -ne 0 ]; then \
|
|
if echo "$$output" | grep -q "no go files to analyze"; then \
|
|
exit 0; \
|
|
else \
|
|
exit $$exit_code; \
|
|
fi \
|
|
fi \
|
|
fi
|
|
endef
|
|
|
|
|
|
cart-lint:
|
|
$(call lint,cart)
|
|
|
|
loms-lint:
|
|
$(call lint,loms)
|
|
|
|
notifier-lint:
|
|
$(call lint,notifier)
|
|
|
|
comments-lint:
|
|
$(call lint,comments)
|