diff --git a/Makefile b/Makefile index 621d74d691c5..2c76ea4c8b81 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ ADDLICENCESE= addlicense MISSPELL=misspell -error MISSPELL_CORRECTION=misspell -w STATICCHECK=staticcheck +IMPI=impi GIT_SHA=$(shell git rev-parse --short HEAD) BUILD_INFO_IMPORT_PATH=github.com/open-telemetry/opentelemetry-collector-contrib/internal/version @@ -40,10 +41,10 @@ all-srcs: .DEFAULT_GOAL := addlicense-fmt-vet-lint-goimports-misspell-staticcheck-test .PHONY: all -all: addlicense-fmt-vet-lint-goimports-misspell-staticcheck-test otelcontribcol +all: addlicense-fmt-impi-vet-lint-goimports-misspell-staticcheck-test otelcontribcol -.PHONY: addlicense-fmt-vet-lint-goimports-misspell-staticcheck-test -addlicense-fmt-vet-lint-goimports-misspell-staticcheck-test: addlicense fmt vet lint goimports misspell staticcheck test +.PHONY: addlicense-fmt-impi-vet-lint-goimports-misspell-staticcheck-test +addlicense-fmt-impi-vet-lint-goimports-misspell-staticcheck-test: addlicense fmt impi vet lint goimports misspell staticcheck test .PHONY: test test: @@ -128,6 +129,10 @@ vet: @$(GOVET) ./... @echo "Vet finished successfully" +.PHONY: impi +impi: + @$(IMPI) --local github.com/open-telemetry/opentelemetry-collector-contrib --scheme stdThirdPartyLocal ./... + .PHONY: install-tools install-tools: GO111MODULE=on go install \ @@ -135,7 +140,8 @@ install-tools: golang.org/x/lint/golint \ golang.org/x/tools/cmd/goimports \ github.com/client9/misspell/cmd/misspell \ - honnef.co/go/tools/cmd/staticcheck + honnef.co/go/tools/cmd/staticcheck \ + github.com/pavius/impi/cmd/impi .PHONY: otelcontribcol otelcontribcol: diff --git a/exporter/stackdriverexporter/config_test.go b/exporter/stackdriverexporter/config_test.go index 0abd0eb87518..7ed564eb6b7f 100644 --- a/exporter/stackdriverexporter/config_test.go +++ b/exporter/stackdriverexporter/config_test.go @@ -18,11 +18,10 @@ import ( "path" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-collector/config" "github.com/open-telemetry/opentelemetry-collector/config/configmodels" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestLoadConfig(t *testing.T) { diff --git a/exporter/stackdriverexporter/factory.go b/exporter/stackdriverexporter/factory.go index 28db4b0ad466..ced93c8a1b74 100644 --- a/exporter/stackdriverexporter/factory.go +++ b/exporter/stackdriverexporter/factory.go @@ -15,10 +15,9 @@ package stackdriverexporter import ( - "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector/config/configmodels" "github.com/open-telemetry/opentelemetry-collector/exporter" + "go.uber.org/zap" ) const ( diff --git a/exporter/stackdriverexporter/factory_test.go b/exporter/stackdriverexporter/factory_test.go index 20f9b8d185be..0007c70a1644 100644 --- a/exporter/stackdriverexporter/factory_test.go +++ b/exporter/stackdriverexporter/factory_test.go @@ -18,10 +18,9 @@ import ( "os" "testing" + "github.com/open-telemetry/opentelemetry-collector/config/configcheck" "github.com/stretchr/testify/assert" "go.uber.org/zap" - - "github.com/open-telemetry/opentelemetry-collector/config/configcheck" ) func TestCreateDefaultConfig(t *testing.T) { diff --git a/exporter/stackdriverexporter/stackdriver.go b/exporter/stackdriverexporter/stackdriver.go index 676186a3f45e..8f248d6e6455 100644 --- a/exporter/stackdriverexporter/stackdriver.go +++ b/exporter/stackdriverexporter/stackdriver.go @@ -21,14 +21,13 @@ import ( "fmt" "contrib.go.opencensus.io/exporter/stackdriver" - "google.golang.org/api/option" - "google.golang.org/grpc" - "github.com/open-telemetry/opentelemetry-collector/consumer/consumerdata" "github.com/open-telemetry/opentelemetry-collector/exporter" "github.com/open-telemetry/opentelemetry-collector/exporter/exporterhelper" "github.com/open-telemetry/opentelemetry-collector/oterr" spandatatranslator "github.com/open-telemetry/opentelemetry-collector/translator/trace/spandata" + "google.golang.org/api/option" + "google.golang.org/grpc" ) // stackdriverExporter is a wrapper struct of Stackdriver exporter diff --git a/go.mod b/go.mod index 3ffc5ab7217a..049409e75318 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/open-telemetry/opentelemetry-collector v0.2.1-0.20191016224815-dfabfb0c1d1e github.com/open-telemetry/opentelemetry-collector-contrib/exporter/stackdriverexporter v0.0.0-20191021165924-bb954188ac10 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinscribereceiver v0.0.0-20191021165924-bb954188ac10 + github.com/pavius/impi v0.0.0-20180302134524-c1cbdcb8df2b golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac golang.org/x/tools v0.0.0-20190917162342-3b4f30a44f3b honnef.co/go/tools v0.0.1-2019.2.3 diff --git a/go.sum b/go.sum index 81cc6018fc90..5d3e37d04f85 100644 --- a/go.sum +++ b/go.sum @@ -406,6 +406,8 @@ github.com/orijtech/prometheus-go-metrics-exporter v0.0.3-0.20190313163149-b321c github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pavius/impi v0.0.0-20180302134524-c1cbdcb8df2b h1:yS0+/i6mwRZCdssUd+MkFJkCn/Evh1PlUKCYe3aCtQw= +github.com/pavius/impi v0.0.0-20180302134524-c1cbdcb8df2b/go.mod h1:x/hU0bfdWIhuOT1SKwiJg++yvkk6EuOtJk8WtDZqgr8= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= diff --git a/internal/tools.go b/internal/tools.go index 8b34baf70255..22c8c7436904 100644 --- a/internal/tools.go +++ b/internal/tools.go @@ -25,6 +25,7 @@ package internal import ( _ "github.com/client9/misspell/cmd/misspell" _ "github.com/google/addlicense" + _ "github.com/pavius/impi/cmd/impi" _ "golang.org/x/lint/golint" _ "golang.org/x/tools/cmd/goimports" _ "honnef.co/go/tools/cmd/staticcheck" diff --git a/receiver/zipkinscribereceiver/config_test.go b/receiver/zipkinscribereceiver/config_test.go index c527b386ab53..837f330c12be 100644 --- a/receiver/zipkinscribereceiver/config_test.go +++ b/receiver/zipkinscribereceiver/config_test.go @@ -18,11 +18,10 @@ import ( "path" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-collector/config" "github.com/open-telemetry/opentelemetry-collector/config/configmodels" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestLoadConfig(t *testing.T) { diff --git a/receiver/zipkinscribereceiver/factory.go b/receiver/zipkinscribereceiver/factory.go index 3c104ceb5365..594ecf29169d 100644 --- a/receiver/zipkinscribereceiver/factory.go +++ b/receiver/zipkinscribereceiver/factory.go @@ -17,12 +17,11 @@ package zipkinscribereceiver import ( "context" - "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector/config/configerror" "github.com/open-telemetry/opentelemetry-collector/config/configmodels" "github.com/open-telemetry/opentelemetry-collector/consumer" "github.com/open-telemetry/opentelemetry-collector/receiver" + "go.uber.org/zap" ) // This file implements factory for Zipkin-Scribe receiver. diff --git a/receiver/zipkinscribereceiver/factory_test.go b/receiver/zipkinscribereceiver/factory_test.go index 45a9d7812fd8..eb69c21e823f 100644 --- a/receiver/zipkinscribereceiver/factory_test.go +++ b/receiver/zipkinscribereceiver/factory_test.go @@ -18,12 +18,11 @@ import ( "context" "testing" - "github.com/stretchr/testify/assert" - "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector/config/configcheck" "github.com/open-telemetry/opentelemetry-collector/config/configerror" "github.com/open-telemetry/opentelemetry-collector/consumer/consumerdata" + "github.com/stretchr/testify/assert" + "go.uber.org/zap" ) func TestCreateDefaultConfig(t *testing.T) { diff --git a/receiver/zipkinscribereceiver/receiver.go b/receiver/zipkinscribereceiver/receiver.go index 154c290bac4c..05e632bb44c5 100644 --- a/receiver/zipkinscribereceiver/receiver.go +++ b/receiver/zipkinscribereceiver/receiver.go @@ -24,7 +24,6 @@ import ( "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" "github.com/omnition/scribe-go/if/scribe/gen-go/scribe" - "github.com/open-telemetry/opentelemetry-collector/consumer" "github.com/open-telemetry/opentelemetry-collector/observability" "github.com/open-telemetry/opentelemetry-collector/receiver"