mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-19 10:24:51 +02:00
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:
@@ -41,11 +41,11 @@ func Organizations(ctx *context.Context) {
|
||||
sortOrderDefault := util.Iif(supportedSortOrders.Contains(setting.UI.ExploreDefaultSort), setting.UI.ExploreDefaultSort, "newest")
|
||||
sortOrder := ctx.FormString("sort", sortOrderDefault)
|
||||
RenderUserSearch(ctx, user_model.SearchUserOptions{
|
||||
Actor: ctx.Doer,
|
||||
Types: []user_model.UserType{user_model.UserTypeOrganization},
|
||||
ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum},
|
||||
Visible: visibleTypes,
|
||||
OrderBy: db.SearchOrderBy(sortOrder),
|
||||
Actor: ctx.Doer,
|
||||
Types: []user_model.UserType{user_model.UserTypeOrganization},
|
||||
PageSize: setting.UI.ExplorePagingNum,
|
||||
Visible: visibleTypes,
|
||||
OrderBy: db.SearchOrderBy(sortOrder),
|
||||
|
||||
SupportedSortOrders: supportedSortOrders,
|
||||
}, tplExploreUsers)
|
||||
|
||||
@@ -95,10 +95,8 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
|
||||
ctx.Data["IsPrivate"] = private
|
||||
|
||||
repos, count, err = repo_model.SearchRepository(ctx, repo_model.SearchRepoOptions{
|
||||
ListOptions: db.ListOptions{
|
||||
Page: page,
|
||||
PageSize: opts.PageSize,
|
||||
},
|
||||
Page: page,
|
||||
PageSize: opts.PageSize,
|
||||
Actor: ctx.Doer,
|
||||
OrderBy: orderBy,
|
||||
Private: opts.Private,
|
||||
|
||||
@@ -16,11 +16,9 @@ import (
|
||||
// TopicSearch search for creating topic
|
||||
func TopicSearch(ctx *context.Context) {
|
||||
opts := &repo_model.FindTopicOptions{
|
||||
Keyword: ctx.FormString("q"),
|
||||
ListOptions: db.ListOptions{
|
||||
Page: ctx.FormInt("page"),
|
||||
PageSize: convert.ToCorrectPageSize(ctx.FormInt("limit")),
|
||||
},
|
||||
Keyword: ctx.FormString("q"),
|
||||
Page: ctx.FormInt("page"),
|
||||
PageSize: convert.ToCorrectPageSize(ctx.FormInt("limit")),
|
||||
}
|
||||
|
||||
topics, total, err := db.FindAndCount[repo_model.Topic](ctx, opts)
|
||||
|
||||
@@ -144,12 +144,12 @@ func Users(ctx *context.Context) {
|
||||
sortOrderDefault := util.Iif(supportedSortOrders.Contains(setting.UI.ExploreDefaultSort), setting.UI.ExploreDefaultSort, "newest")
|
||||
sortOrder := ctx.FormString("sort", sortOrderDefault)
|
||||
RenderUserSearch(ctx, user_model.SearchUserOptions{
|
||||
Actor: ctx.Doer,
|
||||
Types: []user_model.UserType{user_model.UserTypeIndividual},
|
||||
ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum},
|
||||
IsActive: optional.Some(true),
|
||||
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate},
|
||||
OrderBy: db.SearchOrderBy(sortOrder),
|
||||
Actor: ctx.Doer,
|
||||
Types: []user_model.UserType{user_model.UserTypeIndividual},
|
||||
PageSize: setting.UI.ExplorePagingNum,
|
||||
IsActive: optional.Some(true),
|
||||
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate},
|
||||
OrderBy: db.SearchOrderBy(sortOrder),
|
||||
|
||||
SupportedSortOrders: supportedSortOrders,
|
||||
}, tplExploreUsers)
|
||||
|
||||
Reference in New Issue
Block a user