Skip to content

Commit edbcd08

Browse files
authored
Merge pull request #133 from vim-jp/fix-misc
cover target to get coverage on local
2 parents 0d2aa42 + 5092927 commit edbcd08

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ tab_width = 2
1212
[*.{js,json,md,html,css}]
1313
indent_size = 2
1414
indent_style = space
15+
16+
[*.go]
17+
tab_width = 4
18+
19+
[Makefile]
20+
tab_width = 8

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
PACKAGES=./...
2+
13
.PHONY: generate
24
generate: _site
35

@@ -22,15 +24,21 @@ build:
2224

2325
.PHONY: test
2426
test:
25-
go test ./...
27+
go test ${PACKAGES}
28+
29+
# cover - テストを実行してカバレッジを計測し結果を tmp/cover.html に出力する
30+
.PHONY: cover
31+
cover:
32+
go test -coverprofile tmp/cover.out ${PACKAGES}
33+
go tool cover -html tmp/cover.out -o tmp/cover.html
2634

2735
.PHONY: vet
2836
vet:
29-
go vet ./...
37+
go vet ${PACKAGES}
3038

3139
.PHONY: lint
3240
lint:
33-
golint ./...
41+
golint ${PACKAGES}
3442

3543
.PHONY: go-clean
3644
go-clean:

0 commit comments

Comments
 (0)