-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 922 Bytes
/
Copy pathMakefile
File metadata and controls
42 lines (31 loc) · 922 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
33
34
35
36
37
38
39
40
41
42
.PHONY: lint test build clean fmt vet help
# Default target
.DEFAULT_GOAL := help
# Variables
GOLANGCI_LINT_TIMEOUT := 5m
TEST_FLAGS := -v -cover
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
lint: ## Run golangci-lint
@echo "Running golangci-lint..."
golangci-lint run --timeout=$(GOLANGCI_LINT_TIMEOUT)
test: ## Run tests with coverage
@echo "Running tests..."
go test $(TEST_FLAGS) ./...
build: ## Build the project
@echo "Building..."
go build ./...
fmt: ## Format code
@echo "Formatting code..."
go fmt ./...
vet: ## Run go vet
@echo "Running go vet..."
go vet ./...
clean: ## Clean build artifacts
@echo "Cleaning..."
go clean ./...
ci: lint test ## Run CI checks (lint + test)
all: fmt vet lint test build ## Run all checks and build