mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 18:05:19 +02:00
Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
parent
51ff4970ec
commit
fed2d81c44
427 changed files with 2043 additions and 2046 deletions
|
@ -21,7 +21,7 @@ func TestMigrations(t *testing.T) {
|
|||
|
||||
assert.EqualValues(t, 71, migrationIDNumberToDBVersion(70))
|
||||
|
||||
assert.EqualValues(t, []*migration{{idNumber: 70}, {idNumber: 71}}, getPendingMigrations(70, preparedMigrations))
|
||||
assert.EqualValues(t, []*migration{{idNumber: 71}}, getPendingMigrations(71, preparedMigrations))
|
||||
assert.EqualValues(t, []*migration{}, getPendingMigrations(72, preparedMigrations))
|
||||
assert.Equal(t, []*migration{{idNumber: 70}, {idNumber: 71}}, getPendingMigrations(70, preparedMigrations))
|
||||
assert.Equal(t, []*migration{{idNumber: 71}}, getPendingMigrations(71, preparedMigrations))
|
||||
assert.Equal(t, []*migration{}, getPendingMigrations(72, preparedMigrations))
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ func Test_AddPrimaryEmail2EmailAddress(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
assert.True(t, has)
|
||||
assert.True(t, emailAddress.IsPrimary)
|
||||
assert.EqualValues(t, user.IsActive, emailAddress.IsActivated)
|
||||
assert.EqualValues(t, user.ID, emailAddress.UID)
|
||||
assert.Equal(t, user.IsActive, emailAddress.IsActivated)
|
||||
assert.Equal(t, user.ID, emailAddress.UID)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,8 +76,8 @@ func Test_UnwrapLDAPSourceCfg(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
assert.EqualValues(t, expected, converted, "UnwrapLDAPSourceCfg failed for %d", source.ID)
|
||||
assert.EqualValues(t, source.ID%2 == 0, source.IsActive, "UnwrapLDAPSourceCfg failed for %d", source.ID)
|
||||
assert.Equal(t, expected, converted, "UnwrapLDAPSourceCfg failed for %d", source.ID)
|
||||
assert.Equal(t, source.ID%2 == 0, source.IsActive, "UnwrapLDAPSourceCfg failed for %d", source.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ func Test_AddRepoIDForAttachment(t *testing.T) {
|
|||
has, err := x.ID(attach.IssueID).Get(&issue)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, has)
|
||||
assert.EqualValues(t, attach.RepoID, issue.RepoID)
|
||||
assert.Equal(t, attach.RepoID, issue.RepoID)
|
||||
}
|
||||
|
||||
var releaseAttachments []*NewAttachment
|
||||
|
@ -76,6 +76,6 @@ func Test_AddRepoIDForAttachment(t *testing.T) {
|
|||
has, err := x.ID(attach.ReleaseID).Get(&release)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, has)
|
||||
assert.EqualValues(t, attach.RepoID, release.RepoID)
|
||||
assert.Equal(t, attach.RepoID, release.RepoID)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,5 +84,5 @@ func Test_RemigrateU2FCredentials(t *testing.T) {
|
|||
err = x.Table("webauthn_credential").Select("id, credential_id").Asc("id").Find(&got)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, expected, got)
|
||||
assert.Equal(t, expected, got)
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ func Test_AddHeaderAuthorizationEncryptedColWebhook(t *testing.T) {
|
|||
assert.Equal(t, e.Meta, got[i].Meta)
|
||||
|
||||
if e.HeaderAuthorization == "" {
|
||||
assert.Equal(t, "", got[i].HeaderAuthorizationEncrypted)
|
||||
assert.Empty(t, got[i].HeaderAuthorizationEncrypted)
|
||||
} else {
|
||||
cipherhex := got[i].HeaderAuthorizationEncrypted
|
||||
cleartext, err := secret.DecryptSecret(setting.SecretKey, cipherhex)
|
||||
|
|
|
@ -97,7 +97,7 @@ func Test_ConvertScopedAccessTokens(t *testing.T) {
|
|||
tokens := make([]AccessToken, 0)
|
||||
err = x.Find(&tokens)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, len(tests), len(tokens))
|
||||
assert.Len(t, tokens, len(tests))
|
||||
|
||||
// sort the tokens (insertion order by auto-incrementing primary key)
|
||||
sort.Slice(tokens, func(i, j int) bool {
|
||||
|
|
|
@ -109,11 +109,11 @@ func Test_RepositoryFormat(t *testing.T) {
|
|||
ok, err := x.ID(2).Get(repo)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, "sha1", repo.ObjectFormatName)
|
||||
assert.Equal(t, "sha1", repo.ObjectFormatName)
|
||||
|
||||
repo = new(Repository)
|
||||
ok, err = x.ID(id).Get(repo)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, "sha256", repo.ObjectFormatName)
|
||||
assert.Equal(t, "sha256", repo.ObjectFormatName)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue