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
|
@ -36,7 +36,7 @@ func TestArchive_Basic(t *testing.T) {
|
|||
bogusReq, err := NewRequest(ctx, ctx.Repo.Repository.ID, ctx.Repo.GitRepo, firstCommit, git.ZIP)
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, bogusReq)
|
||||
assert.EqualValues(t, firstCommit+".zip", bogusReq.GetArchiveName())
|
||||
assert.Equal(t, firstCommit+".zip", bogusReq.GetArchiveName())
|
||||
|
||||
// Check a series of bogus requests.
|
||||
// Step 1, valid commit with a bad extension.
|
||||
|
@ -57,12 +57,12 @@ func TestArchive_Basic(t *testing.T) {
|
|||
bogusReq, err = NewRequest(ctx, ctx.Repo.Repository.ID, ctx.Repo.GitRepo, "master", git.ZIP)
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, bogusReq)
|
||||
assert.EqualValues(t, "master.zip", bogusReq.GetArchiveName())
|
||||
assert.Equal(t, "master.zip", bogusReq.GetArchiveName())
|
||||
|
||||
bogusReq, err = NewRequest(ctx, ctx.Repo.Repository.ID, ctx.Repo.GitRepo, "test/archive", git.ZIP)
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, bogusReq)
|
||||
assert.EqualValues(t, "test-archive.zip", bogusReq.GetArchiveName())
|
||||
assert.Equal(t, "test-archive.zip", bogusReq.GetArchiveName())
|
||||
|
||||
// Now two valid requests, firstCommit with valid extensions.
|
||||
zipReq, err := NewRequest(ctx, ctx.Repo.Repository.ID, ctx.Repo.GitRepo, firstCommit, git.ZIP)
|
||||
|
|
|
@ -60,7 +60,7 @@ func TestDeleteAvatar(t *testing.T) {
|
|||
err = DeleteAvatar(db.DefaultContext, repo)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "", repo.Avatar)
|
||||
assert.Empty(t, repo.Avatar)
|
||||
}
|
||||
|
||||
func TestTemplateGenerateAvatar(t *testing.T) {
|
||||
|
|
|
@ -53,14 +53,14 @@ func TestRepository_ContributorsGraph(t *testing.T) {
|
|||
keys = append(keys, k)
|
||||
}
|
||||
slices.Sort(keys)
|
||||
assert.EqualValues(t, []string{
|
||||
assert.Equal(t, []string{
|
||||
"ethantkoenig@gmail.com",
|
||||
"jimmy.praet@telenet.be",
|
||||
"jon@allspice.io",
|
||||
"total", // generated summary
|
||||
}, keys)
|
||||
|
||||
assert.EqualValues(t, &ContributorData{
|
||||
assert.Equal(t, &ContributorData{
|
||||
Name: "Ethan Koenig",
|
||||
AvatarLink: "/assets/img/avatar_default.png",
|
||||
TotalCommits: 1,
|
||||
|
@ -73,7 +73,7 @@ func TestRepository_ContributorsGraph(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}, data["ethantkoenig@gmail.com"])
|
||||
assert.EqualValues(t, &ContributorData{
|
||||
assert.Equal(t, &ContributorData{
|
||||
Name: "Total",
|
||||
AvatarLink: "",
|
||||
TotalCommits: 3,
|
||||
|
|
|
@ -64,13 +64,13 @@ func TestGetContents(t *testing.T) {
|
|||
|
||||
t.Run("Get README.md contents with GetContents(ctx, )", func(t *testing.T) {
|
||||
fileContentResponse, err := GetContents(db.DefaultContext, repo, treePath, ref, false)
|
||||
assert.EqualValues(t, expectedContentsResponse, fileContentResponse)
|
||||
assert.Equal(t, expectedContentsResponse, fileContentResponse)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("Get README.md contents with ref as empty string (should then use the repo's default branch) with GetContents(ctx, )", func(t *testing.T) {
|
||||
fileContentResponse, err := GetContents(db.DefaultContext, repo, treePath, "", false)
|
||||
assert.EqualValues(t, expectedContentsResponse, fileContentResponse)
|
||||
assert.Equal(t, expectedContentsResponse, fileContentResponse)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ func TestGetDiffPreview(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
bs, err := json.Marshal(diff)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, string(expectedBs), string(bs))
|
||||
assert.Equal(t, string(expectedBs), string(bs))
|
||||
})
|
||||
|
||||
t.Run("empty branch, same results", func(t *testing.T) {
|
||||
|
@ -134,7 +134,7 @@ func TestGetDiffPreview(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
bs, err := json.Marshal(diff)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, expectedBs, bs)
|
||||
assert.Equal(t, expectedBs, bs)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ func TestCleanUploadFileName(t *testing.T) {
|
|||
name := "this/is/test"
|
||||
cleanName := CleanUploadFileName(name)
|
||||
expectedCleanName := name
|
||||
assert.EqualValues(t, expectedCleanName, cleanName)
|
||||
assert.Equal(t, expectedCleanName, cleanName)
|
||||
})
|
||||
|
||||
t.Run("Clean a .git path", func(t *testing.T) {
|
||||
name := "this/is/test/.git"
|
||||
cleanName := CleanUploadFileName(name)
|
||||
expectedCleanName := ""
|
||||
assert.EqualValues(t, expectedCleanName, cleanName)
|
||||
assert.Equal(t, expectedCleanName, cleanName)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -48,5 +48,5 @@ func TestGetTreeBySHA(t *testing.T) {
|
|||
TotalCount: 1,
|
||||
}
|
||||
|
||||
assert.EqualValues(t, expectedTree, tree)
|
||||
assert.Equal(t, expectedTree, tree)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func GarbageCollectLFSMetaObjectsForRepo(ctx context.Context, repo *repo_model.R
|
|||
|
||||
err = git_model.IterateLFSMetaObjectsForRepo(ctx, repo.ID, func(ctx context.Context, metaObject *git_model.LFSMetaObject) error {
|
||||
total++
|
||||
pointerSha := git.ComputeBlobHash(objectFormat, []byte(metaObject.Pointer.StringContent()))
|
||||
pointerSha := git.ComputeBlobHash(objectFormat, []byte(metaObject.StringContent()))
|
||||
|
||||
if gitRepo.IsObjectExist(pointerSha.String()) {
|
||||
return git_model.MarkLFSMetaObject(ctx, metaObject.ID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue