summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-17 17:18:51 +0700
committerShulhan <ms@kilabit.info>2023-09-17 17:18:51 +0700
commit332ca03f703b2b380aa1075e60e3cd1cad938a73 (patch)
treea0f241469aaf8568023ead7d3cf1e6133f5fd0ff
parent839e8bdb6b507dfa97def2c4f58a743858024abe (diff)
downloadawwan-332ca03f703b2b380aa1075e60e3cd1cad938a73.tar.xz
Makefile: replace linter golangci-lint
The golangci-lint become unusable. It does not provide any useful hints on how to write better Go code. This changes replace golangci-lint with go vet, fieldalignment and shadow from x/tools, and revive. The fieldalignment tool provide hints on better struct size. The shadow tool provide hints on overwriting or shadowed variables. The revive tool provide hints on many code analysis that does not covered by go vet, fieldalignment, and shadow.
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1d8720b..385779d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,24 +3,31 @@
AWWAN_WORKSPACE:=_example
-.PHONY: all build install test dev
-
+.PHONY: all
all: test lint build
+.PHONY: test
test:
CGO_ENABLED=1 go test -race -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
+.PHONY: lint
lint:
- -golangci-lint run ./...
+ -go vet ./...
+ -fieldalignment ./...
+ -shadow ./...
+ -revive ./...
+.PHONY: build
build:
mkdir -p _bin
go run ./internal/cmd/awwan-internal build
go build -o _bin/ ./cmd/awwan
+.PHONY: install
install: build
go install ./cmd/awwan
+.PHONY: dev
dev:
AWWAN_DEVELOPMENT=1 go run ./cmd/awwan serve $(AWWAN_WORKSPACE)