Skip to content

Commit

Permalink
Fix CI setting (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
evalphobia authored Jul 11, 2019
1 parent 989dca7 commit 3ed94e9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 21 deletions.
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
language: go
go:
- 1.7
- 1.8
- 1.11
- "1.12.x"
- tip
matrix:
allow_failures:
Expand All @@ -11,7 +11,13 @@ before_install:
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- test -z "$(gofmt -s -l . | tee /dev/stderr)"
- go tool vet -all -structtags -shadow .
- go get -t -v ./...
- make lint
script:
- $HOME/gopath/bin/goveralls -service=travis-ci
- make test
after_success:
- |
if [[ $TRAVIS_GO_VERSION = 1.12.x ]]
then
make coverage
fi
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: lint test

lint:
@type golangci-lint > /dev/null || go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint -E gofmt run ./...

test:
go test ./...

coverage:
go test -covermode=count -coverprofile=coverage.txt ./...
@type goveralls > /dev/null || go get -u github.com/mattn/goveralls
goveralls -coverprofile=coverage.txt -service=travis-ci
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Fluentd Hook for Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/>
----

[![GoDoc][1]][2] [![License: Apache 2.0][3]][4] [![Release][5]][6] [![Travis Status][7]][8] [![wercker Status][19]][20] [![Coveralls Coverage][9]][10] [![Go Report Card][13]][14] [![Downloads][15]][16]
[![GoDoc][1]][2] [![License: Apache 2.0][3]][4] [![Release][5]][6] [![Travis Status][7]][8] [![wercker Status][19]][20] [![Coveralls Coverage][9]][10] [![Go Report Card][13]][14] [![Downloads][15]][16] [![Code Climate][21]][22] [![BCH compliance][23]][24]

[1]: https://godoc.org/github.com/evalphobia/logrus_fluent?status.svg
[2]: https://godoc.org/github.com/evalphobia/logrus_fluent
Expand All @@ -23,6 +23,11 @@ Fluentd Hook for Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" hei
[18]: https://github.com/evalphobia/logrus_fluent/stargazers
[19]: https://app.wercker.com/status/04fb4bde79d8c54bb681af664394d2e4/s/master
[20]: https://app.wercker.com/project/byKey/04fb4bde79d8c54bb681af664394d2e4
[21]: https://codeclimate.com/github/evalphobia/logrus_fluent/badges/gpa.svg
[22]: https://codeclimate.com/github/evalphobia/logrus_fluent
[23]: https://bettercodehub.com/edge/badge/evalphobia/logrus_fluent?branch=master
[24]: https://bettercodehub.com/



## Usage
Expand Down
4 changes: 2 additions & 2 deletions fluent.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ func (hook *FluentHook) setMessage(entry *logrus.Entry, data logrus.Fields) {
if _, ok := data[hook.messageField]; ok {
return
}
var v interface{}
v = entry.Message

var v interface{} = entry.Message
if fn, ok := hook.filters[hook.messageField]; ok {
v = fn(v)
}
Expand Down
1 change: 0 additions & 1 deletion fluent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const (
assertEntryMessageAsFluentTag = "\x94\xaeMyEntryMessage\xd2"

staticTag = "STATIC_TAG"
assertStaticTag = "\xa3tag\xaaSTATIC_TAG"
assertStaticTagAsFluentTag = "\x94\xaaSTATIC_TAG\xd2"
)

Expand Down
2 changes: 1 addition & 1 deletion reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestConvertToValuError(t *testing.T) {
assert := assert.New(t)

err := errors.New("the error")
data := map[string]interface{} {"error": err}
data := map[string]interface{}{"error": err}

result := ConvertToValue(data, TagName)

Expand Down
18 changes: 7 additions & 11 deletions wercker.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
box: golang:1.8.1-stretch
box: golang:1.12.7-stretch
dev:
build:
steps:
- setup-go-workspace
- script:
name: gofmt
code: |
test -z "$(gofmt -s -l . | tee /dev/stderr)"
- script:
name: go vet
code: |
go tool vet -all -structtags -shadow .
- script:
name: go get
code: |
go get -t -v ./...
- script:
name: go test
name: lint
code: |
make lint
- script:
name: test
code: |
go test ./...
make test

0 comments on commit 3ed94e9

Please sign in to comment.