-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
49 lines (37 loc) · 1.13 KB
/
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
#! /usr/bin/make -f
# Project variables.
PROJECT_NAME = ignite-files
## govet: Run go vet.
govet:
@echo Running go vet...
@go vet ./...
## govulncheck: Run govulncheck
govulncheck:
@echo Running govulncheck...
@go run golang.org/x/vuln/cmd/govulncheck ./...
## format: Install and run goimports and gofumpt
format:
@echo Formatting...
@go run mvdan.cc/gofumpt -w .
@go run golang.org/x/tools/cmd/goimports -w -local github.com/ignite/ignite-files .
@go run github.com/tbruyelle/mdgofmt/cmd/mdgofmt -w .
## lint: Run Golang CI Lint.
lint:
@echo Running gocilint...
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --out-format=tab --issues-exit-code=0
.PHONY: govet format lint
## test-unit: Run the unit tests.
test-unit:
@echo Running unit tests...
@go test -race -failfast -v ./...
## test: Run unit and integration tests.
test: govet govulncheck test-unit
.PHONY: test-unit test-integration test
help: Makefile
@echo
@echo " Choose a command run in "$(PROJECT_NAME)", or just run 'make' for install"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
.PHONY: help
.DEFAULT_GOAL := test