mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
enable staticcheck QFxxxx rules (#34064)
This commit is contained in:
@@ -938,9 +938,10 @@ func ExcerptBlob(ctx *context.Context) {
|
||||
RightHunkSize: rightHunkSize,
|
||||
},
|
||||
}
|
||||
if direction == "up" {
|
||||
switch direction {
|
||||
case "up":
|
||||
section.Lines = append([]*gitdiff.DiffLine{lineSection}, section.Lines...)
|
||||
} else if direction == "down" {
|
||||
case "down":
|
||||
section.Lines = append(section.Lines, lineSection)
|
||||
}
|
||||
}
|
||||
|
@@ -157,15 +157,16 @@ func GetContentHistoryDetail(ctx *context.Context) {
|
||||
diffHTMLBuf := bytes.Buffer{}
|
||||
diffHTMLBuf.WriteString("<pre class='chroma'>")
|
||||
for _, it := range diff {
|
||||
if it.Type == diffmatchpatch.DiffInsert {
|
||||
switch it.Type {
|
||||
case diffmatchpatch.DiffInsert:
|
||||
diffHTMLBuf.WriteString("<span class='gi'>")
|
||||
diffHTMLBuf.WriteString(html.EscapeString(it.Text))
|
||||
diffHTMLBuf.WriteString("</span>")
|
||||
} else if it.Type == diffmatchpatch.DiffDelete {
|
||||
case diffmatchpatch.DiffDelete:
|
||||
diffHTMLBuf.WriteString("<span class='gd'>")
|
||||
diffHTMLBuf.WriteString(html.EscapeString(it.Text))
|
||||
diffHTMLBuf.WriteString("</span>")
|
||||
} else {
|
||||
default:
|
||||
diffHTMLBuf.WriteString(html.EscapeString(it.Text))
|
||||
}
|
||||
}
|
||||
|
@@ -696,9 +696,10 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
|
||||
return 0
|
||||
}
|
||||
reviewTyp := issues_model.ReviewTypeApprove
|
||||
if typ == "reject" {
|
||||
switch typ {
|
||||
case "reject":
|
||||
reviewTyp = issues_model.ReviewTypeReject
|
||||
} else if typ == "waiting" {
|
||||
case "waiting":
|
||||
reviewTyp = issues_model.ReviewTypeRequest
|
||||
}
|
||||
for _, count := range counts {
|
||||
|
@@ -209,11 +209,12 @@ func renderConversation(ctx *context.Context, comment *issues_model.Comment, ori
|
||||
return user_service.CanBlockUser(ctx, ctx.Doer, blocker, blockee)
|
||||
}
|
||||
|
||||
if origin == "diff" {
|
||||
switch origin {
|
||||
case "diff":
|
||||
ctx.HTML(http.StatusOK, tplDiffConversation)
|
||||
} else if origin == "timeline" {
|
||||
case "timeline":
|
||||
ctx.HTML(http.StatusOK, tplTimelineConversation)
|
||||
} else {
|
||||
default:
|
||||
ctx.HTTPError(http.StatusBadRequest, "Unknown origin: "+origin)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user