Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ linters:
- revive
- gosec
- misspell
- scopelint
- exportloopref
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.

- unconvert
- unparam
- goheader
- gocritic

linters-settings:
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/envoyproxy/gateway/) # Groups all imports with the specified Prefix.
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/envoyproxy/gateway/
gofmt:
simplify: true
unparam:
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/validation/authenticationfilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ package validation
import (
"testing"

"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/stretchr/testify/require"
)

func TestValidateAuthenticationFilter(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/gatewayapi/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"fmt"
"strings"

"github.com/envoyproxy/gateway/internal/ir"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/envoyproxy/gateway/internal/ir"
)

type FiltersTranslator interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"fmt"
"strings"

"github.com/envoyproxy/gateway/internal/ir"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/gateway-api/apis/v1alpha2"
"sigs.k8s.io/gateway-api/apis/v1beta1"

egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/envoyproxy/gateway/internal/ir"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/gatewayapi/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ package gatewayapi
import (
"fmt"

"github.com/envoyproxy/gateway/internal/ir"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/envoyproxy/gateway/internal/ir"
)

var _ ListenersTranslator = (*Translator)(nil)
Expand Down
5 changes: 3 additions & 2 deletions internal/gatewayapi/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
package gatewayapi

import (
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/envoyproxy/gateway/internal/ir"
v1 "k8s.io/api/core/v1"
"sigs.k8s.io/gateway-api/apis/v1alpha2"
"sigs.k8s.io/gateway-api/apis/v1beta1"

egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/envoyproxy/gateway/internal/ir"
)

type XdsIRMap map[string]*ir.Xds
Expand Down
3 changes: 2 additions & 1 deletion internal/gatewayapi/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"fmt"
"strings"

"github.com/envoyproxy/gateway/internal/ir"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/gateway-api/apis/v1alpha2"
"sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/envoyproxy/gateway/internal/ir"
)

var _ RoutesTranslator = (*Translator)(nil)
Expand Down
3 changes: 2 additions & 1 deletion internal/provider/kubernetes/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"testing"
"time"

"github.com/envoyproxy/gateway/api/config/v1alpha1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/envoyproxy/gateway/api/config/v1alpha1"
)

func TestGatewaysOfClass(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/kubernetes/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
package test

import (
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1"

egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/envoyproxy/gateway/internal/gatewayapi"
"k8s.io/apimachinery/pkg/types"
)

type ObjectKindNamespacedName struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/status/conditions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import (
"testing"
"time"

"github.com/envoyproxy/gateway/internal/gatewayapi"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilclock "k8s.io/utils/clock"
fakeclock "k8s.io/utils/clock/testing"
gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/envoyproxy/gateway/internal/gatewayapi"
)

var clock utilclock.Clock = utilclock.RealClock{}
Expand Down
14 changes: 7 additions & 7 deletions internal/xds/server/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ import (
"os"
"strconv"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"github.com/envoyproxy/gateway/internal/envoygateway/config"
"github.com/envoyproxy/gateway/internal/message"
"github.com/envoyproxy/gateway/internal/xds/cache"
xdstypes "github.com/envoyproxy/gateway/internal/xds/types"
controlplane_service_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/service/cluster/v3"
controlplane_service_discovery_v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
controlplane_service_endpoint_v3 "github.com/envoyproxy/go-control-plane/envoy/service/endpoint/v3"
Expand All @@ -30,6 +23,13 @@ import (
controlplane_service_runtime_v3 "github.com/envoyproxy/go-control-plane/envoy/service/runtime/v3"
controlplane_service_secret_v3 "github.com/envoyproxy/go-control-plane/envoy/service/secret/v3"
controlplane_server_v3 "github.com/envoyproxy/go-control-plane/pkg/server/v3"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"github.com/envoyproxy/gateway/internal/envoygateway/config"
"github.com/envoyproxy/gateway/internal/message"
"github.com/envoyproxy/gateway/internal/xds/cache"
xdstypes "github.com/envoyproxy/gateway/internal/xds/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/translator/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"testing"
"time"

resourcev3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/stretchr/testify/require"

"github.com/envoyproxy/gateway/internal/envoygateway/config"
"github.com/envoyproxy/gateway/internal/ir"
"github.com/envoyproxy/gateway/internal/message"
resourcev3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
)

func TestRunner(t *testing.T) {
Expand Down
20 changes: 19 additions & 1 deletion tools/linter/golangci-lint/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,35 @@ linters:
- revive
- gosec
- misspell
- scopelint
- exportloopref
- unconvert
- unparam
- goheader
- gocritic

linters-settings:
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/envoyproxy/gateway/) # Groups all imports with the specified Prefix.
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/envoyproxy/gateway/
gofmt:
simplify: true
unparam:
check-exported: false
goheader:
# Note that because the format is different (this needs no comment markers),
# updating this text means also updating /tools/boilerplate.txt so that
# `make generate` will update the generated files correctly.
template: |-
Copyright Envoy Gateway Authors
SPDX-License-Identifier: Apache-2.0
The full text of the Apache license is available in the LICENSE file at
the root of the repo.

issues:
exclude-rules:
Expand Down