Skip to content

Commit f85c521

Browse files
committed
fix formatting
1 parent ed8d76b commit f85c521

File tree

9 files changed

+14
-18
lines changed

9 files changed

+14
-18
lines changed

modules/indexer/code/internal/indexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type SearchOptions struct {
2626
Language string
2727

2828
IsKeywordFuzzy bool
29-
IsHtmlSafe bool
29+
IsHTMLSafe bool
3030

3131
db.Paginator
3232
}

modules/indexer/code/search.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func RawSearchResultCode(filename, language string, lineNums []int, code string)
102102
return lines
103103
}
104104

105-
func searchResult(result *internal.SearchResult, startIndex, endIndex int, escapeHtml bool) (*Result, error) {
105+
func searchResult(result *internal.SearchResult, startIndex, endIndex int, escapeHTML bool) (*Result, error) {
106106
startLineNum := 1 + strings.Count(result.Content[:startIndex], "\n")
107107

108108
var formattedLinesBuffer bytes.Buffer
@@ -134,7 +134,7 @@ func searchResult(result *internal.SearchResult, startIndex, endIndex int, escap
134134
}
135135

136136
var lines []*ResultLine
137-
if escapeHtml {
137+
if escapeHTML {
138138
lines = HighlightSearchResultCode(result.Filename, result.Language, lineNums, formattedLinesBuffer.String())
139139
} else {
140140
lines = RawSearchResultCode(result.Filename, result.Language, lineNums, formattedLinesBuffer.String())
@@ -166,13 +166,13 @@ func PerformSearch(ctx context.Context, opts *SearchOptions) (int, []*Result, []
166166
displayResults := make([]*Result, len(results))
167167

168168
nLinesBuffer := 0
169-
if opts.IsHtmlSafe {
169+
if opts.IsHTMLSafe {
170170
nLinesBuffer = 1
171171
}
172172

173173
for i, result := range results {
174174
startIndex, endIndex := indices(result.Content, result.StartIndex, result.EndIndex, nLinesBuffer)
175-
displayResults[i], err = searchResult(result, startIndex, endIndex, opts.IsHtmlSafe)
175+
displayResults[i], err = searchResult(result, startIndex, endIndex, opts.IsHTMLSafe)
176176
if err != nil {
177177
return 0, nil, nil, err
178178
}

routers/api/v1/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ import (
8585
"code.gitea.io/gitea/modules/web"
8686
"code.gitea.io/gitea/routers/api/v1/activitypub"
8787
"code.gitea.io/gitea/routers/api/v1/admin"
88+
"code.gitea.io/gitea/routers/api/v1/explore"
8889
"code.gitea.io/gitea/routers/api/v1/misc"
8990
"code.gitea.io/gitea/routers/api/v1/notify"
9091
"code.gitea.io/gitea/routers/api/v1/org"
9192
"code.gitea.io/gitea/routers/api/v1/packages"
9293
"code.gitea.io/gitea/routers/api/v1/repo"
9394
"code.gitea.io/gitea/routers/api/v1/settings"
9495
"code.gitea.io/gitea/routers/api/v1/user"
95-
"code.gitea.io/gitea/routers/api/v1/explore"
9696
"code.gitea.io/gitea/routers/common"
9797
"code.gitea.io/gitea/services/actions"
9898
"code.gitea.io/gitea/services/auth"

routers/api/v1/explore/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func Code(ctx *context.APIContext) {
9494
RepoIDs: repoIDs,
9595
Keyword: keyword,
9696
IsKeywordFuzzy: isFuzzy,
97-
IsHtmlSafe: false,
97+
IsHTMLSafe: false,
9898
Paginator: &db.ListOptions{
9999
Page: page,
100100
PageSize: setting.API.DefaultPagingNum,

routers/api/v1/swagger/explore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import (
1010
// ExploreCode
1111
// swagger:response ExploreCode
1212
type swaggerResponseExploreCode struct {
13-
// out:body
14-
Body api.ExploreCodeResult `json:"body"`
13+
// in:body
14+
Body api.ExploreCodeResult `json:"body"`
1515
}

routers/web/explore/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func Code(ctx *context.Context) {
8181
RepoIDs: repoIDs,
8282
Keyword: keyword,
8383
IsKeywordFuzzy: isFuzzy,
84-
IsHtmlSafe: true,
84+
IsHTMLSafe: true,
8585
Language: language,
8686
Paginator: &db.ListOptions{
8787
Page: page,

routers/web/repo/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func Search(ctx *context.Context) {
5959
RepoIDs: []int64{ctx.Repo.Repository.ID},
6060
Keyword: keyword,
6161
IsKeywordFuzzy: isFuzzy,
62-
IsHtmlSafe: true,
62+
IsHTMLSafe: true,
6363
Language: language,
6464
Paginator: &db.ListOptions{
6565
Page: page,

routers/web/user/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func CodeSearch(ctx *context.Context) {
8080
Keyword: keyword,
8181
IsKeywordFuzzy: isFuzzy,
8282
Language: language,
83-
IsHtmlSafe: true,
83+
IsHTMLSafe: true,
8484
Paginator: &db.ListOptions{
8585
Page: page,
8686
PageSize: setting.UI.RepoSearchPagingNum,

templates/swagger/v1_json.tmpl

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)