-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (34 loc) · 1 KB
/
Makefile
File metadata and controls
40 lines (34 loc) · 1 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
# Makefile for github.com/twlvprscs/log
# Default target is help
.DEFAULT_GOAL := help
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
.PHONY: help
help: ## Show this help message
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " ${GREEN}%-15s${RESET} %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: fmt
fmt: ## Run gofmt on all Go files
@echo "Formatting Go code..."
@gofmt -s -w .
.PHONY: test
test: ## Run unit tests
@echo "Running tests..."
@go test -v ./...
.PHONY: lint
lint: ## Run golang-ci linter
@echo "Running linter..."
@if command -v golangci-lint > /dev/null; then \
golangci-lint run; \
else \
echo "golangci-lint not found. Please install it first."; \
echo "See https://golangci-lint.run/usage/install/ for installation instructions."; \
exit 1; \
fi