Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱Evaludate and Apply Latest Lint Rules and Features #3866

Merged
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
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ linters-settings:
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
arguments:
# dot import should be ONLY allowed for ginkgo testing packages
allowedPackages:
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
- name: error-return
- name: error-strings
- name: error-naming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"fmt"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"os/exec"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"tutorial.kubebuilder.io/project/test/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os/exec"
"strings"

// nolint:revive
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ import (
"testing"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
admissionv1 "k8s.io/api/admission/v1"

admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ import (
"reflect"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ import (

ctrl "sigs.k8s.io/controller-runtime"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"k8s.io/client-go/kubernetes/scheme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"fmt"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"os/exec"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"tutorial.kubebuilder.io/project/test/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os/exec"
"strings"

// nolint:revive
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import (
"time"

//nolint:golint
// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import (
"runtime"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"k8s.io/client-go/kubernetes/scheme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"fmt"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"os/exec"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"example.com/memcached/test/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os/exec"
"strings"

// nolint:revive
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import (
"testing"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

admissionv1 "k8s.io/api/admission/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import (
"testing"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

admissionv1 "k8s.io/api/admission/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import (

ctrl "sigs.k8s.io/controller-runtime"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"k8s.io/client-go/kubernetes/scheme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"fmt"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"os/exec"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"tutorial.kubebuilder.io/project/test/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os/exec"
"strings"

// nolint:revive
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ import (
"reflect"
"time"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import (
"os"
"strings"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
"github.com/spf13/afero"
"github.com/spf13/cobra"
Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ limitations under the License.
package cli

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import (
"path/filepath"
"runtime"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
"github.com/spf13/afero"
"github.com/spf13/cobra"
Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ limitations under the License.
package cli

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package cli
import (
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/config"
Expand Down
2 changes: 0 additions & 2 deletions pkg/cli/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ limitations under the License.
package cli

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package config
import (
"fmt"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ limitations under the License.
package config

import (
// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/store/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"fmt"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/store/yaml/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"os"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
"github.com/spf13/afero"

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package config
import (
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/v2/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ package v2
import (
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/v3/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"sort"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/config"
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package config
import (
"sort"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/v3/pkg/model/stage"
Expand Down
2 changes: 0 additions & 2 deletions pkg/internal/validation/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"strings"
"testing"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/machinery/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"errors"
"path/filepath"

// nolint:revive
. "github.com/onsi/ginkgo/v2"
// nolint:revive
. "github.com/onsi/gomega"
)

Expand Down
Loading