Skip to content

Commit 001ead8

Browse files
silverwindStelios Malathouras
authored and
Stelios Malathouras
committed
Lock gofumpt to v0.3.0 and run it (go-gitea#18866)
We can't depend on `latest` version of gofumpt because the output will not be stable across versions. Lock it down to the latest version released yesterday and run it again.
1 parent daf6f54 commit 001ead8

File tree

15 files changed

+30
-17
lines changed

15 files changed

+30
-17
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ clean:
235235
.PHONY: fmt
236236
fmt:
237237
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
238-
$(GO) install mvdan.cc/gofumpt@latest; \
238+
$(GO) install mvdan.cc/gofumpt@v0.3.0; \
239239
fi
240240
@echo "Running gitea-fmt (with gofumpt)..."
241241
@$(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
@@ -287,7 +287,7 @@ errcheck:
287287
.PHONY: fmt-check
288288
fmt-check:
289289
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
290-
$(GO) install mvdan.cc/gofumpt@latest; \
290+
$(GO) install mvdan.cc/gofumpt@0.3.0; \
291291
fi
292292
# get all go files and run gitea-fmt (with gofmt) on them
293293
@diff=$$($(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \

models/issue_xref.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ func (issue *Issue) updateCrossReferenceList(list []*crossReference, xref *cross
195195

196196
// verifyReferencedIssue will check if the referenced issue exists, and whether the doer has permission to do what
197197
func (issue *Issue) verifyReferencedIssue(stdCtx context.Context, ctx *crossReferencesContext, repo *repo_model.Repository,
198-
ref references.IssueReference) (*Issue, references.XRefAction, error) {
198+
ref references.IssueReference,
199+
) (*Issue, references.XRefAction, error) {
199200
refIssue := &Issue{RepoID: repo.ID, Index: ref.Index}
200201
refAction := ref.Action
201202
e := db.GetEngine(stdCtx)

models/migrations/v210.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"strings"
1212

1313
"code.gitea.io/gitea/modules/timeutil"
14-
"github.com/tstranex/u2f"
1514

15+
"github.com/tstranex/u2f"
1616
"xorm.io/xorm"
1717
"xorm.io/xorm/schemas"
1818
)

models/migrations/v210_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"testing"
99

1010
"code.gitea.io/gitea/modules/timeutil"
11+
1112
"github.com/stretchr/testify/assert"
1213
"xorm.io/xorm/schemas"
1314
)

modules/indexer/code/bleve.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ func NewBleveIndexer(indexDir string) (*BleveIndexer, bool, error) {
182182
}
183183

184184
func (b *BleveIndexer) addUpdate(ctx context.Context, batchWriter git.WriteCloserError, batchReader *bufio.Reader, commitSha string,
185-
update fileUpdate, repo *repo_model.Repository, batch *gitea_bleve.FlushingBatch) error {
185+
update fileUpdate, repo *repo_model.Repository, batch *gitea_bleve.FlushingBatch,
186+
) error {
186187
// Ignore vendored files in code search
187188
if setting.Indexer.ExcludeVendored && analyze.IsVendor(update.Filename) {
188189
return nil

modules/notification/action/action.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ func (a *actionNotifier) NotifyIssueChangeStatus(doer *user_model.User, issue *m
9191

9292
// NotifyCreateIssueComment notifies comment on an issue to notifiers
9393
func (a *actionNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
94-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
94+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
95+
) {
9596
act := &models.Action{
9697
ActUserID: doer.ID,
9798
ActUser: doer,

modules/notification/indexer/indexer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ func NewNotifier() base.Notifier {
3030
}
3131

3232
func (r *indexerNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
33-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
33+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
34+
) {
3435
if comment.Type == models.CommentTypeComment {
3536
if issue.Comments == nil {
3637
if err := issue.LoadDiscussComments(); err != nil {

modules/notification/mail/mail.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ func NewNotifier() base.Notifier {
2929
}
3030

3131
func (m *mailNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
32-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
32+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
33+
) {
3334
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("mailNotifier.NotifyCreateIssueComment Issue[%d] #%d in [%d]", issue.ID, issue.Index, issue.RepoID))
3435
defer finished()
3536

modules/notification/notification.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func NewContext() {
3939

4040
// NotifyCreateIssueComment notifies issue comment related message to notifiers
4141
func NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
42-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
42+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
43+
) {
4344
for _, notifier := range notifiers {
4445
notifier.NotifyCreateIssueComment(doer, repo, issue, comment, mentions)
4546
}
@@ -201,7 +202,8 @@ func NotifyIssueChangeRef(doer *user_model.User, issue *models.Issue, oldRef str
201202

202203
// NotifyIssueChangeLabels notifies change labels to notifiers
203204
func NotifyIssueChangeLabels(doer *user_model.User, issue *models.Issue,
204-
addedLabels, removedLabels []*models.Label) {
205+
addedLabels, removedLabels []*models.Label,
206+
) {
205207
for _, notifier := range notifiers {
206208
notifier.NotifyIssueChangeLabels(doer, issue, addedLabels, removedLabels)
207209
}

modules/notification/ui/ui.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ func (ns *notificationService) Run() {
5353
}
5454

5555
func (ns *notificationService) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
56-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
56+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
57+
) {
5758
opts := issueNotificationOpts{
5859
IssueID: issue.ID,
5960
NotificationAuthorID: doer.ID,

modules/notification/webhook/webhook.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ func (m *webhookNotifier) NotifyUpdateComment(doer *user_model.User, c *models.C
424424
}
425425

426426
func (m *webhookNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
427-
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
427+
issue *models.Issue, comment *models.Comment, mentions []*user_model.User,
428+
) {
428429
mode, _ := models.AccessLevel(doer, repo)
429430

430431
var err error
@@ -498,7 +499,8 @@ func (m *webhookNotifier) NotifyDeleteComment(doer *user_model.User, comment *mo
498499
}
499500

500501
func (m *webhookNotifier) NotifyIssueChangeLabels(doer *user_model.User, issue *models.Issue,
501-
addedLabels, removedLabels []*models.Label) {
502+
addedLabels, removedLabels []*models.Label,
503+
) {
502504
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("webhook.NotifyIssueChangeLabels User: %s[%d] Issue[%d] #%d in [%d]", doer.Name, doer.ID, issue.ID, issue.Index, issue.RepoID))
503505
defer finished()
504506

modules/structs/repo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ type GenerateRepoOption struct {
220220
// CreateBranchRepoOption options when creating a branch in a repository
221221
// swagger:model
222222
type CreateBranchRepoOption struct {
223-
224223
// Name of the branch to create
225224
//
226225
// required: true

routers/web/repo/branch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ func loadBranches(ctx *context.Context, skip, limit int) (*Branch, []*Branch, in
233233

234234
func loadOneBranch(ctx *context.Context, rawBranch, defaultBranch *git.Branch, protectedBranches []*models.ProtectedBranch,
235235
repoIDToRepo map[int64]*repo_model.Repository,
236-
repoIDToGitRepo map[int64]*git.Repository) *Branch {
236+
repoIDToGitRepo map[int64]*git.Repository,
237+
) *Branch {
237238
log.Trace("loadOneBranch: '%s'", rawBranch.Name)
238239

239240
commit, err := rawBranch.GetCommit()

services/mailer/mail.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ func SendIssueAssignedMail(issue *models.Issue, doer *user_model.User, content s
427427
// actionToTemplate returns the type and name of the action facing the user
428428
// (slightly different from models.ActionType) and the name of the template to use (based on availability)
429429
func actionToTemplate(issue *models.Issue, actionType models.ActionType,
430-
commentType models.CommentType, reviewType models.ReviewType) (typeName, name, template string) {
430+
commentType models.CommentType, reviewType models.ReviewType,
431+
) (typeName, name, template string) {
431432
if issue.IsPull {
432433
typeName = "pull"
433434
} else {

services/release/release.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ func CreateNewTag(ctx context.Context, doer *user_model.User, repo *repo_model.R
186186
// delAttachmentUUIDs accept a slice of attachments' uuids which will be deleted from the release
187187
// editAttachments accept a map of attachment uuid to new attachment name which will be updated with attachments.
188188
func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *models.Release,
189-
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string) (err error) {
189+
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string,
190+
) (err error) {
190191
if rel.ID == 0 {
191192
return errors.New("UpdateRelease only accepts an exist release")
192193
}

0 commit comments

Comments
 (0)