Fix various typos in codebase (#35480)

This commit is contained in:
luzpaz
2025-09-13 10:34:43 -04:00
committed by GitHub
parent 325e059a50
commit 688abac5ca
26 changed files with 30 additions and 30 deletions

View File

@@ -70,7 +70,7 @@ func (i *Identicon) render(c, b1, b2, b1Angle, b2Angle, foreColor int) image.Ima
/*
# Algorithm
Origin: An image is splitted into 9 areas
Origin: An image is split into 9 areas
```
-------------

View File

@@ -250,7 +250,7 @@ func (b *Indexer) Index(ctx context.Context, repo *repo_model.Repository, sha st
func (b *Indexer) Delete(ctx context.Context, repoID int64) error {
if err := b.doDelete(ctx, repoID); err != nil {
// Maybe there is a conflict during the delete operation, so we should retry after a refresh
log.Warn("Deletion of entries of repo %v within index %v was erroneus. Trying to refresh index before trying again", repoID, b.inner.VersionedIndexName(), err)
log.Warn("Deletion of entries of repo %v within index %v was erroneous. Trying to refresh index before trying again", repoID, b.inner.VersionedIndexName(), err)
if err := b.refreshIndex(ctx); err != nil {
return err
}

View File

@@ -134,7 +134,7 @@ func testIndexer(name string, t *testing.T, indexer internal.Indexer) {
},
},
// Search for matches on both the contents and the filenames within the repo '62'.
// This scenario yields two results: the first result is baed on the file (cucumber.md) while the second is based on the contents
// This scenario yields two results: the first result is based on the file (cucumber.md) while the second is based on the contents
{
RepoIDs: []int64{62},
Keyword: "cucumber",

View File

@@ -28,7 +28,7 @@ import (
)
// IndexerMetadata is used to send data to the queue, so it contains only the ids.
// It may look weired, because it has to be compatible with the old queue data format.
// It may look weird, because it has to be compatible with the old queue data format.
// If the IsDelete flag is true, the IDs specify the issues to delete from the index without querying the database.
// If the IsDelete flag is false, the ID specify the issue to index, so Indexer will query the database to get the issue data.
// It should be noted that if the id is not existing in the database, it's index will be deleted too even if IsDelete is false.

View File

@@ -18,7 +18,7 @@ func resolveLinkRelative(ctx context.Context, base, cur, link string, absolute b
}
if strings.HasPrefix(link, "/") {
if strings.HasPrefix(link, base) && strings.Count(base, "/") >= 4 {
// a trick to tolerate that some users were using absolut paths (the old gitea's behavior)
// a trick to tolerate that some users were using absolute paths (the old gitea's behavior)
finalLink = link
} else {
finalLink = util.URLJoin(base, "./", link)

View File

@@ -22,7 +22,7 @@
//
// 4. Handler (represented by HandlerFuncT type):
// - It's the function responsible for processing items. Each active worker will call it.
// - If an item or some items are not psuccessfully rocessed, the handler could return them as "unhandled items".
// - If an item or some items are not successfully processed, the handler could return them as "unhandled items".
// In such scenarios, the queue system ensures these unhandled items are returned to the base queue after a brief delay.
// This mechanism is particularly beneficial in cases where the processing entity (like a document indexer) is
// temporarily unavailable. It ensures that no item is skipped or lost due to transient failures in the processing

View File

@@ -17,7 +17,7 @@ import (
type StateType string
const (
// StateOpen pr is opend
// StateOpen pr is opened
StateOpen StateType = "open"
// StateClosed pr is closed
StateClosed StateType = "closed"

View File

@@ -319,7 +319,7 @@ const (
)
// Name represents the service type's name
// WARNNING: the name have to be equal to that on goth's library
// WARNING: the name has to be equal to that on goth's library
func (gt GitServiceType) Name() string {
return strings.ToLower(gt.Title())
}

View File

@@ -61,7 +61,7 @@ type User struct {
// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility
func (u User) MarshalJSON() ([]byte, error) {
// Re-declaring User to avoid recursion
// Redeclaring User to avoid recursion
type shadow User
return json.Marshal(struct {
shadow

View File

@@ -48,12 +48,12 @@ func TestIsSvgImage(t *testing.T) {
<!-- Comments -->
<svg></svg>`)).IsSvgImage())
assert.True(t, DetectContentType([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<!-- Multline
<!-- Multiline
Comment -->
<svg></svg>`)).IsSvgImage())
assert.True(t, DetectContentType([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Multline
<!-- Multiline
Comment -->
<svg></svg>`)).IsSvgImage())