Makefile, main: fix tests
This commit is contained in:
parent
cf87ac38af
commit
324e3676af
|
@ -2,9 +2,8 @@ language: go
|
||||||
go_import_path: github.com/kevinburke/chroma-markdown
|
go_import_path: github.com/kevinburke/chroma-markdown
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.9.x
|
|
||||||
- 1.10.x
|
|
||||||
- 1.11.x
|
- 1.11.x
|
||||||
|
- 1.12.x
|
||||||
- master
|
- master
|
||||||
|
|
||||||
script: make test
|
script: make test
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -1,20 +1,14 @@
|
||||||
MEGACHECK := $(GOPATH)/bin/megacheck
|
STATICCHECK := $(GOPATH)/bin/staticcheck
|
||||||
RELEASE := $(GOPATH)/bin/github-release
|
RELEASE := $(GOPATH)/bin/github-release
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
$(MEGACHECK):
|
$(STATICCHECK):
|
||||||
ifeq ($(UNAME), Darwin)
|
go get honnef.co/go/tools/cmd/staticcheck
|
||||||
curl --silent --location --output $(MEGACHECK) https://github.com/kevinburke/go-tools/releases/download/2018-11-18/megacheck-darwin-amd64
|
|
||||||
endif
|
|
||||||
ifeq ($(UNAME), Linux)
|
|
||||||
curl --silent --location --output $(MEGACHECK) https://github.com/kevinburke/go-tools/releases/download/2018-11-18/megacheck-linux-amd64
|
|
||||||
endif
|
|
||||||
chmod 755 $(MEGACHECK)
|
|
||||||
|
|
||||||
vet: $(MEGACHECK)
|
vet: $(STATICCHECK)
|
||||||
go list ./... | grep -v vendor | xargs go vet
|
go list ./... | grep -v vendor | xargs go vet
|
||||||
go list ./... | grep -v vendor | xargs $(MEGACHECK)
|
go list ./... | grep -v vendor | xargs $(STATICCHECK)
|
||||||
|
|
||||||
test: vet
|
test: vet
|
||||||
go list ./... | grep -v vendor | xargs go test
|
go list ./... | grep -v vendor | xargs go test
|
||||||
|
|
1
main.go
1
main.go
|
@ -145,7 +145,6 @@ func main() {
|
||||||
cmark, lookErr := exec.LookPath("cmark")
|
cmark, lookErr := exec.LookPath("cmark")
|
||||||
args := []string{cmark, "--unsafe", f.Name()}
|
args := []string{cmark, "--unsafe", f.Name()}
|
||||||
if lookErr != nil {
|
if lookErr != nil {
|
||||||
args = args[:0]
|
|
||||||
cmark, lookErr = exec.LookPath("markdown")
|
cmark, lookErr = exec.LookPath("markdown")
|
||||||
checkError(lookErr, "finding markdown binary")
|
checkError(lookErr, "finding markdown binary")
|
||||||
args = []string{cmark, f.Name()}
|
args = []string{cmark, f.Name()}
|
||||||
|
|
Loading…
Reference in New Issue