Skip to content

Commit

Permalink
Preparation work for v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jawher committed Aug 14, 2017
1 parent 82aefbe commit fb4935c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
language: go
go:
- 1.6
- 1.8
- 1.7
- tip

sudo: false

install:
- go get github.com/gordonklaus/ineffassign
- go get github.com/golang/lint/golint
- go get -t ./...
install: make setup

script: make check test

script:
- "! gofmt -s -d . 2>&1 | read"
- go test -v ./...
- go vet
- ineffassign .
- golint .
deploy:
provider: releases
api_key:
secure: D2fwuS7n54ZkjfRmLMEAnwR2lQLa5xd+4s0l65pI6UN4ljVfQwQiFdZXaZWFr8PYSTKTm0UPj6Iqqw7VOl8I6iDzcaOqN3hoh5mDaJ7kyo7GZRPodwK9MKdOp5dPw459L2Atll8kxb4iYmfnjmcl0lDCUuWvMxXx+zgiFTB7BO0=
skip_cleanup: true
on:
tags: true
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
test:
go test -v ./...

check: lint vet fmtcheck ineffassign

lint:
golint -set_exit_status .

vet:
go vet

fmtcheck:
@ export output="$$(gofmt -s -d .)"; \
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
exit $${status:-0}

ineffassign:
ineffassign .

setup:
go get github.com/gordonklaus/ineffassign
go get github.com/golang/lint/golint
go get -t -u ./...

.PHONY: test check lint vet fmtcheck ineffassign
6 changes: 2 additions & 4 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ func (cli *Cli) Run(args []string) error {
}

/*
ActionCommand(myFun) is syntactic sugar for
func(cmd *cli.Cmd) { cmd.Action = myFun }
ActionCommand is a convenience function to configure a command with an action.
cmd.CommandAction(_, _, myFun } is syntactic sugar for
cmd.Command(_, _, func(cmd *cli.Cmd) { cmd.Action = myFun })
cmd.ActionCommand(_, _, myFun } is equivalent to cmd.Command(_, _, func(cmd *cli.Cmd) { cmd.Action = myFun })
*/
func ActionCommand(action func()) CmdInitializer {
return func(cmd *Cmd) {
Expand Down
4 changes: 2 additions & 2 deletions values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestBoolParam(t *testing.T) {
err := param.Set(cas.input)

if cas.err {
require.Error(t, err, "value %q should have returned an error", cas.input)
require.Errorf(t, err, "value %q should have returned an error", cas.input)
continue
}

Expand Down Expand Up @@ -89,7 +89,7 @@ func TestIntParam(t *testing.T) {
err := param.Set(cas.input)

if cas.err {
require.Error(t, err, "value %q should have returned an error", cas.input)
require.Errorf(t, err, "value %q should have returned an error", cas.input)
continue
}

Expand Down

0 comments on commit fb4935c

Please sign in to comment.