forked from kevadesu/forgejo
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
parent
1d98d205f5
commit
54e9ee37a7
423 changed files with 1585 additions and 1758 deletions
|
@ -22,12 +22,12 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
|
|||
URL: n.APIURL(),
|
||||
}
|
||||
|
||||
//since user only get notifications when he has access to use minimal access mode
|
||||
// since user only get notifications when he has access to use minimal access mode
|
||||
if n.Repository != nil {
|
||||
result.Repository = ToRepo(n.Repository, perm.AccessModeRead)
|
||||
}
|
||||
|
||||
//handle Subject
|
||||
// handle Subject
|
||||
switch n.Source {
|
||||
case models.NotificationSourceIssue:
|
||||
result.Subject = &api.NotificationSubject{Type: api.NotifySubjectIssue}
|
||||
|
@ -83,7 +83,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
|
|||
|
||||
// ToNotifications convert list of Notification to api.NotificationThread list
|
||||
func ToNotifications(nl models.NotificationList) []*api.NotificationThread {
|
||||
var result = make([]*api.NotificationThread, 0, len(nl))
|
||||
result := make([]*api.NotificationThread, 0, len(nl))
|
||||
for _, n := range nl {
|
||||
result = append(result, ToNotificationThread(n))
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
)
|
||||
|
||||
func TestPullRequest_APIFormat(t *testing.T) {
|
||||
//with HeadRepo
|
||||
// with HeadRepo
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
headRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
|
||||
pr := unittest.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
|
||||
|
@ -34,7 +34,7 @@ func TestPullRequest_APIFormat(t *testing.T) {
|
|||
Repository: ToRepo(headRepo, perm.AccessModeRead),
|
||||
}, apiPullRequest.Head)
|
||||
|
||||
//withOut HeadRepo
|
||||
// withOut HeadRepo
|
||||
pr = unittest.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
|
||||
assert.NoError(t, pr.LoadIssue())
|
||||
assert.NoError(t, pr.LoadAttributes())
|
||||
|
|
|
@ -40,7 +40,7 @@ func innerToRepo(repo *repo_model.Repository, mode perm.AccessMode, isParent boo
|
|||
}
|
||||
}
|
||||
|
||||
//check enabled/disabled units
|
||||
// check enabled/disabled units
|
||||
hasIssues := false
|
||||
var externalTracker *api.ExternalTracker
|
||||
var internalTracker *api.InternalTracker
|
||||
|
|
|
@ -33,7 +33,6 @@ func ToCommitStatus(status *models.CommitStatus) *api.CommitStatus {
|
|||
|
||||
// ToCombinedStatus converts List of CommitStatus to a CombinedStatus
|
||||
func ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus {
|
||||
|
||||
if len(statuses) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue