-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 938 Bytes
/
Makefile
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
# Makefile for Go project
# Go parameters
GOCMD = go
.PHONY: deps-upgrade deps
# Main build target
all: deps test
# Clean the build artifacts
clean:
$(GOCMD) clean
# Run tests
test:
$(GOCMD) test -v ./...
# Install project dependencies
deps:
$(GOCMD) mod tidy
$(GOCMD) mod vendor
# Upgrade project dependencies
deps-upgrade:
$(GOCMD) get -u -t ./...
$(GOCMD) mod download
$(GOCMD) mod tidy
$(GOCMD) mod vendor
# Format the code
fmt:
$(GOCMD) fmt ./...
golines . -w --ignored-dirs=vendor
# Lint the code using a linter tool
lint:
golangci-lint run
# Generate code coverage report
coverage:
$(GOCMD) test -coverprofile='coverage.out' ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
# Generate documentation using tools like godoc
doc:
godoc -http=:6060
# Perform a full code quality check (lint, tests, coverage)
check: lint test coverage
.PHONY: all clean test deps run fmt lint coverage doc check