-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 2.09 KB
/
Makefile
File metadata and controls
58 lines (44 loc) · 2.09 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
52
53
54
55
56
57
.DEFAULT_GOAL:=help
SHELL:=/bin/sh
GOPATH := $(shell go env GOPATH)
help:
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
########################################################################################################################
##@ Common
########################################################################################################################
.PHONY: build
build: ## Builds the application for production
go build -ldflags="-w -s" -v -o ./bin/go-review-mcp .
.PHONY: build-local
build-local: ## Builds the application for local development with debug symbols
go build -v -o ./bin/go-review-mcp .
.PHONY: clean
clean: ## Runs mod tidy
go mod tidy
.PHONY: update
update: ## Update go modules
go get -t -u ./...
########################################################################################################################
##@ Run
########################################################################################################################
.PHONY: run
run: ## Execute the application locally in stdio mode
go run .
.PHONY: run-http
run-http: ## Execute the application locally in HTTP mode
TRANSPORT=http PORT=3000 go run . -transport=http -port=3000
.PHONY: test
test: # Runs all the tests in the application and returns if they passed or failed, along with a coverage percentage
go install github.com/mfridman/tparse@main | go mod tidy
PROFILE=local go test -parallel 10 -json -cover ./... | tparse -all -pass -trimpath=github.com/BrunoKrugel/go-review-mcp/
########################################################################################################################
##@ Code Style
########################################################################################################################
.PHONY: format
format: ## Format code and organize imports
goimports -w .
go fmt ./...
fieldalignment -fix ./...
.PHONY: lint
lint: ## Runs golangci-lint
golangci-lint run --fix