diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..506f5e3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,22 @@ +# Golang CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-go/ for more details +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.8 + + working_directory: /go/src/github.com/meleca/plugins + + environment: + COVERAGE_DIR: /tmp/coverage-dir + + steps: + - checkout + + - run: mkdir -p "${COVERAGE_DIR}" + - run: go get -v github.com/mattn/goveralls + - run: go get -v -t -d ./... + - run: ./test-coverage.sh + - run: goveralls -coverprofile="${COVERAGE_DIR}/coverage.out" -service=circle-ci -repotoken="${COVERALLS_TOKEN}" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4325423 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true + +[*.go] +indent_style = tab diff --git a/9gag/9gag.go b/9gag/9gag.go index 225691d..195bdda 100644 --- a/9gag/9gag.go +++ b/9gag/9gag.go @@ -5,7 +5,7 @@ import ( "net/http" "net/url" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/README.md b/README.md index 416c91b..3ca3c27 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Circle CI](https://circleci.com/gh/go-chat-bot/plugins.svg?style=svg)](https://circleci.com/gh/go-chat-bot/plugins) +[![CircleCI](https://circleci.com/gh/meleca/plugins/tree/master.svg?style=svg)](https://circleci.com/gh/meleca/plugins/tree/master) [![Coverage Status](https://coveralls.io/repos/github/meleca/plugins/badge.svg?branch=master)](https://coveralls.io/github/meleca/plugins?branch=master) ### Active diff --git a/catfacts/catfacts.go b/catfacts/catfacts.go index 1d5d388..9c6eb08 100644 --- a/catfacts/catfacts.go +++ b/catfacts/catfacts.go @@ -2,8 +2,8 @@ package catfacts import ( "fmt" - "github.com/go-chat-bot/bot" - "github.com/go-chat-bot/plugins/web" + "github.com/meleca/bot" + "github.com/meleca/plugins/web" "regexp" ) diff --git a/catfacts/catfacts_test.go b/catfacts/catfacts_test.go index 4468d04..25b34e4 100644 --- a/catfacts/catfacts_test.go +++ b/catfacts/catfacts_test.go @@ -2,7 +2,7 @@ package catfacts import ( "fmt" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "net/http" "net/http/httptest" diff --git a/catgif/catgif.go b/catgif/catgif.go index c9b88b4..ea90bea 100644 --- a/catgif/catgif.go +++ b/catgif/catgif.go @@ -1,7 +1,7 @@ package catgif import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" "net/http" ) diff --git a/chucknorris/chucknorris.go b/chucknorris/chucknorris.go index 888bbfa..ca13db0 100644 --- a/chucknorris/chucknorris.go +++ b/chucknorris/chucknorris.go @@ -1,7 +1,7 @@ package chucknorris import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" "math/rand" "regexp" ) diff --git a/chucknorris/chucknorris_test.go b/chucknorris/chucknorris_test.go index 645253c..57c4574 100644 --- a/chucknorris/chucknorris_test.go +++ b/chucknorris/chucknorris_test.go @@ -1,7 +1,7 @@ package chucknorris import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "testing" ) diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 4ac67f3..0000000 --- a/circle.yml +++ /dev/null @@ -1,5 +0,0 @@ -test: - pre: - - go get -d -t ./... - override: - - go test ./... -race diff --git a/crypto/crypto.go b/crypto/crypto.go index b44e3c6..096a8b6 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index b676744..c03ce3d 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -3,7 +3,7 @@ package crypto import ( "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" ) diff --git a/encoding/decode.go b/encoding/decode.go index f5c7d98..dc732e6 100644 --- a/encoding/decode.go +++ b/encoding/decode.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) func decode(command *bot.Cmd) (string, error) { diff --git a/encoding/decode_test.go b/encoding/decode_test.go index 6ff8106..01513ac 100644 --- a/encoding/decode_test.go +++ b/encoding/decode_test.go @@ -3,7 +3,7 @@ package encoding import ( "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" ) diff --git a/encoding/encode.go b/encoding/encode.go index e95d3c0..f8d628b 100644 --- a/encoding/encode.go +++ b/encoding/encode.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/encoding/encode_test.go b/encoding/encode_test.go index c5b81b9..3a82da7 100644 --- a/encoding/encode_test.go +++ b/encoding/encode_test.go @@ -3,7 +3,7 @@ package encoding import ( "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" ) diff --git a/example/goodmorning_command.go b/example/goodmorning_command.go index 1b50c33..499e3fa 100644 --- a/example/goodmorning_command.go +++ b/example/goodmorning_command.go @@ -5,7 +5,7 @@ import ( "os" "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) func goodMorning(channel string) (msg string, err error) { diff --git a/example/helloworld_command.go b/example/helloworld_command.go index 855691c..dd50cc1 100644 --- a/example/helloworld_command.go +++ b/example/helloworld_command.go @@ -3,7 +3,7 @@ package example import ( "fmt" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) func hello(command *bot.Cmd) (msg string, err error) { diff --git a/example/helloworld_command_test.go b/example/helloworld_command_test.go index be29fc1..5c6f664 100644 --- a/example/helloworld_command_test.go +++ b/example/helloworld_command_test.go @@ -3,7 +3,7 @@ package example import ( "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) func TestHelloworld(t *testing.T) { diff --git a/example/reverse_command.go b/example/reverse_command.go index 719554e..9d7c3e5 100644 --- a/example/reverse_command.go +++ b/example/reverse_command.go @@ -1,7 +1,7 @@ package example import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) // From stackoverflow: http://stackoverflow.com/a/10030772 diff --git a/example/reverse_command_test.go b/example/reverse_command_test.go index d3ea8dd..2cebd56 100644 --- a/example/reverse_command_test.go +++ b/example/reverse_command_test.go @@ -1,7 +1,7 @@ package example import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" "testing" ) diff --git a/gif/gif.go b/gif/gif.go index 6110915..5c0a161 100644 --- a/gif/gif.go +++ b/gif/gif.go @@ -2,8 +2,8 @@ package gif import ( "fmt" - "github.com/go-chat-bot/bot" - "github.com/go-chat-bot/plugins/web" + "github.com/meleca/bot" + "github.com/meleca/plugins/web" "math/rand" "net/url" "time" diff --git a/godoc/godoc.go b/godoc/godoc.go index 44e29d9..e8016c8 100644 --- a/godoc/godoc.go +++ b/godoc/godoc.go @@ -2,8 +2,8 @@ package godoc import ( "fmt" - "github.com/go-chat-bot/bot" - "github.com/go-chat-bot/plugins/web" + "github.com/meleca/bot" + "github.com/meleca/plugins/web" "net/url" ) diff --git a/godoc/godoc_test.go b/godoc/godoc_test.go index 2d6bf2d..9894bf1 100644 --- a/godoc/godoc_test.go +++ b/godoc/godoc_test.go @@ -2,7 +2,7 @@ package godoc import ( "fmt" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "net/http" "net/http/httptest" @@ -70,7 +70,7 @@ func TestGoDoc(t *testing.T) { }) Convey("When the api is unreachable", func() { - godocSearchURL = "127.0.0.1:0" + godocSearchURL = "127.0.0.1" cmd.RawArgs = "go-bot" _, err := search(cmd) diff --git a/guid/guid.go b/guid/guid.go index 8d13c39..cd308f1 100644 --- a/guid/guid.go +++ b/guid/guid.go @@ -4,7 +4,7 @@ import ( "strings" uuid "github.com/beevik/guid" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/guid/guid_test.go b/guid/guid_test.go index 143fdaa..835468c 100644 --- a/guid/guid_test.go +++ b/guid/guid_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" ) diff --git a/jira/jira.go b/jira/jira.go index a073c5d..f994aa5 100644 --- a/jira/jira.go +++ b/jira/jira.go @@ -1,7 +1,7 @@ package jira import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" "os" "regexp" "strings" diff --git a/jira/jira_test.go b/jira/jira_test.go index 1a8c723..25fe6c3 100644 --- a/jira/jira_test.go +++ b/jira/jira_test.go @@ -2,7 +2,7 @@ package jira import ( "fmt" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "testing" ) diff --git a/puppet/puppet_command.go b/puppet/puppet_command.go index 017d69b..b33a124 100644 --- a/puppet/puppet_command.go +++ b/puppet/puppet_command.go @@ -3,7 +3,7 @@ package puppet import ( "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/puppet/puppet_command_test.go b/puppet/puppet_command_test.go index 05a2f1c..e778e93 100644 --- a/puppet/puppet_command_test.go +++ b/puppet/puppet_command_test.go @@ -1,7 +1,7 @@ package puppet import ( - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "testing" ) diff --git a/test-coverage.sh b/test-coverage.sh new file mode 100755 index 0000000..cd91174 --- /dev/null +++ b/test-coverage.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "mode: set" > $COVERAGE_DIR/coverage.out +for Dir in $(find ./* -maxdepth 10 -type d ); +do + if ls $Dir/*.go &> /dev/null; + then + returnval=`go test -cover -race -coverprofile=$COVERAGE_DIR/coverage.part $Dir` + echo ${returnval} + if [[ ${returnval} != *FAIL* ]] + then + if [ -f $COVERAGE_DIR/coverage.part ] + then + cat $COVERAGE_DIR/coverage.part | grep -v "mode: atomic" >> $COVERAGE_DIR/coverage.out + fi + else + exit 1 + fi + fi +done diff --git a/treta/treta.go b/treta/treta.go index ea9d98b..adbe31c 100644 --- a/treta/treta.go +++ b/treta/treta.go @@ -4,7 +4,7 @@ import ( "math/rand" "strings" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) const ( diff --git a/treta/treta_test.go b/treta/treta_test.go index 0aac980..dad7b3d 100644 --- a/treta/treta_test.go +++ b/treta/treta_test.go @@ -3,7 +3,7 @@ package treta import ( "testing" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" ) diff --git a/uptime/uptime.go b/uptime/uptime.go index 2f549f6..c18d877 100644 --- a/uptime/uptime.go +++ b/uptime/uptime.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/cloudfoundry/gosigar" "time" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" ) func uptime(command *bot.Cmd) (msg string, err error) { diff --git a/url/url.go b/url/url.go index 1e6b17b..7e624b5 100644 --- a/url/url.go +++ b/url/url.go @@ -1,8 +1,8 @@ package url import ( - "github.com/go-chat-bot/bot" - "github.com/go-chat-bot/plugins/web" + "github.com/meleca/bot" + "github.com/meleca/plugins/web" "html" "net/url" "regexp" diff --git a/url/url_test.go b/url/url_test.go index 8819347..6c2b019 100644 --- a/url/url_test.go +++ b/url/url_test.go @@ -2,7 +2,7 @@ package url import ( "fmt" - "github.com/go-chat-bot/bot" + "github.com/meleca/bot" . "github.com/smartystreets/goconvey/convey" "net/http" "net/http/httptest"