File: Makefile

package info (click to toggle)
golang-github-viccon-sturdyc 1.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 524 kB
  • sloc: makefile: 31
file content (44 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (2)
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
# ==================================================================================== #
# HELPERS
# ==================================================================================== #

## help: print this help message
.PHONY: help
help:
	@echo 'Usage:'
	@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #

## test: run all tests
.PHONY: test
test:
	@echo 'Removing test cache...'
	go clean -testcache
	@echo 'Running tests...'
	go test -race -vet=off -timeout 15s ./...

## bench: run all benchmarks
.PHONY: bench
bench:
	@echo 'Running benchmarks...'
	go test -bench=.

## audit: tidy and vendor dependencies and format, vet and test all code
.PHONY: audit
audit: tidy
	@echo 'Formatting code...'
	go fmt ./...
	@echo 'Linting code...'
	golangci-lint run
	@echo 'Running tests...'
	go test -race -vet=off ./...

## tidy: tidy and verify dependencies
.PHONY: tidy
vendor:
	@echo 'Tidying and verifying module dependencies...'
	go mod tidy
	go mod verify