Skip to content

Commit

Permalink
chore(deps): update module github.com/golangci/golangci-lint to v1.62…
Browse files Browse the repository at this point in the history
….0 (#20737)

* chore(deps): update module github.com/golangci/golangci-lint to v1.62.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix lint issues

Signed-off-by: Michael Crenshaw <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <[email protected]>
  • Loading branch information
renovate[bot] and crenshaw-dev authored Nov 11, 2024
1 parent 4a66a2a commit b39f3b1
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
# renovate: datasource=go packageName=github.com/golangci/golangci-lint versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
version: v1.61.0
version: v1.62.0
args: --verbose

test-go:
Expand Down
2 changes: 1 addition & 1 deletion applicationset/generators/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ func TestPluginGenerateParams(t *testing.T) {
require.NoError(t, err)
gotJson, err := json.Marshal(got)
require.NoError(t, err)
assert.Equal(t, string(expectedJson), string(gotJson))
assert.JSONEq(t, string(expectedJson), string(gotJson))
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion applicationset/utils/createOrUpdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ spec:
require.NoError(t, err)
yamlExpected, err := yaml.Marshal(tc.expectedApp)
require.NoError(t, err)
assert.Equal(t, string(yamlExpected), string(yamlFound))
assert.YAMLEq(t, string(yamlExpected), string(yamlFound))
})
}
}
12 changes: 6 additions & 6 deletions cmd/argocd/commands/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ func Test_PrintResource(t *testing.T) {
return err
})
require.NoError(t, err)
assert.Equal(t, expectYamlSingle, str)
assert.YAMLEq(t, expectYamlSingle, str)

str, err = captureOutput(func() error {
err := PrintResource(testResource, "json")
return err
})
require.NoError(t, err)
assert.Equal(t, expectJsonSingle, str)
assert.JSONEq(t, expectJsonSingle, str)

err = PrintResource(testResource, "unknown")
require.Error(t, err)
Expand Down Expand Up @@ -116,28 +116,28 @@ func Test_PrintResourceList(t *testing.T) {
return err
})
require.NoError(t, err)
assert.Equal(t, expectYamlList, str)
assert.YAMLEq(t, expectYamlList, str)

str, err = captureOutput(func() error {
err := PrintResourceList(testResource, "json", false)
return err
})
require.NoError(t, err)
assert.Equal(t, expectJsonList, str)
assert.JSONEq(t, expectJsonList, str)

str, err = captureOutput(func() error {
err := PrintResourceList(testResource2, "yaml", true)
return err
})
require.NoError(t, err)
assert.Equal(t, expectYamlSingle, str)
assert.YAMLEq(t, expectYamlSingle, str)

str, err = captureOutput(func() error {
err := PrintResourceList(testResource2, "json", true)
return err
})
require.NoError(t, err)
assert.Equal(t, expectJsonSingle, str)
assert.JSONEq(t, expectJsonSingle, str)

err = PrintResourceList(testResource, "unknown", false)
require.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion controller/appcontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ func TestHelmValuesObjectHasReplaceStrategy(t *testing.T) {
app,
appModified)
require.NoError(t, err)
assert.Equal(t, `{"status":{"sync":{"comparedTo":{"source":{"helm":{"valuesObject":{"key":["value-modified1"]}}}}}}}`, string(patch))
assert.JSONEq(t, `{"status":{"sync":{"comparedTo":{"source":{"helm":{"valuesObject":{"key":["value-modified1"]}}}}}}}`, string(patch))
}

func TestAppStatusIsReplaced(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion hack/installers/install-lint-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -eux -o pipefail

# renovate: datasource=go packageName=github.com/golangci/golangci-lint
GOLANGCI_LINT_VERSION=1.61.0
GOLANGCI_LINT_VERSION=1.62.0

GO111MODULE=on go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}"
2 changes: 2 additions & 0 deletions pkg/apis/application/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3923,6 +3923,7 @@ func TestOptionalArrayEquality(t *testing.T) {
err := json.Unmarshal([]byte(presentButEmpty), &param)
require.NoError(t, err)
jsonPresentButEmpty := param.OptionalArray
// nolint:testifylint
require.Equal(t, &OptionalArray{Array: []string{}}, jsonPresentButEmpty)

// We won't simulate the protobuf unmarshalling of an empty array parameter. By experimentation, this is how it's
Expand Down Expand Up @@ -3966,6 +3967,7 @@ func TestOptionalMapEquality(t *testing.T) {
err := json.Unmarshal([]byte(presentButEmpty), &param)
require.NoError(t, err)
jsonPresentButEmpty := param.OptionalMap
// nolint:testifylint
require.Equal(t, &OptionalMap{Map: map[string]string{}}, jsonPresentButEmpty)

// We won't simulate the protobuf unmarshalling of an empty map parameter. By experimentation, this is how it's
Expand Down
2 changes: 1 addition & 1 deletion server/application/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ func TestSplitStatusPatch(t *testing.T) {
otherFields := `{"operation":{"eee":"fff"},"spec":{"aaa":"bbb"},"status":{"ccc":"ddd"}}`
nonStatus, status, err := splitStatusPatch([]byte(otherFields))
require.NoError(t, err)
assert.Equal(t, `{"operation":{"eee":"fff"},"spec":{"aaa":"bbb"}}`, string(nonStatus))
assert.JSONEq(t, `{"operation":{"eee":"fff"},"spec":{"aaa":"bbb"}}`, string(nonStatus))
assert.Equal(t, statusPatch, string(status))
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func TestPatchValuesObject(t *testing.T) {
Expect(NoConditions()).
And(func(app *Application) {
// Check that the patch was a success.
assert.Equal(t, `{"some":{"foo":"bar","new":"field"}}`, string(app.Spec.Source.Helm.ValuesObject.Raw))
assert.JSONEq(t, `{"some":{"foo":"bar","new":"field"}}`, string(app.Spec.Source.Helm.ValuesObject.Raw))
})
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixture/project/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ func (a *Actions) runCli(args ...string) {
a.context.t.Helper()
a.lastOutput, a.lastError = fixture.RunCli(args...)
if !a.ignoreErrors {
require.Empty(a.context.t, a.lastError)
require.NoError(a.context.t, a.lastError)
}
}
2 changes: 2 additions & 0 deletions util/argo/diff/ignore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestIgnoreDiffConfig_HasIgnoreDifference(t *testing.T) {
assert.True(t, ok)
assert.NotNil(t, actual)
assert.Equal(t, expectedManagedFields, actual.ManagedFieldsManagers)
// nolint:testifylint
assert.Equal(t, expectedJSONPointers, actual.JSONPointers)
assert.Equal(t, expectedJQExpression, actual.JQPathExpressions)
})
Expand All @@ -72,6 +73,7 @@ func TestIgnoreDiffConfig_HasIgnoreDifference(t *testing.T) {
assert.True(t, ok)
assert.NotNil(t, actual)
assert.Equal(t, expectedManagedFields, actual.ManagedFieldsManagers)
// nolint:testifylint
assert.Equal(t, expectedJSONPointers, actual.JSONPointers)
assert.Equal(t, expectedJQExpression, actual.JQPathExpressions)
})
Expand Down
4 changes: 2 additions & 2 deletions util/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ func TestRun(t *testing.T) {

func TestHideUsernamePassword(t *testing.T) {
_, err := RunWithRedactor(exec.Command("helm registry login https://charts.bitnami.com/bitnami", "--username", "foo", "--password", "bar"), nil)
assert.NotEmpty(t, err)
require.Error(t, err)

redactor := func(text string) string {
return regexp.MustCompile("(--username|--password) [^ ]*").ReplaceAllString(text, "$1 ******")
}
_, err = RunWithRedactor(exec.Command("helm registry login https://charts.bitnami.com/bitnami", "--username", "foo", "--password", "bar"), redactor)
assert.NotEmpty(t, err)
require.Error(t, err)
}

func TestRunWithExecRunOpts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion util/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestIDTokenClaims(t *testing.T) {
values, err := url.ParseQuery(authCodeURL.RawQuery)
require.NoError(t, err)

assert.Equal(t, "{\"id_token\":{\"groups\":{\"essential\":true}}}", values.Get("claims"))
assert.JSONEq(t, "{\"id_token\":{\"groups\":{\"essential\":true}}}", values.Get("claims"))
}

type fakeProvider struct{}
Expand Down
4 changes: 2 additions & 2 deletions util/settings/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestAddAccount_AccountAdded(t *testing.T) {

assert.Equal(t, "hash", string(secret.Data["accounts.test.password"]))
assert.Equal(t, mTime.Format(time.RFC3339), string(secret.Data["accounts.test.passwordMtime"]))
assert.Equal(t, `[{"id":"123","iat":0}]`, string(secret.Data["accounts.test.tokens"]))
assert.JSONEq(t, `[{"id":"123","iat":0}]`, string(secret.Data["accounts.test.tokens"]))
}

func TestAddAccount_AlreadyExists(t *testing.T) {
Expand Down Expand Up @@ -204,7 +204,7 @@ func TestUpdateAccount_SuccessfullyUpdated(t *testing.T) {

assert.Equal(t, "hash", string(secret.Data["accounts.test.password"]))
assert.Equal(t, mTime.Format(time.RFC3339), string(secret.Data["accounts.test.passwordMtime"]))
assert.Equal(t, `[{"id":"123","iat":0}]`, string(secret.Data["accounts.test.tokens"]))
assert.JSONEq(t, `[{"id":"123","iat":0}]`, string(secret.Data["accounts.test.tokens"]))
}

func TestUpdateAccount_UpdateAdminPassword(t *testing.T) {
Expand Down

0 comments on commit b39f3b1

Please sign in to comment.