Skip to content

Commit

Permalink
Upgrade lints to go 1.10 (#46)
Browse files Browse the repository at this point in the history
Resolves #42
  • Loading branch information
cep21 authored Jun 26, 2018
1 parent c23e537 commit 6e121eb
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Vendor": true,
"MinConfidence": 0.3,
"DuplThreshold": 100,
"Deadline": "5m",
"LineLength": 150,
"Enable": [
"deadcode",
"dupl",
"errcheck",
"gas",
"goconst",
"gocyclo",
"goimports",
"gofmt",
"golint",
"gotype",
"gotypex",
"ineffassign",
"interfacer",
"lll",
"maligned",
"megacheck",
"misspell",
"nakedret",
"safesql",
"structcheck",
"testify",
"unconvert",
"unparam",
"varcheck",
"vet",
"vetshadow"
]
}
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ language: go
sudo: false

env:
- DEP_VERSION="0.3.2"
- DEP_VERSION="0.4.1"


# Version 1.8 messes up the lint checks for travis
go:
- 1.9
- "1.10"

cache:
directories:
Expand All @@ -18,5 +18,6 @@ install:
- make setup_ci redep

script:
- make build
- make test
- make lint
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
PROFILE_RUN ?= BenchmarkCiruits/Hystrix/Minimal/failing/75
BENCH_RUN ?= .

build:
go build ./...

# Run unit tests
test:
env "GORACE=halt_on_error=1" go test -v -race ./...

build:
go build -t ./...

# Format the code
fix:
find . -iname '*.go' -not -path '*/vendor/*' -print0 | xargs -0 gofmt -s -w
Expand Down Expand Up @@ -36,7 +37,7 @@ profile_blocking:

# Lint the code
lint:
gometalinter --vendor --deadline=5m --enable-all -D lll --dupl-threshold=100 ./...
gometalinter ./...

# Run the example
run:
Expand Down
3 changes: 3 additions & 0 deletions benchmarking/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package benchmarking does not contain used code. Instead, it contains only the
// files required to run benchmarking against other circuits
package benchmarking
2 changes: 1 addition & 1 deletion closers/hystrix/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ExampleFactory() {
},
// Hystrix close logic is to sleep then check
ConfigureCloser: hystrix.ConfigureCloser{
// The default values match what hystrix does by default
// The default values match what hystrix does by default
},
}
h := circuit.Manager{
Expand Down
1 change: 1 addition & 0 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/cep21/circuit/metrics/rolling"
)

// nolint:lll
const exampleURL = "http://localhost:7979/hystrix-dashboard/monitor/monitor.html?streams=%5B%7B%22name%22%3A%22%22%2C%22stream%22%3A%22http%3A%2F%2Flocalhost%3A8123%2Fhystrix.stream%22%2C%22auth%22%3A%22%22%2C%22delay%22%3A%22%22%7D%5D"

func main() {
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func ExampleConfig_custommetrics() {
config := circuit.Config{
Metrics: circuit.MetricsCollectors{
Run: []circuit.RunMetrics{
// Here is where I would insert my custom metric collector
// Here is where I would insert my custom metric collector
},
},
}
Expand Down
1 change: 1 addition & 0 deletions metriceventstream/metriceventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func collectCommandMetrics(cb *circuit.Circuit) *streamCmdMetric {
RollingCountTimeout: builtInRollingCmdMetricCollector.ErrTimeouts.RollingSumAt(now),
// Note: There is no errInterrupt field inside the dashboard, but i still want to expose these metrics there,
// so I just roll them into BadRequests
// nolint: lll
RollingCountBadRequests: builtInRollingCmdMetricCollector.ErrBadRequests.RollingSumAt(now) + builtInRollingCmdMetricCollector.ErrInterrupts.RollingSumAt(now),

TotalCountFallbackSuccess: builtInRollingFallbackMetricCollector.Successes.TotalSum(),
Expand Down

0 comments on commit 6e121eb

Please sign in to comment.