loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.60.1 (forgejo)' (#4953) from renovate/forgejo-github.com-golangci-golangci-lint-cmd-golangci-lint-1.x into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4953
Reviewed-by: Gusted <gusted@noreply.codeberg.org>

+65 -70
+1 -1
Makefile
··· 29 29 AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go 30 30 EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.0.3 # renovate: datasource=go 31 31 GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0 # renovate: datasource=go 32 - GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1 # renovate: datasource=go 32 + GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 # renovate: datasource=go 33 33 GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go 34 34 MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.6.0 # renovate: datasource=go 35 35 SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
+2 -2
cmd/hook.go
··· 535 535 536 536 index := bytes.IndexByte(rs.Data, byte(0)) 537 537 if index >= len(rs.Data) { 538 - return fail(ctx, "Protocol: format error", "pkt-line: format error "+fmt.Sprint(rs.Data)) 538 + return fail(ctx, "Protocol: format error", "pkt-line: format error %s", rs.Data) 539 539 } 540 540 541 541 if index < 0 { 542 542 if len(rs.Data) == 10 && rs.Data[9] == '\n' { 543 543 index = 9 544 544 } else { 545 - return fail(ctx, "Protocol: format error", "pkt-line: format error "+fmt.Sprint(rs.Data)) 545 + return fail(ctx, "Protocol: format error", "pkt-line: format error %s", rs.Data) 546 546 } 547 547 } 548 548
+1 -1
cmd/hook_test.go
··· 117 117 defer test.MockVariableValue(&setting.InternalToken, "Random")() 118 118 defer test.MockVariableValue(&setting.InstallLock, true)() 119 119 defer test.MockVariableValue(&setting.Git.VerbosePush, true)() 120 - require.NoError(t, os.Setenv("SSH_ORIGINAL_COMMAND", "true")) 120 + t.Setenv("SSH_ORIGINAL_COMMAND", "true") 121 121 122 122 // Setup the Stdin. 123 123 f, err := os.OpenFile(t.TempDir()+"/stdin", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o666)
+1 -2
models/activities/user_heatmap_test.go
··· 4 4 package activities_test 5 5 6 6 import ( 7 - "fmt" 8 7 "testing" 9 8 "time" 10 9 ··· 92 91 require.NoError(t, err) 93 92 assert.Len(t, actions, contributions, "invalid action count: did the test data became too old?") 94 93 assert.Equal(t, count, int64(contributions)) 95 - assert.Equal(t, tc.CountResult, contributions, fmt.Sprintf("testcase '%s'", tc.desc)) 94 + assert.Equal(t, tc.CountResult, contributions, tc.desc) 96 95 97 96 // Test JSON rendering 98 97 jsonData, err := json.Marshal(heatmap)
+2 -2
models/asymkey/gpg_key_common.go
··· 114 114 return nil, err 115 115 } 116 116 if block.Type != openpgp.SignatureType { 117 - return nil, fmt.Errorf("expected '" + openpgp.SignatureType + "', got: " + block.Type) 117 + return nil, fmt.Errorf("expected %q, got: %s", openpgp.SignatureType, block.Type) 118 118 } 119 119 return block.Body, nil 120 120 } ··· 139 139 if sig.IssuerKeyId != nil && (*sig.IssuerKeyId) != 0 { 140 140 return fmt.Sprintf("%016X", *sig.IssuerKeyId) 141 141 } 142 - if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) > 0 { 142 + if len(sig.IssuerFingerprint) > 0 { 143 143 return fmt.Sprintf("%016X", sig.IssuerFingerprint[12:20]) 144 144 } 145 145 return ""
+1 -1
models/auth/oauth2_test.go
··· 22 22 app := unittest.AssertExistsAndLoadBean(t, &auth_model.OAuth2Application{ID: 1}) 23 23 secret, err := app.GenerateClientSecret(db.DefaultContext) 24 24 require.NoError(t, err) 25 - assert.Positive(t, len(secret)) 25 + assert.NotEmpty(t, secret) 26 26 unittest.AssertExistsAndLoadBean(t, &auth_model.OAuth2Application{ID: 1, ClientSecret: app.ClientSecret}) 27 27 } 28 28
+1 -10
models/git/protected_branch_test.go
··· 4 4 package git 5 5 6 6 import ( 7 - "fmt" 8 7 "testing" 9 8 10 9 "github.com/stretchr/testify/assert" ··· 65 64 66 65 for _, kase := range kases { 67 66 pb := ProtectedBranch{RuleName: kase.Rule} 68 - var should, infact string 69 - if !kase.ExpectedMatch { 70 - should = " not" 71 - } else { 72 - infact = " not" 73 - } 74 - assert.EqualValues(t, kase.ExpectedMatch, pb.Match(kase.BranchName), 75 - fmt.Sprintf("%s should%s match %s but it is%s", kase.BranchName, should, kase.Rule, infact), 76 - ) 67 + assert.EqualValues(t, kase.ExpectedMatch, pb.Match(kase.BranchName), "%s - %s", kase.BranchName, kase.Rule) 77 68 } 78 69 }
+1 -1
models/migrations/v1_16/v189.go
··· 83 83 if err != nil { 84 84 return fmt.Errorf("failed to unmarshal %s: %w", source.Cfg, err) 85 85 } 86 - if wrapped.Source != nil && len(wrapped.Source) > 0 { 86 + if len(wrapped.Source) > 0 { 87 87 bs, err := json.Marshal(wrapped.Source) 88 88 if err != nil { 89 89 return err
+4 -4
models/migrations/v1_16/v193_test.go
··· 57 57 err := x.Table("attachment").Where("issue_id > 0").Find(&issueAttachments) 58 58 require.NoError(t, err) 59 59 for _, attach := range issueAttachments { 60 - assert.Greater(t, attach.RepoID, int64(0)) 61 - assert.Greater(t, attach.IssueID, int64(0)) 60 + assert.Positive(t, attach.RepoID) 61 + assert.Positive(t, attach.IssueID) 62 62 var issue Issue 63 63 has, err := x.ID(attach.IssueID).Get(&issue) 64 64 require.NoError(t, err) ··· 70 70 err = x.Table("attachment").Where("release_id > 0").Find(&releaseAttachments) 71 71 require.NoError(t, err) 72 72 for _, attach := range releaseAttachments { 73 - assert.Greater(t, attach.RepoID, int64(0)) 74 - assert.Greater(t, attach.ReleaseID, int64(0)) 73 + assert.Positive(t, attach.RepoID) 74 + assert.Positive(t, attach.ReleaseID) 75 75 var release Release 76 76 has, err := x.ID(attach.ReleaseID).Get(&release) 77 77 require.NoError(t, err)
+1 -1
models/repo/repo_list.go
··· 743 743 cond = cond.And(builder.Eq{"is_private": false}) 744 744 } 745 745 746 - if opts.LowerNames != nil && len(opts.LowerNames) > 0 { 746 + if len(opts.LowerNames) > 0 { 747 747 cond = cond.And(builder.In("lower_name", opts.LowerNames)) 748 748 } 749 749
+1 -1
models/user/user_test.go
··· 598 598 {ID: 2, Visibility: structs.VisibleTypePrivate}: true, 599 599 } 600 600 for kase, expected := range kases { 601 - assert.EqualValues(t, expected, nil == user_model.ValidateUser(kase), fmt.Sprintf("case: %+v", kase)) 601 + assert.EqualValues(t, expected, nil == user_model.ValidateUser(kase)) 602 602 } 603 603 } 604 604
+3 -1
modules/cache/context.go
··· 73 73 return timeNow().Sub(cc.created) > cacheContextLifetime 74 74 } 75 75 76 - var cacheContextKey = struct{}{} 76 + type cacheContextType = struct{ useless struct{} } 77 + 78 + var cacheContextKey = cacheContextType{useless: struct{}{}} 77 79 78 80 /* 79 81 Since there are both WithCacheContext and WithNoCacheContext,
+1 -1
modules/git/log_name_status.go
··· 114 114 // Next returns the next LogStatusCommitData 115 115 func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int, changed []bool, maxpathlen int) (*LogNameStatusCommitData, error) { 116 116 var err error 117 - if g.next == nil || len(g.next) == 0 { 117 + if len(g.next) == 0 { 118 118 g.buffull = false 119 119 g.next, err = g.rd.ReadSlice('\x00') 120 120 if err != nil {
+1 -1
modules/issue/template/template.go
··· 401 401 } 402 402 403 403 func (f *valuedField) Value() string { 404 - return strings.TrimSpace(f.Get(fmt.Sprintf("form-field-" + f.ID))) 404 + return strings.TrimSpace(f.Get("form-field-" + f.ID)) 405 405 } 406 406 407 407 func (f *valuedField) Options() []*valuedOption {
+8 -8
modules/packages/arch/metadata.go
··· 258 258 } 259 259 for _, cd := range p.VersionMetadata.CheckDepends { 260 260 if !rePkgVer.MatchString(cd) { 261 - return util.NewInvalidArgumentErrorf("invalid check dependency: " + cd) 261 + return util.NewInvalidArgumentErrorf("invalid check dependency: %s", cd) 262 262 } 263 263 } 264 264 for _, d := range p.VersionMetadata.Depends { 265 265 if !rePkgVer.MatchString(d) { 266 - return util.NewInvalidArgumentErrorf("invalid dependency: " + d) 266 + return util.NewInvalidArgumentErrorf("invalid dependency: %s", d) 267 267 } 268 268 } 269 269 for _, md := range p.VersionMetadata.MakeDepends { 270 270 if !rePkgVer.MatchString(md) { 271 - return util.NewInvalidArgumentErrorf("invalid make dependency: " + md) 271 + return util.NewInvalidArgumentErrorf("invalid make dependency: %s", md) 272 272 } 273 273 } 274 274 for _, p := range p.VersionMetadata.Provides { 275 275 if !rePkgVer.MatchString(p) { 276 - return util.NewInvalidArgumentErrorf("invalid provides: " + p) 276 + return util.NewInvalidArgumentErrorf("invalid provides: %s", p) 277 277 } 278 278 } 279 279 for _, p := range p.VersionMetadata.Conflicts { 280 280 if !rePkgVer.MatchString(p) { 281 - return util.NewInvalidArgumentErrorf("invalid conflicts: " + p) 281 + return util.NewInvalidArgumentErrorf("invalid conflicts: %s", p) 282 282 } 283 283 } 284 284 for _, p := range p.VersionMetadata.Replaces { 285 285 if !rePkgVer.MatchString(p) { 286 - return util.NewInvalidArgumentErrorf("invalid replaces: " + p) 286 + return util.NewInvalidArgumentErrorf("invalid replaces: %s", p) 287 287 } 288 288 } 289 289 for _, p := range p.VersionMetadata.Replaces { 290 290 if !rePkgVer.MatchString(p) { 291 - return util.NewInvalidArgumentErrorf("invalid xdata: " + p) 291 + return util.NewInvalidArgumentErrorf("invalid xdata: %s", p) 292 292 } 293 293 } 294 294 for _, od := range p.VersionMetadata.OptDepends { 295 295 if !reOptDep.MatchString(od) { 296 - return util.NewInvalidArgumentErrorf("invalid optional dependency: " + od) 296 + return util.NewInvalidArgumentErrorf("invalid optional dependency: %s", od) 297 297 } 298 298 } 299 299 for _, bf := range p.VersionMetadata.Backup {
+1 -1
modules/queue/base_channel.go
··· 120 120 q.mu.Lock() 121 121 defer q.mu.Unlock() 122 122 123 - for q.c != nil && len(q.c) > 0 { 123 + for len(q.c) > 0 { 124 124 <-q.c 125 125 } 126 126
+2 -2
modules/queue/workerqueue_test.go
··· 173 173 174 174 q2() // restart the queue to continue to execute the tasks in it 175 175 176 - assert.NotZero(t, len(tasksQ1)) 177 - assert.NotZero(t, len(tasksQ2)) 176 + assert.NotEmpty(t, tasksQ1) 177 + assert.NotEmpty(t, tasksQ2) 178 178 assert.EqualValues(t, testCount, len(tasksQ1)+len(tasksQ2)) 179 179 } 180 180
+1 -1
routers/api/v1/repo/pull.go
··· 752 752 // update allow edits 753 753 if form.AllowMaintainerEdit != nil { 754 754 if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, *form.AllowMaintainerEdit); err != nil { 755 - if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) { 755 + if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) { 756 756 ctx.Error(http.StatusForbidden, "SetAllowEdits", fmt.Sprintf("SetAllowEdits: %s", err)) 757 757 return 758 758 }
+1 -1
routers/web/repo/pull.go
··· 1821 1821 } 1822 1822 1823 1823 if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, form.AllowMaintainerEdit); err != nil { 1824 - if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) { 1824 + if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) { 1825 1825 ctx.Error(http.StatusForbidden) 1826 1826 return 1827 1827 }
+3 -2
routers/web/repo/view.go
··· 8 8 "bytes" 9 9 gocontext "context" 10 10 "encoding/base64" 11 + "errors" 11 12 "fmt" 12 13 "html/template" 13 14 "image" ··· 753 754 } 754 755 755 756 if firstUnit != nil { 756 - ctx.Redirect(fmt.Sprintf("%s%s", ctx.Repo.Repository.Link(), firstUnit.URI)) 757 + ctx.Redirect(ctx.Repo.Repository.Link() + firstUnit.URI) 757 758 return 758 759 } 759 760 } 760 761 761 - ctx.NotFound("Home", fmt.Errorf(ctx.Locale.TrString("units.error.no_unit_allowed_repo"))) 762 + ctx.NotFound("Home", errors.New(ctx.Locale.TrString("units.error.no_unit_allowed_repo"))) 762 763 } 763 764 764 765 func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
+1 -1
routers/web/user/home.go
··· 761 761 } 762 762 // check view permissions 763 763 if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) { 764 - ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name)) 764 + ctx.NotFound("User not visible", nil) 765 765 return false 766 766 } 767 767 return true
+1 -1
routers/web/user/profile.go
··· 56 56 func userProfile(ctx *context.Context) { 57 57 // check view permissions 58 58 if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) { 59 - ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name)) 59 + ctx.NotFound("User not visible", nil) 60 60 return 61 61 } 62 62
+3 -1
services/actions/notifier_helper.go
··· 34 34 "github.com/nektos/act/pkg/model" 35 35 ) 36 36 37 - var methodCtxKey struct{} 37 + type methodCtx struct{} 38 + 39 + var methodCtxKey = methodCtx{} 38 40 39 41 // withMethod sets the notification method that this context currently executes. 40 42 // Used for debugging/ troubleshooting purposes.
+1 -1
services/automerge/automerge.go
··· 276 276 } 277 277 278 278 if err := pull_service.CheckPullMergeable(ctx, doer, &perm, pr, pull_service.MergeCheckTypeGeneral, false); err != nil { 279 - if errors.Is(pull_service.ErrUserNotAllowedToMerge, err) { 279 + if errors.Is(err, pull_service.ErrUserNotAllowedToMerge) { 280 280 log.Info("%-v was scheduled to automerge by an unauthorized user", pr) 281 281 return 282 282 }
+2 -3
services/gitdiff/gitdiff_test.go
··· 5 5 package gitdiff 6 6 7 7 import ( 8 - "fmt" 9 8 "strconv" 10 9 "strings" 11 10 "testing" ··· 645 644 MaxFiles: setting.Git.MaxGitDiffFiles, 646 645 WhitespaceBehavior: behavior, 647 646 }) 648 - require.NoError(t, err, fmt.Sprintf("Error when diff with %s", behavior)) 647 + require.NoError(t, err, "Error when diff with %s", behavior) 649 648 for _, f := range diffs.Files { 650 - assert.Positive(t, len(f.Sections), fmt.Sprintf("%s should have sections", f.Name)) 649 + assert.NotEmpty(t, f.Sections, "%s should have sections", f.Name) 651 650 } 652 651 } 653 652 }
+1 -1
services/release/release_test.go
··· 289 289 IsTag: false, 290 290 } 291 291 require.NoError(t, CreateRelease(gitRepo, release, "", []*AttachmentChange{})) 292 - assert.Greater(t, release.ID, int64(0)) 292 + assert.Positive(t, release.ID) 293 293 294 294 release.IsDraft = false 295 295 tagName := release.TagName
+1 -1
tests/integration/api_issue_stopwatch_test.go
··· 40 40 assert.EqualValues(t, issue.Title, apiWatches[0].IssueTitle) 41 41 assert.EqualValues(t, repo.Name, apiWatches[0].RepoName) 42 42 assert.EqualValues(t, repo.OwnerName, apiWatches[0].RepoOwnerName) 43 - assert.Greater(t, apiWatches[0].Seconds, int64(0)) 43 + assert.Positive(t, apiWatches[0].Seconds) 44 44 } 45 45 } 46 46
+7 -6
tests/integration/api_push_mirror_test.go
··· 5 5 6 6 import ( 7 7 "context" 8 + "errors" 8 9 "fmt" 9 10 "net/http" 10 11 "net/url" ··· 52 53 remoteAddress := fmt.Sprintf("%s%s/%s", u.String(), url.PathEscape(user.Name), url.PathEscape(mirrorRepo.Name)) 53 54 54 55 deletePushMirrors := repo_model.DeletePushMirrors 55 - deletePushMirrorsError := "deletePushMirrorsError" 56 + deletePushMirrorsError := errors.New("deletePushMirrorsError") 56 57 deletePushMirrorsFail := func(ctx context.Context, opts repo_model.PushMirrorOptions) error { 57 - return fmt.Errorf(deletePushMirrorsError) 58 + return deletePushMirrorsError 58 59 } 59 60 60 61 addPushMirrorRemote := mirror_service.AddPushMirrorRemote 61 - addPushMirrorRemoteError := "addPushMirrorRemoteError" 62 + addPushMirrorRemoteError := errors.New("addPushMirrorRemoteError") 62 63 addPushMirrorRemoteFail := func(ctx context.Context, m *repo_model.PushMirror, addr string) error { 63 - return fmt.Errorf(addPushMirrorRemoteError) 64 + return addPushMirrorRemoteError 64 65 } 65 66 66 67 for _, testCase := range []struct { ··· 81 82 }, 82 83 { 83 84 name: "fail to add and delete", 84 - message: deletePushMirrorsError, 85 + message: deletePushMirrorsError.Error(), 85 86 status: http.StatusInternalServerError, 86 87 mirrorCount: 1, 87 88 setup: func() { ··· 91 92 }, 92 93 { 93 94 name: "fail to add", 94 - message: addPushMirrorRemoteError, 95 + message: addPushMirrorRemoteError.Error(), 95 96 status: http.StatusInternalServerError, 96 97 mirrorCount: 0, 97 98 setup: func() {
+3 -3
tests/integration/api_releases_test.go
··· 266 266 createNewReleaseUsingAPI(t, token, owner, repo, "release-tag", "", "Release Tag", "test") 267 267 268 268 // delete release 269 - req := NewRequestf(t, http.MethodDelete, fmt.Sprintf("/api/v1/repos/%s/%s/releases/tags/release-tag", owner.Name, repo.Name)). 269 + req := NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/%s/releases/tags/release-tag", owner.Name, repo.Name). 270 270 AddTokenAuth(token) 271 271 _ = MakeRequest(t, req, http.StatusNoContent) 272 272 273 273 // make sure release is deleted 274 - req = NewRequestf(t, http.MethodDelete, fmt.Sprintf("/api/v1/repos/%s/%s/releases/tags/release-tag", owner.Name, repo.Name)). 274 + req = NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/%s/releases/tags/release-tag", owner.Name, repo.Name). 275 275 AddTokenAuth(token) 276 276 _ = MakeRequest(t, req, http.StatusNotFound) 277 277 278 278 // delete release tag too 279 - req = NewRequestf(t, http.MethodDelete, fmt.Sprintf("/api/v1/repos/%s/%s/tags/release-tag", owner.Name, repo.Name)). 279 + req = NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/%s/tags/release-tag", owner.Name, repo.Name). 280 280 AddTokenAuth(token) 281 281 _ = MakeRequest(t, req, http.StatusNoContent) 282 282 }
+1 -1
tests/integration/api_repo_teams_test.go
··· 39 39 if assert.Len(t, teams, 2) { 40 40 assert.EqualValues(t, "Owners", teams[0].Name) 41 41 assert.True(t, teams[0].CanCreateOrgRepo) 42 - assert.True(t, util.SliceSortedEqual(unit.AllUnitKeyNames(), teams[0].Units), fmt.Sprintf("%v == %v", unit.AllUnitKeyNames(), teams[0].Units)) 42 + assert.True(t, util.SliceSortedEqual(unit.AllUnitKeyNames(), teams[0].Units)) 43 43 assert.EqualValues(t, "owner", teams[0].Permission) 44 44 45 45 assert.EqualValues(t, "test_team", teams[1].Name)
+3 -3
tests/integration/html_helper.go
··· 42 42 t.Helper() 43 43 44 44 dropdownGroup := doc.Find(fmt.Sprintf(".dropdown:has(input[name='%s'])", name)) 45 - assert.Equal(t, 1, dropdownGroup.Length(), fmt.Sprintf("%s dropdown does not exist", name)) 45 + assert.Equal(t, 1, dropdownGroup.Length(), "%s dropdown does not exist", name) 46 46 return dropdownGroup 47 47 } 48 48 ··· 60 60 dropdownGroup := doc.AssertDropdown(t, dropdownName) 61 61 62 62 selectedValue, _ := dropdownGroup.Find(fmt.Sprintf("input[name='%s']", dropdownName)).Attr("value") 63 - assert.Equal(t, expectedValue, selectedValue, fmt.Sprintf("%s dropdown doesn't have expected value selected", dropdownName)) 63 + assert.Equal(t, expectedValue, selectedValue, "%s dropdown doesn't have expected value selected", dropdownName) 64 64 65 65 dropdownValues := dropdownGroup.Find(".menu [data-value]").Map(func(i int, s *goquery.Selection) string { 66 66 value, _ := s.Attr("data-value") 67 67 return value 68 68 }) 69 - assert.Contains(t, dropdownValues, expectedValue, fmt.Sprintf("%s dropdown doesn't have an option with expected value", dropdownName)) 69 + assert.Contains(t, dropdownValues, expectedValue, "%s dropdown doesn't have an option with expected value", dropdownName) 70 70 } 71 71 72 72 // Find gets the descendants of each element in the current set of
+1 -1
tests/integration/migrate_test.go
··· 83 83 {svc: structs.ForgejoService}, 84 84 } { 85 85 // Step 0: verify the repo is available 86 - req := NewRequestf(t, "GET", fmt.Sprintf("/%s/%s", ownerName, repoName)) 86 + req := NewRequestf(t, "GET", "/%s/%s", ownerName, repoName) 87 87 _ = session.MakeRequest(t, req, http.StatusOK) 88 88 // Step 1: get the Gitea migration form 89 89 req = NewRequestf(t, "GET", "/repo/migrate/?service_type=%d", s.svc)
+1 -1
tests/integration/repo_fork_test.go
··· 45 45 link, exists := htmlDoc.doc.Find(fmt.Sprintf("form.ui.form[action=\"%s\"]", forkURL)).Attr("action") 46 46 assert.True(t, exists, "The template has changed") 47 47 _, exists = htmlDoc.doc.Find(fmt.Sprintf(".owner.dropdown .item[data-value=\"%d\"]", forkOwner.ID)).Attr("data-value") 48 - assert.True(t, exists, fmt.Sprintf("Fork owner '%s' is not present in select box", forkOwnerName)) 48 + assert.True(t, exists, "Fork owner %q is not present in select box", forkOwnerName) 49 49 req = NewRequestWithValues(t, "POST", link, map[string]string{ 50 50 "_csrf": htmlDoc.GetCSRF(), 51 51 "uid": fmt.Sprintf("%d", forkOwner.ID),
+1 -1
tests/integration/repo_test.go
··· 444 444 repoSummary := htmlDoc.doc.Find(".repository-summary") 445 445 446 446 repoFilesTable := htmlDoc.doc.Find("#repo-files-table") 447 - assert.NotZero(t, len(repoFilesTable.Nodes)) 447 + assert.NotEmpty(t, repoFilesTable.Nodes) 448 448 449 449 assert.Zero(t, description.Length()) 450 450 assert.Zero(t, repoTopics.Length())
+1 -1
tests/integration/user_test.go
··· 291 291 assert.EqualValues(t, issue.Title, apiWatches[0].IssueTitle) 292 292 assert.EqualValues(t, repo.Name, apiWatches[0].RepoName) 293 293 assert.EqualValues(t, repo.OwnerName, apiWatches[0].RepoOwnerName) 294 - assert.Greater(t, apiWatches[0].Seconds, int64(0)) 294 + assert.Positive(t, apiWatches[0].Seconds) 295 295 } 296 296 } 297 297