-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 741 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 741 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
29
30
31
32
GO_FILES=$(shell find . -type f -iregex '.*\.go')
GO_PKGS=$(shell go list ./... | grep -v -e "/resources")
format: check-gofmt
check-gofmt:
@echo "Checking formatting..."
@FMT="0"; \
for pkg in $(GO_FILES); do \
OUTPUT=`gofmt -l $$pkg`; \
if [ -n "$$OUTPUT" ]; then \
echo "$$OUTPUT"; \
FMT="1"; \
fi; \
done ; \
if [ "$$FMT" -eq "1" ]; then \
echo "Problem with formatting in files above."; \
exit 1; \
else \
echo "Success - way to run gofmt!"; \
fi
GOLANGCI_LINT_VERSION=v2.12.2
bin/golangci-lint:
mkdir -p bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b ./bin $(GOLANGCI_LINT_VERSION)
.PHONY: lint
lint: bin/golangci-lint
bin/golangci-lint run ./...