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:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- master
script: make test

View File

@ -1,20 +1,14 @@
MEGACHECK := $(GOPATH)/bin/megacheck
STATICCHECK := $(GOPATH)/bin/staticcheck
RELEASE := $(GOPATH)/bin/github-release
UNAME := $(shell uname)
$(MEGACHECK):
ifeq ($(UNAME), Darwin)
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)
$(STATICCHECK):
go get honnef.co/go/tools/cmd/staticcheck
vet: $(MEGACHECK)
vet: $(STATICCHECK)
go list ./... | grep -v vendor | xargs go vet
go list ./... | grep -v vendor | xargs $(MEGACHECK)
go list ./... | grep -v vendor | xargs $(STATICCHECK)
test: vet
go list ./... | grep -v vendor | xargs go test

View File

@ -145,7 +145,6 @@ func main() {
cmark, lookErr := exec.LookPath("cmark")
args := []string{cmark, "--unsafe", f.Name()}
if lookErr != nil {
args = args[:0]
cmark, lookErr = exec.LookPath("markdown")
checkError(lookErr, "finding markdown binary")
args = []string{cmark, f.Name()}