Skip to content

Commit

Permalink
Integrate with Travis CI (#103)
Browse files Browse the repository at this point in the history
* Add .travis.yml
  • Loading branch information
c-bata authored Oct 25, 2018
1 parent 4b35da6 commit 63e3a6f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.o
*.a
*.so
bin/

# Folders
pkg/
Expand Down
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions output_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 63e3a6f

Please sign in to comment.