-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
26 lines (22 loc) · 804 Bytes
/
Makefile
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
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
fmt: ## fmt code
gofmt -s -w .
goimports -w .
@echo gofmt -l
@OUTPUT=`gofmt -l . 2>&1`; \
if [ "$$OUTPUT" ]; then \
echo "gofmt must be run on the following files:"; \
echo "$$OUTPUT"; \
exit 1; \
fi
lint: ## lint code
@echo golangci-lint run --skip-files \".*test.go\" -v ./...
@OUTPUT=`command -v golangci-lint >/dev/null 2>&1 && golangci-lint run --skip-files ".*test.go" -v ./... 2>&1`; \
if [ "$$OUTPUT" ]; then \
echo "go lint errors:"; \
echo "$$OUTPUT"; \
fi
default: fmt lint ## fmt code
snapshot: ## local test goreleaser
goreleaser release --snapshot --rm-dist --skip-publish