forked from strawberry-code/tuilegram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.06 KB
/
Copy pathMakefile
File metadata and controls
51 lines (38 loc) · 1.06 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
BINARY_NAME := tuilegram
MAIN_PKG := ./cmd/tuilegram
GOLANGCI_LINT_VERSION := v1.62.2
.PHONY: build run rerun test lint lint-install vet install clean tidy loc-check
build:
go build -o $(BINARY_NAME) $(MAIN_PKG)
run:
go run $(MAIN_PKG)
rerun:
rm -f session.json
go run $(MAIN_PKG)
test:
go test -v -count=1 ./...
vet:
go vet ./...
lint:
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run ./...; \
else \
echo "golangci-lint non trovato. Installa con: make lint-install"; \
echo "Fallback → go vet ./..."; \
go vet ./...; \
fi
lint-install:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@echo "golangci-lint installato in $$(go env GOPATH)/bin"
@echo "Aggiungi $$(go env GOPATH)/bin al PATH se non già presente."
install:
go install $(MAIN_PKG)
tidy:
go mod tidy
clean:
rm -f $(BINARY_NAME)
loc-check:
@find internal cmd -name '*.go' -type f -exec wc -l {} + \
| awk '$$1>120 && $$2!="total"' \
| sort -nr \
| (grep . && exit 1) || echo "loc-check: all Go files within 120 LOC."