From 79bc3997feab040acdb973a3ec5f464d9286fcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 22 Nov 2025 18:04:39 -0500 Subject: [PATCH] appease the linter --- build_tools/swagger/main.go | 4 +++- models/migrations/v1_26/v324.go | 3 +++ routers/api/v1/api.go | 7 +++---- routers/api/v1/repo/pull.go | 1 - 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build_tools/swagger/main.go b/build_tools/swagger/main.go index 24b4c42dab..1c32b4c28c 100644 --- a/build_tools/swagger/main.go +++ b/build_tools/swagger/main.go @@ -1,3 +1,5 @@ +// Copyright 2025 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT //go:generate go run main.go ../../ package main @@ -61,7 +63,7 @@ func generatePaths(root string) map[string]any { } func writeMapToFile(filename string, data map[string]any) { - bytes, err := json.MarshalIndent(data, "", "\t") + bytes, err := json.MarshalIndent(data, "", " ") if err != nil { log.Fatal(err) } diff --git a/models/migrations/v1_26/v324.go b/models/migrations/v1_26/v324.go index b70de1901b..b327157ed5 100644 --- a/models/migrations/v1_26/v324.go +++ b/models/migrations/v1_26/v324.go @@ -1,3 +1,6 @@ +// Copyright 2025 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + package v1_26 import "xorm.io/xorm" diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 2e42456e25..2158ccab5f 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -140,14 +140,13 @@ func repoAssignment() func(ctx *context.APIContext) { userName := ctx.PathParam("username") repoName := ctx.PathParam("reponame") var gid int64 - group := ctx.PathParam("group_id") - if group != "" { - gid, _ = strconv.ParseInt(group, 10, 64) + groupParam := ctx.PathParam("group_id") + if groupParam != "" { + gid, _ = strconv.ParseInt(groupParam, 10, 64) if gid == 0 { ctx.Redirect(strings.Replace(ctx.Req.URL.RequestURI(), "/0/", "/", 1), 307) return } - group += "/" } var ( owner *user_model.User diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 6ca3e255ae..80e22c95bc 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -265,7 +265,6 @@ func GetPullRequestByBaseHead(ctx *context.APIContext) { } else { owner, name = split[0], split[1] } - } else { owner = split[0] gid = ctx.Repo.Repository.GroupID