Skip to content

Commit

Permalink
Adds vanity import check (#4180)
Browse files Browse the repository at this point in the history
* chore: adds porto and fixes vanity imports.

* chore: fixes target overriding.

* chore: fixes install of porto.

* chore: includes porto as a tool.

* chore: upgrades porto to check internals.

* chore: rebase and update vanity import.

* chore: removes unnecessary space.

* chore: rollsback vanity import in generated files.
  • Loading branch information
jcchavezs authored Oct 12, 2021
1 parent 6654804 commit 9d3a8a4
Show file tree
Hide file tree
Showing 267 changed files with 283 additions and 267 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: build-and-test
on:
push:
branches: [ main ]
branches: [main]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:

jobs:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
path: /home/runner/go/bin
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
- name: Lint
run: make -j5 checklicense misspell checkdoc goimpi golint
run: make -j5 checklicense misspell checkdoc goimpi golint goporto
- name: Gen Metadata
run: |
make genmdata
Expand Down Expand Up @@ -206,4 +206,3 @@ jobs:
with:
name: collector-binaries-unstable
path: ./bin-unstable.tar

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ gotest-with-cover:
@$(MAKE) for-all CMD="make test-with-cover"
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt

.PHONY: goporto
goporto:
@$(MAKE) for-all CMD="make porto"

.PHONY: golint
golint:
@$(MAKE) for-all CMD="make lint lint-unstable"
Expand Down Expand Up @@ -134,6 +138,7 @@ install-tools:
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/build-tools/semconvgen
cd $(TOOLS_MOD_DIR) && go install golang.org/x/exp/cmd/apidiff
cd $(TOOLS_MOD_DIR) && go install golang.org/x/tools/cmd/goimports
cd $(TOOLS_MOD_DIR) && go install github.com/jcchavezs/porto/cmd/porto

.PHONY: otelcol
otelcol:
Expand Down
4 changes: 4 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ lint:
lint-unstable:
$(LINT) run --allow-parallel-runners --build-tags enable_unstable

.PHONY: porto
porto:
porto -w --include-internal ./

.PHONY: impi
impi:
@$(IMPI) --local go.opentelemetry.io/collector --scheme stdThirdPartyLocal ./...
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

// Package client contains generic representations of clients connecting to different receivers
package client
package client // import "go.opentelemetry.io/collector/client"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/base_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/base_slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/base_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/common_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

var commonFile = &File{
Name: "common",
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/log_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

var logFile = &File{
Name: "log",
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

var metricsFile = &File{
Name: "metrics",
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/resource_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

var resourceFile = &File{
Name: "resource",
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/trace_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal"

var traceFile = &File{
Name: "trace",
Expand Down
2 changes: 1 addition & 1 deletion component/build_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

// BuildInfo is the information that is logged at the application start and
// passed into each component. This information can be overridden in custom builds.
Expand Down
2 changes: 1 addition & 1 deletion component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenterror/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

// Package componenterror provides helper functions to create and process
// OpenTelemetry component errors.
package componenterror
package componenterror // import "go.opentelemetry.io/collector/component/componenterror"
2 changes: 1 addition & 1 deletion component/componenterror/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenterror
package componenterror // import "go.opentelemetry.io/collector/component/componenterror"

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion component/componenthelper/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenthelper
package componenthelper // import "go.opentelemetry.io/collector/component/componenthelper"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenthelper/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
// limitations under the License.

// Package componenthelper assists with the creation of a new component.Component.
package componenthelper
package componenthelper // import "go.opentelemetry.io/collector/component/componenthelper"
2 changes: 1 addition & 1 deletion component/componenttest/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

// Package componenttest define types and functions used to help test packages
// implementing the component package interfaces.
package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"
2 changes: 1 addition & 1 deletion component/componenttest/nop_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"go.opentelemetry.io/collector/component"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"go.opentelemetry.io/collector/component"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/nop_telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"go.opentelemetry.io/otel/metric"
Expand Down
2 changes: 1 addition & 1 deletion component/componenttest/shutdown_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package componenttest
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// and provides a foundation for the component’s creation and
// termination process. A component can be either a receiver, exporter,
// processor, or an extension.
package component
package component // import "go.opentelemetry.io/collector/component"
2 changes: 1 addition & 1 deletion component/experimental/component/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// that typically live under the "go.opentelemetry.io/collector/component"
// package but aren't stable yet to be published there.
// ATTENTION: the package is still experimental and subject to changes without advanced notice.
package component
package component // import "go.opentelemetry.io/collector/component/experimental/component"
2 changes: 1 addition & 1 deletion component/experimental/component/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component/experimental/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion component/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"go.opentelemetry.io/collector/config"
Expand Down
2 changes: 1 addition & 1 deletion component/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion component/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package component
package component // import "go.opentelemetry.io/collector/component"

import (
"go.opentelemetry.io/otel/metric"
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package config
package config // import "go.opentelemetry.io/collector/config"

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion config/configauth/clientauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package configauth
package configauth // import "go.opentelemetry.io/collector/config/configauth"

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion config/configauth/configauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package configauth
package configauth // import "go.opentelemetry.io/collector/config/configauth"

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion config/configauth/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
// Package configauth implements the configuration settings to
// ensure authentication on incoming requests, and allows
// exporters to add authentication on outgoing requests.
package configauth
package configauth // import "go.opentelemetry.io/collector/config/configauth"
2 changes: 1 addition & 1 deletion config/configauth/mock_clientauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package configauth
package configauth // import "go.opentelemetry.io/collector/config/configauth"

import (
"context"
Expand Down
Loading

0 comments on commit 9d3a8a4

Please sign in to comment.