Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Some checks failed
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
Integration tests for the release process / release-simulation (push) Has been cancelled

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:
Renovate Bot 2025-03-28 22:22:21 +00:00 committed by forgejo-renovate-action
parent 51ff4970ec
commit fed2d81c44
427 changed files with 2043 additions and 2046 deletions

View file

@ -39,7 +39,7 @@ import (
func getIssuesSelection(t testing.TB, htmlDoc *HTMLDoc) *goquery.Selection {
issueList := htmlDoc.doc.Find("#issue-list")
assert.EqualValues(t, 1, issueList.Length())
assert.Equal(t, 1, issueList.Length())
return issueList.Find(".flex-item").Find(".issue-title")
}
@ -103,11 +103,11 @@ func TestViewIssuesSortByType(t *testing.T) {
if expectedNumIssues > setting.UI.IssuePagingNum {
expectedNumIssues = setting.UI.IssuePagingNum
}
assert.EqualValues(t, expectedNumIssues, issuesSelection.Length())
assert.Equal(t, expectedNumIssues, issuesSelection.Length())
issuesSelection.Each(func(_ int, selection *goquery.Selection) {
issue := getIssue(t, repo.ID, selection)
assert.EqualValues(t, user.ID, issue.PosterID)
assert.Equal(t, user.ID, issue.PosterID)
})
}
@ -128,7 +128,7 @@ func TestViewIssuesKeyword(t *testing.T) {
htmlDoc := NewHTMLParser(t, resp.Body)
issuesSelection := getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 1, issuesSelection.Length())
assert.Equal(t, 1, issuesSelection.Length())
issuesSelection.Each(func(_ int, selection *goquery.Selection) {
issue := getIssue(t, repo.ID, selection)
assert.False(t, issue.IsClosed)
@ -142,14 +142,14 @@ func TestViewIssuesKeyword(t *testing.T) {
resp = MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
issuesSelection = getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 0, issuesSelection.Length())
assert.Equal(t, 0, issuesSelection.Length())
// should match as 'first' when using a standard query
req = NewRequestf(t, "GET", "%s/issues?q=%st", repo.Link(), keyword)
resp = MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
issuesSelection = getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 1, issuesSelection.Length())
assert.Equal(t, 1, issuesSelection.Length())
issuesSelection.Each(func(_ int, selection *goquery.Selection) {
issue := getIssue(t, repo.ID, selection)
assert.False(t, issue.IsClosed)
@ -172,7 +172,7 @@ func TestViewIssuesSearchOptions(t *testing.T) {
resp := MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
issuesSelection := getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 3, issuesSelection.Length())
assert.Equal(t, 3, issuesSelection.Length())
})
t.Run("Issues with no project", func(t *testing.T) {
@ -180,7 +180,7 @@ func TestViewIssuesSearchOptions(t *testing.T) {
resp := MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
issuesSelection := getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 1, issuesSelection.Length())
assert.Equal(t, 1, issuesSelection.Length())
issuesSelection.Each(func(_ int, selection *goquery.Selection) {
issue := getIssue(t, repo.ID, selection)
assert.Equal(t, issueNoProject.ID, issue.ID)
@ -194,7 +194,7 @@ func TestViewIssuesSearchOptions(t *testing.T) {
resp := MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
issuesSelection := getIssuesSelection(t, htmlDoc)
assert.EqualValues(t, 2, issuesSelection.Length())
assert.Equal(t, 2, issuesSelection.Length())
found := map[int64]bool{
1: false,
5: false,
@ -389,7 +389,7 @@ func TestIssueDependencies(t *testing.T) {
if hasDependency {
assert.NotEmpty(t, issues)
assert.EqualValues(t, issues[0].Index, dependencyID)
assert.Equal(t, issues[0].Index, dependencyID)
} else {
assert.Empty(t, issues)
}
@ -569,7 +569,7 @@ func TestIssueCommentUpdate(t *testing.T) {
session.MakeRequest(t, req, http.StatusOK)
comment = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: commentID})
assert.Equal(t, "", comment.Content)
assert.Empty(t, comment.Content)
}
func TestIssueCommentUpdateSimultaneously(t *testing.T) {
@ -798,7 +798,7 @@ func TestSearchIssues(t *testing.T) {
req = NewRequest(t, "GET", link.String())
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiIssues)
assert.EqualValues(t, "22", resp.Header().Get("X-Total-Count"))
assert.Equal(t, "22", resp.Header().Get("X-Total-Count"))
assert.Len(t, apiIssues, 20)
query.Add("limit", "5")
@ -806,7 +806,7 @@ func TestSearchIssues(t *testing.T) {
req = NewRequest(t, "GET", link.String())
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiIssues)
assert.EqualValues(t, "22", resp.Header().Get("X-Total-Count"))
assert.Equal(t, "22", resp.Header().Get("X-Total-Count"))
assert.Len(t, apiIssues, 5)
query = url.Values{"assigned": {"true"}, "state": {"all"}}
@ -930,14 +930,14 @@ func TestGetIssueInfo(t *testing.T) {
var apiIssue api.Issue
DecodeJSON(t, resp, &apiIssue)
assert.EqualValues(t, issue.ID, apiIssue.ID)
assert.Equal(t, issue.ID, apiIssue.ID)
}
func TestIssuePinMove(t *testing.T) {
defer tests.PrepareTestEnv(t)()
session := loginUser(t, "user2")
issueURL, issue := testIssueWithBean(t, "user2", 1, "Title", "Content")
assert.EqualValues(t, 0, issue.PinOrder)
assert.Equal(t, 0, issue.PinOrder)
req := NewRequestWithValues(t, "POST", fmt.Sprintf("%s/pin", issueURL), map[string]string{
"_csrf": GetCSRF(t, session, issueURL),
@ -946,7 +946,7 @@ func TestIssuePinMove(t *testing.T) {
issue = unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issue.ID})
position := 1
assert.EqualValues(t, position, issue.PinOrder)
assert.Equal(t, position, issue.PinOrder)
newPosition := 2
@ -961,7 +961,7 @@ func TestIssuePinMove(t *testing.T) {
session5.MakeRequest(t, req, http.StatusNotFound)
issue = unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issue.ID})
assert.EqualValues(t, position, issue.PinOrder)
assert.Equal(t, position, issue.PinOrder)
}
movePinURL := issueURL[:strings.LastIndexByte(issueURL, '/')] + "/move_pin?_csrf=" + GetCSRF(t, session, issueURL)
@ -972,7 +972,7 @@ func TestIssuePinMove(t *testing.T) {
session.MakeRequest(t, req, http.StatusNoContent)
issue = unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issue.ID})
assert.EqualValues(t, newPosition, issue.PinOrder)
assert.Equal(t, newPosition, issue.PinOrder)
}
func TestUpdateIssueDeadline(t *testing.T) {
@ -1001,7 +1001,7 @@ func TestUpdateIssueDeadline(t *testing.T) {
var apiIssue api.IssueDeadline
DecodeJSON(t, resp, &apiIssue)
assert.EqualValues(t, "2022-04-06", apiIssue.Deadline.Format("2006-01-02"))
assert.Equal(t, "2022-04-06", apiIssue.Deadline.Format("2006-01-02"))
}
func TestUpdateIssueTitle(t *testing.T) {
@ -1059,7 +1059,7 @@ func TestUpdateIssueTitle(t *testing.T) {
}{}
DecodeJSON(t, resp, &issueAfter)
assert.EqualValues(t, issueTitleUpdateTest.title, issueAfter.Title)
assert.Equal(t, issueTitleUpdateTest.title, issueAfter.Title)
}
}
}
@ -1077,10 +1077,10 @@ func TestIssueReferenceURL(t *testing.T) {
// the "reference" uses relative URLs, then JS code will convert them to absolute URLs for current origin, in case users are using multiple domains
ref, _ := htmlDoc.Find(`.timeline-item.comment.first .reference-issue`).Attr("data-reference")
assert.EqualValues(t, "/user2/repo1/issues/1#issue-1", ref)
assert.Equal(t, "/user2/repo1/issues/1#issue-1", ref)
ref, _ = htmlDoc.Find(`.timeline-item.comment:not(.first) .reference-issue`).Attr("data-reference")
assert.EqualValues(t, "/user2/repo1/issues/1#issuecomment-2", ref)
assert.Equal(t, "/user2/repo1/issues/1#issuecomment-2", ref)
}
func TestGetContentHistory(t *testing.T) {
@ -1109,7 +1109,7 @@ func TestGetContentHistory(t *testing.T) {
var respJSON contentHistoryResp
DecodeJSON(t, resp, &respJSON)
assert.EqualValues(t, canDelete, respJSON.CanSoftDelete)
assert.Equal(t, canDelete, respJSON.CanSoftDelete)
assert.EqualValues(t, contentHistory.ID, respJSON.HistoryID)
assert.EqualValues(t, contentHistory.ID-1, respJSON.PrevHistoryID)
}
@ -1357,7 +1357,7 @@ func TestIssuePostersSearch(t *testing.T) {
DecodeJSON(t, resp, &data)
assert.Len(t, data.Results, 1)
assert.EqualValues(t, "user2", data.Results[0].UserName)
assert.Equal(t, "user2", data.Results[0].UserName)
assert.EqualValues(t, 2, data.Results[0].UserID)
})
@ -1372,7 +1372,7 @@ func TestIssuePostersSearch(t *testing.T) {
DecodeJSON(t, resp, &data)
assert.Len(t, data.Results, 1)
assert.EqualValues(t, "user1", data.Results[0].UserName)
assert.Equal(t, "user1", data.Results[0].UserName)
assert.EqualValues(t, 1, data.Results[0].UserID)
})
}