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

KUBESAW-250: Updating GolangCiLint to v1.63.1 #1092

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.1
skip-pkg-cache: true
skip-build-cache: true
args: --config=./.golangci.yml --verbose
Expand Down
4 changes: 2 additions & 2 deletions setup/metrics/queries/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ type BaseQuery struct {
resultType ResultType
}

func (b BaseQuery) Name() string {
func (b *BaseQuery) Name() string {
return b.name
}

func (b *BaseQuery) Execute() (model.Value, prometheus.Warnings, error) {
return b.apiClient.Query(context.TODO(), b.query, time.Now())
}

func (b BaseQuery) ResultType() string {
func (b *BaseQuery) ResultType() string {
return string(b.resultType)
}

Expand Down
10 changes: 5 additions & 5 deletions setup/terminal/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type DefaultTerminal struct {
}

// Debugf prints a message (if verbose was enabled)
func (t DefaultTerminal) Debugf(msg string, args ...interface{}) {
func (t *DefaultTerminal) Debugf(msg string, args ...interface{}) {
if !t.verbose {
return
}
Expand All @@ -66,7 +66,7 @@ func (t DefaultTerminal) Debugf(msg string, args ...interface{}) {
}

// Infof displays a message with the default color
func (t DefaultTerminal) Infof(msg string, args ...interface{}) {
func (t *DefaultTerminal) Infof(msg string, args ...interface{}) {
if msg == "" {
fmt.Fprintln(t.OutOrStdout(), "")
return
Expand All @@ -75,12 +75,12 @@ func (t DefaultTerminal) Infof(msg string, args ...interface{}) {
}

// Errorf prints a message with the red color
func (t DefaultTerminal) Errorf(err error, msg string, args ...interface{}) {
func (t *DefaultTerminal) Errorf(err error, msg string, args ...interface{}) {
color.New(color.FgRed).Fprintln(t.OutOrStdout(), fmt.Sprintf("%s: %s", fmt.Sprintf(msg, args...), err.Error())) // nolint:errcheck
}

// Fatalf prints a message with the red color and exits the program with a `1` return code
func (t DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
func (t *DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
defer os.Exit(1)
for _, hook := range t.fatalExitHooks {
hook()
Expand All @@ -89,7 +89,7 @@ func (t DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
}

// PromptBoolf prints a message and waits for the user's boolean response
func (t DefaultTerminal) PromptBoolf(msg string, args ...interface{}) bool {
func (t *DefaultTerminal) PromptBoolf(msg string, args ...interface{}) bool {
fmt.Fprintln(t.OutOrStdout(), fmt.Sprintf(msg, args...))
t.InOrStdin()

Expand Down
11 changes: 7 additions & 4 deletions test/e2e/space_autocompletion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/codeready-toolchain/toolchain-e2e/testsupport/spaceprovisionerconfig"
"github.com/codeready-toolchain/toolchain-e2e/testsupport/util"
"github.com/codeready-toolchain/toolchain-e2e/testsupport/wait"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -117,9 +116,11 @@ func TestAutomaticClusterAssignment(t *testing.T) {
require.NoError(t, err)
for _, m := range toolchainStatus.Status.Members {
if memberAwait1.ClusterName == m.ClusterName {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait1.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait1.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount))) //nolint:gosec
} else if memberAwait2.ClusterName == m.ClusterName {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait2.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount+1)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait2.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount+1))) //nolint:gosec
}
}

Expand All @@ -131,8 +132,10 @@ func TestAutomaticClusterAssignment(t *testing.T) {

t.Run("after both members marking as full then the new space won't be provisioned", func(t *testing.T) {
// given

for _, m := range toolchainStatus.Status.Members {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, m.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, m.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount))) //nolint:gosec
}

// when
Expand Down
Loading
Loading