File tree Expand file tree Collapse file tree 3 files changed +64
-3
lines changed Expand file tree Collapse file tree 3 files changed +64
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Installation
4
4
5
+ ### Automatic
6
+
7
+ Run this command in your repo root.
8
+ ```
9
+ curl https://raw.githubusercontent.com/bool64/dev/master/makefiles/base.mk -sLo Makefile && make reset-ci
10
+ ```
11
+
12
+ ### Manual
13
+
5
14
Add a test file (e.g. ` dev_test.go ` ) to your module with unused import.
6
15
7
16
``` go
@@ -13,7 +22,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
13
22
Add ` Makefile ` to your module with includes standard targets.
14
23
15
24
``` Makefile
16
- GOLANGCI_LINT_VERSION := "v1.37.1" # Optional.
25
+ # GOLANGCI_LINT_VERSION := "v1.37.1" # Optional configuration to pinpoint golangci-lint version .
17
26
18
27
# The head of Makefile determines location of dev-go to include standard targets.
19
28
GO ?= go
@@ -24,7 +33,7 @@ ifneq "$(GOFLAGS)" ""
24
33
endif
25
34
26
35
ifneq "$(wildcard ./vendor ) " ""
27
- $(info >> using vendor)
36
+ $(info Using vendor)
28
37
modVendor = -mod=vendor
29
38
ifeq (,$(findstring -mod,$(GOFLAGS)))
30
39
export GOFLAGS := ${GOFLAGS} ${modVendor}
46
55
-include $(DEVGO_PATH ) /makefiles/lint.mk
47
56
-include $(DEVGO_PATH ) /makefiles/test-unit.mk
48
57
-include $(DEVGO_PATH ) /makefiles/bench.mk
49
- -include $(DEVGO_PATH ) /makefiles/github-actions .mk
58
+ -include $(DEVGO_PATH ) /makefiles/reset-ci .mk
50
59
51
60
# Add your custom targets here.
52
61
Original file line number Diff line number Diff line change
1
+ # GOLANGCI_LINT_VERSION := "v1.37.1" # Optional configuration to pinpoint golangci-lint version.
2
+
3
+ # The head of Makefile determines location of dev-go to include standard targets.
4
+ GO ?= go
5
+ export GO111MODULE = on
6
+
7
+ ifneq "$(GOFLAGS ) " ""
8
+ $(info GOFLAGS : ${GOFLAGS})
9
+ endif
10
+
11
+ ifneq "$(wildcard ./vendor ) " ""
12
+ $(info Using vendor)
13
+ modVendor = -mod=vendor
14
+ ifeq (,$(findstring -mod,$(GOFLAGS)))
15
+ export GOFLAGS := ${GOFLAGS} ${modVendor}
16
+ endif
17
+ ifneq "$(wildcard ./vendor/github.com/bool64/dev)" ""
18
+ DEVGO_PATH := ./vendor/github.com/bool64/dev
19
+ endif
20
+ endif
21
+
22
+ ifeq ($(DEVGO_PATH ) ,)
23
+ DEVGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev)
24
+ ifeq ($(DEVGO_PATH),)
25
+ $(info Module github.com/bool64/dev not found, downloading.)
26
+ DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) mod tidy && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
27
+ endif
28
+ endif
29
+
30
+ -include $(DEVGO_PATH ) /makefiles/main.mk
31
+ -include $(DEVGO_PATH ) /makefiles/lint.mk
32
+ -include $(DEVGO_PATH ) /makefiles/test-unit.mk
33
+ -include $(DEVGO_PATH ) /makefiles/bench.mk
34
+ -include $(DEVGO_PATH ) /makefiles/reset-ci.mk
35
+
36
+ # Add your custom targets here.
37
+
38
+ # # Run tests
39
+ test : test-unit
Original file line number Diff line number Diff line change
1
+ GO ?= go
2
+
3
+ -include $(DEVGO_PATH ) /makefiles/github-actions.mk
4
+
5
+ # # Reset CI files from bool64/dev templates, make sure to review changes before committing.
6
+ reset-ci : github-actions
7
+ @cp $(DEVGO_PATH ) /makefiles/base.mk Makefile; git add Makefile
8
+ @cp $(DEVGO_PATH ) /scripts/.golangci.yml .golangci.yml; git add .golangci.yml
9
+ @echo " package $( shell go list -f ' {{.Name}}' ) _test" > dev_test.go
10
+ @echo " " >> dev_test.go
11
+ @echo ' import _ "github.com/bool64/dev" // Include CI/Dev scripts to project.' >> dev_test.go
12
+
13
+ .PHONY : reset-ci
You can’t perform that action at this time.
0 commit comments