mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
parent
51ff4970ec
commit
fed2d81c44
427 changed files with 2043 additions and 2046 deletions
|
|
@ -237,7 +237,7 @@ func TestOpenProjectPayload(t *testing.T) {
|
|||
assert.Equal(t, 12, j.Get("number").MustBeValid().ToInt())
|
||||
assert.Equal(t, "http://localhost:3000/test/repo/pulls/12", j.Get("html_url").MustBeValid().ToString())
|
||||
assert.Equal(t, jsoniter.NilValue, j.Get("updated_at").ValueType())
|
||||
assert.Equal(t, "", j.Get("state").MustBeValid().ToString())
|
||||
assert.Empty(t, j.Get("state").MustBeValid().ToString())
|
||||
assert.Equal(t, "Fix bug", j.Get("title").MustBeValid().ToString())
|
||||
assert.Equal(t, "fixes bug #2", j.Get("body").MustBeValid().ToString())
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ func TestWebhookDeliverHookTask(t *testing.T) {
|
|||
case "/webhook/66d222a5d6349e1311f551e50722d837e30fce98":
|
||||
// Version 1
|
||||
assert.Equal(t, "push", r.Header.Get("X-GitHub-Event"))
|
||||
assert.Equal(t, "", r.Header.Get("Content-Type"))
|
||||
assert.Empty(t, r.Header.Get("Content-Type"))
|
||||
body, err := io.ReadAll(r.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, `{"data": 42}`, string(body))
|
||||
|
|
|
|||
|
|
@ -37,11 +37,12 @@ func getPullRequestInfo(p *api.PullRequestPayload) (title, link, by, operator, o
|
|||
for i, user := range assignList {
|
||||
assignStringList[i] = user.UserName
|
||||
}
|
||||
if p.Action == api.HookIssueAssigned {
|
||||
switch p.Action {
|
||||
case api.HookIssueAssigned:
|
||||
operateResult = fmt.Sprintf("%s assign this to %s", p.Sender.UserName, assignList[len(assignList)-1].UserName)
|
||||
} else if p.Action == api.HookIssueUnassigned {
|
||||
case api.HookIssueUnassigned:
|
||||
operateResult = fmt.Sprintf("%s unassigned this for someone", p.Sender.UserName)
|
||||
} else if p.Action == api.HookIssueMilestoned {
|
||||
case api.HookIssueMilestoned:
|
||||
operateResult = fmt.Sprintf("%s/milestone/%d", p.Repository.HTMLURL, p.PullRequest.Milestone.ID)
|
||||
}
|
||||
link = p.PullRequest.HTMLURL
|
||||
|
|
@ -62,11 +63,12 @@ func getIssuesInfo(p *api.IssuePayload) (issueTitle, link, by, operator, operate
|
|||
for i, user := range assignList {
|
||||
assignStringList[i] = user.UserName
|
||||
}
|
||||
if p.Action == api.HookIssueAssigned {
|
||||
switch p.Action {
|
||||
case api.HookIssueAssigned:
|
||||
operateResult = fmt.Sprintf("%s assign this to %s", p.Sender.UserName, assignList[len(assignList)-1].UserName)
|
||||
} else if p.Action == api.HookIssueUnassigned {
|
||||
case api.HookIssueUnassigned:
|
||||
operateResult = fmt.Sprintf("%s unassigned this for someone", p.Sender.UserName)
|
||||
} else if p.Action == api.HookIssueMilestoned {
|
||||
case api.HookIssueMilestoned:
|
||||
operateResult = fmt.Sprintf("%s/milestone/%d", p.Repository.HTMLURL, p.Issue.Milestone.ID)
|
||||
}
|
||||
link = p.Issue.HTMLURL
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ func TestMSTeamsPayload(t *testing.T) {
|
|||
assert.Equal(t, "[test/repo] New wiki page 'index' (Wiki change comment)", pl.Summary)
|
||||
assert.Len(t, pl.Sections, 1)
|
||||
assert.Equal(t, "user1", pl.Sections[0].ActivitySubtitle)
|
||||
assert.Equal(t, "", pl.Sections[0].Text)
|
||||
assert.Empty(t, pl.Sections[0].Text)
|
||||
assert.Len(t, pl.Sections[0].Facts, 2)
|
||||
for _, fact := range pl.Sections[0].Facts {
|
||||
if fact.Name == "Repository:" {
|
||||
|
|
@ -356,7 +356,7 @@ func TestMSTeamsPayload(t *testing.T) {
|
|||
assert.Equal(t, "[test/repo] Wiki page 'index' edited (Wiki change comment)", pl.Summary)
|
||||
assert.Len(t, pl.Sections, 1)
|
||||
assert.Equal(t, "user1", pl.Sections[0].ActivitySubtitle)
|
||||
assert.Equal(t, "", pl.Sections[0].Text)
|
||||
assert.Empty(t, pl.Sections[0].Text)
|
||||
assert.Len(t, pl.Sections[0].Facts, 2)
|
||||
for _, fact := range pl.Sections[0].Facts {
|
||||
if fact.Name == "Repository:" {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ func TestSyncPushCommits(t *testing.T) {
|
|||
var payloadContent structs.PushPayload
|
||||
require.NoError(t, json.Unmarshal([]byte(hookTask.PayloadContent), &payloadContent))
|
||||
assert.Len(t, payloadContent.Commits, 1)
|
||||
assert.EqualValues(t, "2c54faec6c45d31c1abfaecdab471eac6633738a", payloadContent.Commits[0].ID)
|
||||
assert.Equal(t, "2c54faec6c45d31c1abfaecdab471eac6633738a", payloadContent.Commits[0].ID)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +129,6 @@ func TestPushCommits(t *testing.T) {
|
|||
var payloadContent structs.PushPayload
|
||||
require.NoError(t, json.Unmarshal([]byte(hookTask.PayloadContent), &payloadContent))
|
||||
assert.Len(t, payloadContent.Commits, 1)
|
||||
assert.EqualValues(t, "2c54faec6c45d31c1abfaecdab471eac6633738a", payloadContent.Commits[0].ID)
|
||||
assert.Equal(t, "2c54faec6c45d31c1abfaecdab471eac6633738a", payloadContent.Commits[0].ID)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue