Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: go

go:
- 1.7.1

sudo: false

env:
global:
# Coveralls.io
- secure: OGYOsFNXNarEZ5yA4/M6ZdVguD0jL8vXgXrbLzjcpkKcq8ObHSCtNINoUlnNf6l6Z92kPnuV+LSm7jKTojBlov4IwgiY1ACbvg921SdjxYkg1AiwHTRTLR1g/esX8RdaBpJ0TOcXOFFsYMRVvl5sxxtb0tXSuUrT+Ch4SUCY7X8=

install:
- make install-dependencies
- make install-tools
- make install

script:
- make lint
- make test-with-coverage
- gover
- if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then goveralls -coverprofile=gover.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.PHONY: all clean clean-coverage install install-dependencies install-tools lint test test-verbose test-with-coverage

export ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
export PKG := github.com/sergi/go-diff
export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

$(eval $(ARGS):;@:) # turn arguments into do-nothing targets
export ARGS

ifdef ARGS
PKG_TEST := $(ARGS)
else
PKG_TEST := $(PKG)/...
endif

all: install-tools install-dependencies install lint test

clean:
go clean -i $(PKG)/...
go clean -i -race $(PKG)/...
clean-coverage:
find $(ROOT_DIR) | grep .coverprofile | xargs rm
install:
go install -v $(PKG)/...
install-dependencies:
go get -t -v $(PKG)/...
go build -v $(PKG)/...
install-tools:
# Install linting tools
go get -u -v github.com/golang/lint/...
go get -u -v github.com/kisielk/errcheck/...

# Install code coverage tools
go get -u -v github.com/onsi/ginkgo/ginkgo/...
go get -u -v github.com/modocache/gover/...
go get -u -v github.com/mattn/goveralls/...
lint:
$(ROOT_DIR)/scripts/lint.sh
test:
go test -race -test.timeout 120s $(PKG_TEST)
test-verbose:
go test -race -test.timeout 120s -v $(PKG_TEST)
test-with-coverage:
ginkgo -r -cover -race -skipPackage="testdata"
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
go-diff
=======
# go-diff [![GoDoc](https://godoc.org/github.com/sergi/go-diff?status.png)](https://godoc.org/github.com/sergi/go-diff) [![Build Status](https://travis-ci.org/sergi/go-diff.svg?branch=master)](https://travis-ci.org/sergi/go-diff) [![Coverage Status](https://coveralls.io/repos/sergi/go-diff/badge.png?branch=master)](https://coveralls.io/r/sergi/go-diff?branch=master)

Go-diff is a Go language port of Neil Fraser's google-diff-match-patch code. His original code is available at:

http://code.google.com/p/google-diff-match-patch/

Current state for this Go library
---------------------------------
## Current state for this Go library

In order to run the tests:

Expand All @@ -16,8 +14,7 @@ In order to run the tests:

go get github.com/sergi/go-diff/diffmatchpatch

Copyright and License
---------------------
## Copyright and License

The original Google Diff, Match and Patch Library is licensed under
the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
Expand Down
Loading