Integrate with Travis CI (#103)

* Add .travis.yml
This commit is contained in:
Masashi SHIBATA 2018-10-25 22:59:47 +09:00 committed by GitHub
parent 4b35da6de1
commit 63e3a6f38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 9 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
*.o
*.a
*.so
bin/
# Folders
pkg/

32
.travis.yml Normal file
View File

@ -0,0 +1,32 @@
sudo: false
language: go
go:
- "1.11.x"
- tip
os:
- linux
- osx
- windows
install:
- make setup
jobs:
include:
- stage: Lint
script:
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "")
- make lint
go: "1.11.x"
os: osx
script:
- make test
- make build
matrix:
allow_failures:
- go: tip
- os: windows

View File

@ -2,33 +2,38 @@
.PHONY: setup
setup: ## Setup for required tools.
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
go get golang.org/x/tools/cmd/stringer
go get -u golang.org/x/lint/golint
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/tools/cmd/stringer
go get -u github.com/golang/dep/cmd/dep
dep ensure
.PHONY: fmt
fmt: ## Formatting source codes.
@goimports -w .
@goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*")
.PHONY: lint
lint: ## Run golint and go vet.
@golint .
@golint -set_exit_status=1
@go vet .
.PHONY: test
test: ## Run the tests.
@go test .
test: ## Run the tests with race condition checking.
@go test -race .
.PHONY: coverage
cover: ## Run the tests.
@go test -coverprofile=coverage.o
@go tool cover -func=coverage.o
.PHONY: race-test
race-test: ## Checking the race condition.
@go test -race .
.PHONY: build
build: ## Build example command lines.
go build -o bin/exec-command ./_example/exec-command/main.go
go build -o bin/http-prompt ./_example/http-prompt/main.go
go build -o bin/live-prefix ./_example/live-prefix/main.go
go build -o bin/simple-echo ./_example/simple-echo/main.go
go build -o bin/simple-echo-cjk-cyrillic ./_example/simple-echo/cjk-cyrillic/main.go
.PHONY: help
help: ## Show help text

View File

@ -4,6 +4,7 @@
![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)
[![Backers on Open Collective](https://opencollective.com/go-prompt/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/go-prompt/sponsors/badge.svg)](#sponsors)
[![GoDoc](https://godoc.org/github.com/c-bata/go-prompt?status.svg)](https://godoc.org/github.com/c-bata/go-prompt)
[![Build Status](https://travis-ci.org/c-bata/go-prompt.svg?branch=master)](https://travis-ci.org/c-bata/go-prompt)
A library for building powerful interactive prompts inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit),
making it easier to build cross-platform command line tools using Go.

View File

@ -43,6 +43,9 @@ func (w *PosixWriter) Flush() error {
var _ ConsoleWriter = &PosixWriter{}
var (
// NewStandardOutputWriter returns ConsoleWriter object to write to stdout.
// This generates VT100 escape sequences because almost terminal emulators
// in POSIX OS built on top of a VT100 specification.
// Deprecated: Please use NewStdoutWriter
NewStandardOutputWriter = NewStdoutWriter
)