Makefile, main: fix tests

This commit is contained in:
Kevin Burke 2019-06-30 21:39:05 -07:00
parent cf87ac38af
commit 324e3676af
No known key found for this signature in database
GPG Key ID: 24B0EF06511BA263
3 changed files with 6 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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()}