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
|
@ -85,7 +85,7 @@ func mailIssueCommentToParticipants(ctx *mailCommentContext, mentions []*user_mo
|
|||
|
||||
// =========== Repo watchers ===========
|
||||
// Make repo watchers last, since it's likely the list with the most users
|
||||
if !(ctx.Issue.IsPull && ctx.Issue.PullRequest.IsWorkInProgress(ctx) && ctx.ActionType != activities_model.ActionCreatePullRequest) {
|
||||
if !ctx.Issue.IsPull || !ctx.Issue.PullRequest.IsWorkInProgress(ctx) || ctx.ActionType == activities_model.ActionCreatePullRequest {
|
||||
ids, err = repo_model.GetRepoWatchersIDs(ctx, ctx.Issue.RepoID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetRepoWatchersIDs(%d): %w", ctx.Issue.RepoID, err)
|
||||
|
@ -137,9 +137,8 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*user_model.User, vi
|
|||
}
|
||||
// At this point we exclude:
|
||||
// user that don't have all mails enabled or users only get mail on mention and this is one ...
|
||||
if !(user.EmailNotificationsPreference == user_model.EmailNotificationsEnabled ||
|
||||
user.EmailNotificationsPreference == user_model.EmailNotificationsAndYourOwn ||
|
||||
fromMention && user.EmailNotificationsPreference == user_model.EmailNotificationsOnMention) {
|
||||
if user.EmailNotificationsPreference != user_model.EmailNotificationsEnabled &&
|
||||
user.EmailNotificationsPreference != user_model.EmailNotificationsAndYourOwn && (!fromMention || user.EmailNotificationsPreference != user_model.EmailNotificationsOnMention) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ func TestFromDisplayName(t *testing.T) {
|
|||
t.Run(tc.userDisplayName, func(t *testing.T) {
|
||||
user := &user_model.User{FullName: tc.userDisplayName, Name: "tmp"}
|
||||
got := fromDisplayName(user)
|
||||
assert.EqualValues(t, tc.fromDisplayName, got)
|
||||
assert.Equal(t, tc.fromDisplayName, got)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ func TestFromDisplayName(t *testing.T) {
|
|||
setting.Domain = oldDomain
|
||||
}()
|
||||
|
||||
assert.EqualValues(t, "Mister X (by Code IT on [code.it])", fromDisplayName(&user_model.User{FullName: "Mister X", Name: "tmp"}))
|
||||
assert.Equal(t, "Mister X (by Code IT on [code.it])", fromDisplayName(&user_model.User{FullName: "Mister X", Name: "tmp"}))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ func TestToMessage(t *testing.T) {
|
|||
_, err := m1.ToMessage().WriteTo(buf)
|
||||
require.NoError(t, err)
|
||||
header, _ := extractMailHeaderAndContent(t, buf.String())
|
||||
assert.EqualValues(t, map[string]string{
|
||||
assert.Equal(t, map[string]string{
|
||||
"Content-Type": "multipart/alternative;",
|
||||
"Date": "Mon, 01 Jan 0001 00:00:00 +0000",
|
||||
"From": "\"Test Gitea\" <test@gitea.com>",
|
||||
|
@ -92,7 +92,7 @@ func TestToMessage(t *testing.T) {
|
|||
_, err = m1.ToMessage().WriteTo(buf)
|
||||
require.NoError(t, err)
|
||||
header, _ = extractMailHeaderAndContent(t, buf.String())
|
||||
assert.EqualValues(t, map[string]string{
|
||||
assert.Equal(t, map[string]string{
|
||||
"Content-Type": "multipart/alternative;",
|
||||
"Date": "Mon, 01 Jan 0001 00:00:00 +0000",
|
||||
"From": "\"Test Gitea\" <test@gitea.com>",
|
||||
|
|
|
@ -30,15 +30,16 @@ func (m *mailNotifier) CreateIssueComment(ctx context.Context, doer *user_model.
|
|||
issue *issues_model.Issue, comment *issues_model.Comment, mentions []*user_model.User,
|
||||
) {
|
||||
var act activities_model.ActionType
|
||||
if comment.Type == issues_model.CommentTypeClose {
|
||||
switch comment.Type {
|
||||
case issues_model.CommentTypeClose:
|
||||
act = activities_model.ActionCloseIssue
|
||||
} else if comment.Type == issues_model.CommentTypeReopen {
|
||||
case issues_model.CommentTypeReopen:
|
||||
act = activities_model.ActionReopenIssue
|
||||
} else if comment.Type == issues_model.CommentTypeComment {
|
||||
case issues_model.CommentTypeComment:
|
||||
act = activities_model.ActionCommentIssue
|
||||
} else if comment.Type == issues_model.CommentTypeCode {
|
||||
case issues_model.CommentTypeCode:
|
||||
act = activities_model.ActionCommentIssue
|
||||
} else if comment.Type == issues_model.CommentTypePullRequestPush {
|
||||
case issues_model.CommentTypePullRequestPush:
|
||||
act = 0
|
||||
}
|
||||
|
||||
|
@ -94,11 +95,12 @@ func (m *mailNotifier) NewPullRequest(ctx context.Context, pr *issues_model.Pull
|
|||
|
||||
func (m *mailNotifier) PullRequestReview(ctx context.Context, pr *issues_model.PullRequest, r *issues_model.Review, comment *issues_model.Comment, mentions []*user_model.User) {
|
||||
var act activities_model.ActionType
|
||||
if comment.Type == issues_model.CommentTypeClose {
|
||||
switch comment.Type {
|
||||
case issues_model.CommentTypeClose:
|
||||
act = activities_model.ActionCloseIssue
|
||||
} else if comment.Type == issues_model.CommentTypeReopen {
|
||||
case issues_model.CommentTypeReopen:
|
||||
act = activities_model.ActionReopenIssue
|
||||
} else if comment.Type == issues_model.CommentTypeComment {
|
||||
case issues_model.CommentTypeComment:
|
||||
act = activities_model.ActionCommentPull
|
||||
}
|
||||
if err := MailParticipantsComment(ctx, comment, act, pr.Issue, mentions); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue