chore: update golangci-lint to v2.13.0

Migrate the deprecated gofumpt `extra-rules` to `extra.group-params`, as
the alias now also enables the new `clothe-returns` and `balance-calls`
rules. Disable SA4023, which hangs on go 1.27, see
https://github.com/golangci/golangci-lint/issues/6732.

Apply the resulting modernize fixes, mostly flattening embedded struct
literals and switching errors.As to errors.AsType.

Assisted-by: Claude:Opus 5
This commit is contained in:
silverwind
2026-08-20 06:21:34 +02:00
parent b227ad8a5f
commit bef127f188
173 changed files with 1161 additions and 1659 deletions
+8 -16
View File
@@ -134,10 +134,8 @@ func BlockUser(ctx context.Context, doer, blocker, blockee *user_model.User, not
func unstarRepos(ctx context.Context, starrer, repoOwner *user_model.User) error {
opts := &repo_model.StarredReposOptions{
ListOptions: db.ListOptions{
Page: 1,
PageSize: 25,
},
Page: 1,
PageSize: 25,
StarrerID: starrer.ID,
RepoOwnerID: repoOwner.ID,
}
@@ -164,10 +162,8 @@ func unstarRepos(ctx context.Context, starrer, repoOwner *user_model.User) error
func unwatchRepos(ctx context.Context, watcher, repoOwner *user_model.User) error {
opts := &repo_model.WatchedReposOptions{
ListOptions: db.ListOptions{
Page: 1,
PageSize: 25,
},
Page: 1,
PageSize: 25,
WatcherID: watcher.ID,
RepoOwnerID: repoOwner.ID,
}
@@ -212,10 +208,8 @@ func cancelRepositoryTransfers(ctx context.Context, doer, sender, recipient *use
func unassignIssues(ctx context.Context, assignee, repoOwner *user_model.User) error {
opts := &issues_model.AssignedIssuesOptions{
ListOptions: db.ListOptions{
Page: 1,
PageSize: 25,
},
Page: 1,
PageSize: 25,
AssigneeID: assignee.ID,
RepoOwnerID: repoOwner.ID,
}
@@ -246,10 +240,8 @@ func unassignIssues(ctx context.Context, assignee, repoOwner *user_model.User) e
func removeCollaborations(ctx context.Context, repoOwner, collaborator *user_model.User) error {
opts := &repo_model.FindCollaborationOptions{
ListOptions: db.ListOptions{
Page: 1,
PageSize: 25,
},
Page: 1,
PageSize: 25,
CollaboratorID: collaborator.ID,
RepoOwnerID: repoOwner.ID,
}
+2 -4
View File
@@ -171,10 +171,8 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error {
// but such a function would likely get out of date
for {
orgs, err := db.Find[organization.Organization](ctx, organization.FindOrgOptions{
ListOptions: db.ListOptions{
PageSize: repo_model.RepositoryListDefaultPageSize,
Page: 1,
},
PageSize: repo_model.RepositoryListDefaultPageSize,
Page: 1,
UserID: u.ID,
IncludeVisibility: structs.VisibleTypePrivate,
})