Replace custom Go formatter with golangci-lint fmt (#37194)

Use `golangci-lint fmt` to format code, replacing the previous custom
formatter tool. https://github.com/daixiang0/gci is used to order the
imports.

`make fmt` performs ~13% faster while consuming ~57% less cpu while
formatting for me.

`GOFUMPT_PACKAGE` is gone because it's using the builtin package from
golangci-lint.

Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-04-17 19:45:22 +02:00
committed by GitHub
parent 279bf84066
commit a9108ab6aa
23 changed files with 82 additions and 664 deletions

View File

@@ -11,15 +11,14 @@ import (
"image/color"
"image/png"
_ "image/gif" // for processing gif images
_ "image/jpeg" // for processing jpeg images
"code.gitea.io/gitea/modules/avatar/identicon"
"code.gitea.io/gitea/modules/setting"
"golang.org/x/image/draw"
_ "golang.org/x/image/webp" // for processing webp images
_ "image/gif" // for processing gif images
_ "image/jpeg" // for processing jpeg images
"golang.org/x/image/draw"
)
// DefaultAvatarSize is the target CSS pixel size for avatar generation. It is

View File

@@ -1,5 +1,6 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
//go:build windows

View File

@@ -12,10 +12,10 @@ import (
"path"
"sync"
_ "embed"
"code.gitea.io/gitea/modules/assetfs"
_ "embed"
"github.com/santhosh-tekuri/jsonschema/v6"
)

View File

@@ -10,9 +10,9 @@ package options
import (
"sync"
_ "embed"
"code.gitea.io/gitea/modules/assetfs"
_ "embed"
)
//go:embed bindata.dat

View File

@@ -1,18 +1,6 @@
// Copyright 2013 Beego Authors
// Copyright 2014 The Macaron Authors
// Copyright 2020 The Gitea Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
// SPDX-License-Identifier: Apache-2.0
package session

View File

@@ -10,9 +10,9 @@ package templates
import (
"sync"
_ "embed"
"code.gitea.io/gitea/modules/assetfs"
_ "embed"
)
//go:embed bindata.dat