diff options
author | luzpaz <luzpaz@users.noreply.github.com> | 2021-07-08 07:38:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 13:38:13 +0200 |
commit | e0296b6a6de6450c474fdf7fe62635a05beb49ab (patch) | |
tree | 1e924ac17324f60f6607e65cb51a325b948d1c62 /modules | |
parent | bc6f060b8cd89685cc32980c4f03cba58850cab1 (diff) | |
download | gitea-e0296b6a6de6450c474fdf7fe62635a05beb49ab.tar.gz gitea-e0296b6a6de6450c474fdf7fe62635a05beb49ab.zip |
Fix various documentation, user-facing, and source comment typos (#16367)
* Fix various doc, user-facing, and source comment typos
Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`
Diffstat (limited to 'modules')
33 files changed, 47 insertions, 47 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 72d1cf4c85..ea8323bdfc 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -38,7 +38,7 @@ var IssueTemplateDirCandidates = []string{ ".gitlab/issue_template", } -// PullRequest contains informations to make a pull request +// PullRequest contains information to make a pull request type PullRequest struct { BaseRepo *models.Repository Allowed bool diff --git a/modules/git/blame.go b/modules/git/blame.go index c2129c9e1c..fcbf183981 100644 --- a/modules/git/blame.go +++ b/modules/git/blame.go @@ -34,7 +34,7 @@ type BlameReader struct { var shaLineRegex = regexp.MustCompile("^([a-z0-9]{40})") -// NextPart returns next part of blame (sequencial code lines with the same commit) +// NextPart returns next part of blame (sequential code lines with the same commit) func (r *BlameReader) NextPart() (*BlamePart, error) { var blamePart *BlamePart diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 5b417cd774..16ee5b2fd6 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -110,7 +110,7 @@ func (repo *Repository) searchCommits(id SHA1, opts SearchCommitsOptions) (*list } } - // add commiters if present in search query + // add committers if present in search query if len(opts.Committers) > 0 { for _, v := range opts.Committers { args = append(args, "--committer="+v) @@ -150,7 +150,7 @@ func (repo *Repository) searchCommits(id SHA1, opts SearchCommitsOptions) (*list stdout = append(stdout, '\n') } - // if there are any keywords (ie not commiter:, author:, time:) + // if there are any keywords (ie not committer:, author:, time:) // then let's iterate over them if len(opts.Keywords) > 0 { for _, v := range opts.Keywords { @@ -195,12 +195,12 @@ func (repo *Repository) FileChangedBetweenCommits(filename, id1, id2 string) (bo return len(strings.TrimSpace(string(stdout))) > 0, nil } -// FileCommitsCount return the number of files at a revison +// FileCommitsCount return the number of files at a revision func (repo *Repository) FileCommitsCount(revision, file string) (int64, error) { return CommitsCountFiles(repo.Path, []string{revision}, []string{file}) } -// CommitsByFileAndRange return the commits according revison file and the page +// CommitsByFileAndRange return the commits according revision file and the page func (repo *Repository) CommitsByFileAndRange(revision, file string, page int) (*list.List, error) { skip := (page - 1) * setting.Git.CommitsRangeSize @@ -240,7 +240,7 @@ func (repo *Repository) CommitsByFileAndRange(revision, file string, page int) ( return repo.parsePrettyFormatLogToList(stdout) } -// CommitsByFileAndRangeNoFollow return the commits according revison file and the page +// CommitsByFileAndRangeNoFollow return the commits according revision file and the page func (repo *Repository) CommitsByFileAndRangeNoFollow(revision, file string, page int) (*list.List, error) { stdout, err := NewCommand("log", revision, "--skip="+strconv.Itoa((page-1)*50), "--max-count="+strconv.Itoa(setting.Git.CommitsRangeSize), prettyLogFormat, "--", file).RunInDirBytes(repo.Path) diff --git a/modules/git/repo_stats.go b/modules/git/repo_stats.go index cb2a2bcf51..aca5ab21cc 100644 --- a/modules/git/repo_stats.go +++ b/modules/git/repo_stats.go @@ -33,7 +33,7 @@ type CodeActivityAuthor struct { Commits int64 } -// GetCodeActivityStats returns code statistics for acitivity page +// GetCodeActivityStats returns code statistics for activity page func (repo *Repository) GetCodeActivityStats(fromTime time.Time, branch string) (*CodeActivityStats, error) { stats := &CodeActivityStats{} diff --git a/modules/git/utils.go b/modules/git/utils.go index d952189416..13926fba72 100644 --- a/modules/git/utils.go +++ b/modules/git/utils.go @@ -13,7 +13,7 @@ import ( "sync" ) -// ObjectCache provides thread-safe cache opeations. +// ObjectCache provides thread-safe cache operations. type ObjectCache struct { lock sync.RWMutex cache map[string]interface{} diff --git a/modules/indexer/code/elastic_search.go b/modules/indexer/code/elastic_search.go index 38a97ad888..569917f151 100644 --- a/modules/indexer/code/elastic_search.go +++ b/modules/indexer/code/elastic_search.go @@ -284,7 +284,7 @@ func (b *ElasticSearchIndexer) Delete(repoID int64) error { } // indexPos find words positions for start and the following end on content. It will -// return the beginning position of the frist start and the ending position of the +// return the beginning position of the first start and the ending position of the // first end following the start string. // If not found any of the positions, it will return -1, -1. func indexPos(content, start, end string) (int, int) { @@ -308,8 +308,8 @@ func convertResult(searchResult *elastic.SearchResult, kw string, pageSize int) var startIndex, endIndex int = -1, -1 c, ok := hit.Highlight["content"] if ok && len(c) > 0 { - // FIXME: Since the high lighting content will include <em> and </em> for the keywords, - // now we should find the poisitions. But how to avoid html content which contains the + // FIXME: Since the highlighting content will include <em> and </em> for the keywords, + // now we should find the positions. But how to avoid html content which contains the // <em> and </em> tags? If elastic search has handled that? startIndex, endIndex = indexPos(c[0], "<em>", "</em>") if startIndex == -1 { diff --git a/modules/lfs/shared.go b/modules/lfs/shared.go index 8343d12e1d..d010b05ee5 100644 --- a/modules/lfs/shared.go +++ b/modules/lfs/shared.go @@ -49,7 +49,7 @@ type ObjectResponse struct { Error *ObjectError `json:"error,omitempty"` } -// Link provides a structure with informations about how to access a object. +// Link provides a structure with information about how to access a object. type Link struct { Href string `json:"href"` Header map[string]string `json:"header,omitempty"` diff --git a/modules/log/colors_router.go b/modules/log/colors_router.go index e291a0da99..3064e005cf 100644 --- a/modules/log/colors_router.go +++ b/modules/log/colors_router.go @@ -19,7 +19,7 @@ var statusToColor = map[int][]byte{ 500: ColorBytes(Bold, BgRed), } -// ColoredStatus addes colors for HTTP status +// ColoredStatus adds colors for HTTP status func ColoredStatus(status int, s ...string) *ColoredValue { color, ok := statusToColor[status] if !ok { @@ -43,7 +43,7 @@ var methodToColor = map[string][]byte{ "HEAD": ColorBytes(FgBlue, Faint), } -// ColoredMethod addes colors for HtTP methos on log +// ColoredMethod adds colors for HTTP methods on log func ColoredMethod(method string) *ColoredValue { color, ok := methodToColor[method] if !ok { @@ -72,7 +72,7 @@ var ( wayTooLong = ColorBytes(BgMagenta) ) -// ColoredTime addes colors for time on log +// ColoredTime adds colors for time on log func ColoredTime(duration time.Duration) *ColoredValue { for i, k := range durations { if duration < k { diff --git a/modules/markup/html.go b/modules/markup/html.go index 7afd8114c1..6d0b4fbea2 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -274,7 +274,7 @@ func RenderDescriptionHTML( } // RenderEmoji for when we want to just process emoji and shortcodes -// in various places it isn't already run through the normal markdown procesor +// in various places it isn't already run through the normal markdown processor func RenderEmoji( content string, ) (string, error) { diff --git a/modules/markup/markdown/ast.go b/modules/markup/markdown/ast.go index d735ff5ebd..5191d94cdd 100644 --- a/modules/markup/markdown/ast.go +++ b/modules/markup/markdown/ast.go @@ -74,7 +74,7 @@ func IsSummary(node ast.Node) bool { return ok } -// TaskCheckBoxListItem is a block that repressents a list item of a markdown block with a checkbox +// TaskCheckBoxListItem is a block that represents a list item of a markdown block with a checkbox type TaskCheckBoxListItem struct { *ast.ListItem IsChecked bool diff --git a/modules/markup/mdstripper/mdstripper_test.go b/modules/markup/mdstripper/mdstripper_test.go index 9efcc35949..13cea0ff72 100644 --- a/modules/markup/mdstripper/mdstripper_test.go +++ b/modules/markup/mdstripper/mdstripper_test.go @@ -25,7 +25,7 @@ func TestMarkdownStripper(t *testing.T) { This is [one](link) to paradise. This **is emphasized**. -This: should coallesce. +This: should coalesce. ` + "```" + ` This is a code block. @@ -44,7 +44,7 @@ A HIDDEN ` + "`" + `GHOST` + "`" + ` IN THIS LINE. "This", "is emphasized", ".", - "This: should coallesce.", + "This: should coalesce.", "Bullet 1", "Bullet 2", "A HIDDEN", diff --git a/modules/migrations/base/downloader.go b/modules/migrations/base/downloader.go index 2388b2dd6e..71c8f3eaf9 100644 --- a/modules/migrations/base/downloader.go +++ b/modules/migrations/base/downloader.go @@ -18,7 +18,7 @@ type GetCommentOptions struct { PageSize int } -// Downloader downloads the site repo informations +// Downloader downloads the site repo information type Downloader interface { SetContext(context.Context) GetRepoInfo() (*Repository, error) diff --git a/modules/migrations/base/label.go b/modules/migrations/base/label.go index 0c86b547f1..5a66e7620f 100644 --- a/modules/migrations/base/label.go +++ b/modules/migrations/base/label.go @@ -5,7 +5,7 @@ package base -// Label defines a standard label informations +// Label defines a standard label information type Label struct { Name string Color string diff --git a/modules/migrations/base/uploader.go b/modules/migrations/base/uploader.go index dfcf81d052..4d0257df37 100644 --- a/modules/migrations/base/uploader.go +++ b/modules/migrations/base/uploader.go @@ -5,7 +5,7 @@ package base -// Uploader uploads all the informations of one repository +// Uploader uploads all the information of one repository type Uploader interface { MaxBatchInsertSize(tp string) int CreateRepo(repo *Repository, opts MigrateOptions) error diff --git a/modules/migrations/github.go b/modules/migrations/github.go index 9b897662d0..7d4c492c24 100644 --- a/modules/migrations/github.go +++ b/modules/migrations/github.go @@ -61,7 +61,7 @@ func (f *GithubDownloaderV3Factory) GitServiceType() structs.GitServiceType { return structs.GithubService } -// GithubDownloaderV3 implements a Downloader interface to get repository informations +// GithubDownloaderV3 implements a Downloader interface to get repository information // from github via APIv3 type GithubDownloaderV3 struct { base.NullDownloader diff --git a/modules/migrations/gitlab.go b/modules/migrations/gitlab.go index c83989f771..fe763f9900 100644 --- a/modules/migrations/gitlab.go +++ b/modules/migrations/gitlab.go @@ -56,7 +56,7 @@ func (f *GitlabDownloaderFactory) GitServiceType() structs.GitServiceType { return structs.GitlabService } -// GitlabDownloader implements a Downloader interface to get repository informations +// GitlabDownloader implements a Downloader interface to get repository information // from gitlab via go-gitlab // - issueCount is incremented in GetIssues() to ensure PR and Issue numbers do not overlap, // because Gitlab has individual Issue and Pull Request numbers. diff --git a/modules/migrations/gogs.go b/modules/migrations/gogs.go index d689b0da11..9e663fd1fe 100644 --- a/modules/migrations/gogs.go +++ b/modules/migrations/gogs.go @@ -57,7 +57,7 @@ func (f *GogsDownloaderFactory) GitServiceType() structs.GitServiceType { return structs.GogsService } -// GogsDownloader implements a Downloader interface to get repository informations +// GogsDownloader implements a Downloader interface to get repository information // from gogs via API type GogsDownloader struct { base.NullDownloader diff --git a/modules/notification/base/null.go b/modules/notification/base/null.go index e61b37a943..32fe259bca 100644 --- a/modules/notification/base/null.go +++ b/modules/notification/base/null.go @@ -143,7 +143,7 @@ func (*NullNotifier) NotifyPushCommits(pusher *models.User, repo *models.Reposit func (*NullNotifier) NotifyCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string) { } -// NotifyDeleteRef notifies branch or tag deleteion to notifiers +// NotifyDeleteRef notifies branch or tag deletion to notifiers func (*NullNotifier) NotifyDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) { } diff --git a/modules/references/references_test.go b/modules/references/references_test.go index 293322a714..11a31b41b6 100644 --- a/modules/references/references_test.go +++ b/modules/references/references_test.go @@ -481,7 +481,7 @@ func TestParseCloseKeywords(t *testing.T) { {",$!", "", ""}, {"1234", "", ""}, } { - // The patern only needs to match the part that precedes the reference. + // The pattern only needs to match the part that precedes the reference. // getCrossReference() takes care of finding the reference itself. pat := makeKeywordsPat([]string{test.pattern}) if test.expected == "" { diff --git a/modules/repofiles/action_test.go b/modules/repofiles/action_test.go index 290844de02..97632df68f 100644 --- a/modules/repofiles/action_test.go +++ b/modules/repofiles/action_test.go @@ -250,7 +250,7 @@ func TestUpdateIssuesCommit_AnotherRepoNoPermission(t *testing.T) { user := models.AssertExistsAndLoadBean(t, &models.User{ID: 10}).(*models.User) // Test that a push with close reference *can not* close issue - // If the commiter doesn't have push rights in that repo + // If the committer doesn't have push rights in that repo pushCommits := []*repository.PushCommit{ { Sha1: "abcdef3", diff --git a/modules/repofiles/content_test.go b/modules/repofiles/content_test.go index 2782161122..253d434459 100644 --- a/modules/repofiles/content_test.go +++ b/modules/repofiles/content_test.go @@ -69,7 +69,7 @@ func TestGetContents(t *testing.T) { assert.NoError(t, err) }) - t.Run("Get REAMDE.md contents with ref as empty string (should then use the repo's default branch) with GetContents()", func(t *testing.T) { + t.Run("Get README.md contents with ref as empty string (should then use the repo's default branch) with GetContents()", func(t *testing.T) { fileContentResponse, err := GetContents(ctx.Repo.Repository, treePath, "", false) assert.EqualValues(t, expectedContentsResponse, fileContentResponse) assert.NoError(t, err) @@ -132,7 +132,7 @@ func TestGetContentsOrListForFile(t *testing.T) { assert.NoError(t, err) }) - t.Run("Get REAMDE.md contents with ref as empty string (should then use the repo's default branch) with GetContentsOrList()", func(t *testing.T) { + t.Run("Get README.md contents with ref as empty string (should then use the repo's default branch) with GetContentsOrList()", func(t *testing.T) { fileContentResponse, err := GetContentsOrList(ctx.Repo.Repository, treePath, "") assert.EqualValues(t, expectedContentsResponse, fileContentResponse) assert.NoError(t, err) diff --git a/modules/repository/adopt.go b/modules/repository/adopt.go index a37f770496..321e6ab767 100644 --- a/modules/repository/adopt.go +++ b/modules/repository/adopt.go @@ -129,12 +129,12 @@ func ListUnadoptedRepositories(query string, opts *models.ListOptions) ([]string var err error globUser, err = glob.Compile(qsplit[0]) if err != nil { - log.Info("Invalid glob expresion '%s' (skipped): %v", qsplit[0], err) + log.Info("Invalid glob expression '%s' (skipped): %v", qsplit[0], err) } if len(qsplit) > 1 { globRepo, err = glob.Compile(qsplit[1]) if err != nil { - log.Info("Invalid glob expresion '%s' (skipped): %v", qsplit[1], err) + log.Info("Invalid glob expression '%s' (skipped): %v", qsplit[1], err) } } } diff --git a/modules/secret/secret.go b/modules/secret/secret.go index 7a06730c39..976924ac60 100644 --- a/modules/secret/secret.go +++ b/modules/secret/secret.go @@ -17,7 +17,7 @@ import ( "code.gitea.io/gitea/modules/util" ) -// New creats a new secret +// New creates a new secret func New() (string, error) { return NewWithLength(44) } diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go index f170a8d3af..2e9d8b2883 100644 --- a/modules/setting/indexer.go +++ b/modules/setting/indexer.go @@ -101,7 +101,7 @@ func IndexerGlobFromString(globstr string) []glob.Glob { expr = strings.TrimSpace(expr) if expr != "" { if g, err := glob.Compile(expr, '.', '/'); err != nil { - log.Info("Invalid glob expresion '%s' (skipped): %v", expr, err) + log.Info("Invalid glob expression '%s' (skipped): %v", expr, err) } else { extarr = append(extarr, g) } diff --git a/modules/setting/session.go b/modules/setting/session.go index 97666c5e53..bce73b51da 100644 --- a/modules/setting/session.go +++ b/modules/setting/session.go @@ -15,7 +15,7 @@ import ( ) var ( - // SessionConfig difines Session settings + // SessionConfig defines Session settings SessionConfig = struct { Provider string // Provider configuration, it's corresponding to provider. diff --git a/modules/storage/storage.go b/modules/storage/storage.go index b3708908f8..2fe14b41ef 100644 --- a/modules/storage/storage.go +++ b/modules/storage/storage.go @@ -71,7 +71,7 @@ type ObjectStorage interface { IterateObjects(func(path string, obj Object) error) error } -// Copy copys a file from source ObjectStorage to dest ObjectStorage +// Copy copies a file from source ObjectStorage to dest ObjectStorage func Copy(dstStorage ObjectStorage, dstPath string, srcStorage ObjectStorage, srcPath string) (int64, error) { f, err := srcStorage.Open(srcPath) if err != nil { diff --git a/modules/task/migrate.go b/modules/task/migrate.go index 1d190faf87..d7655112d3 100644 --- a/modules/task/migrate.go +++ b/modules/task/migrate.go @@ -74,7 +74,7 @@ func runMigrateTask(t *models.Task) (err error) { return } - // if repository is ready, then just finsih the task + // if repository is ready, then just finish the task if t.Repo.Status == models.RepositoryReady { return nil } diff --git a/modules/typesniffer/typesniffer.go b/modules/typesniffer/typesniffer.go index 7c89f66699..d257b8179b 100644 --- a/modules/typesniffer/typesniffer.go +++ b/modules/typesniffer/typesniffer.go @@ -21,7 +21,7 @@ const SvgMimeType = "image/svg+xml" var svgTagRegex = regexp.MustCompile(`(?si)\A\s*(?:(<!--.*?-->|<!DOCTYPE\s+svg([\s:]+.*?>|>))\s*)*<svg[\s>\/]`) var svgTagInXMLRegex = regexp.MustCompile(`(?si)\A<\?xml\b.*?\?>\s*(?:(<!--.*?-->|<!DOCTYPE\s+svg([\s:]+.*?>|>))\s*)*<svg[\s>\/]`) -// SniffedType contains informations about a blobs type. +// SniffedType contains information about a blobs type. type SniffedType struct { contentType string } diff --git a/modules/util/path.go b/modules/util/path.go index 2ac8f4d80a..e79747327d 100644 --- a/modules/util/path.go +++ b/modules/util/path.go @@ -154,7 +154,7 @@ func StatDir(rootPath string, includeDir ...bool) ([]string, error) { return statDir(rootPath, "", isIncludeDir, false, false) } -// FileURLToPath extracts the path informations from a file://... url. +// FileURLToPath extracts the path information from a file://... url. func FileURLToPath(u *url.URL) (string, error) { if u.Scheme != "file" { return "", errors.New("URL scheme is not 'file': " + u.String()) diff --git a/modules/util/shellquote_test.go b/modules/util/shellquote_test.go index 2ddc6d763d..be6ba372fd 100644 --- a/modules/util/shellquote_test.go +++ b/modules/util/shellquote_test.go @@ -33,7 +33,7 @@ func TestShellEscape(t *testing.T) { "~git/Gitea v1.13/gitea", `~git/"Gitea v1.13/gitea"`, }, { - "Bangs are unforutunately not predictable so need to be singlequoted", + "Bangs are unfortunately not predictable so need to be singlequoted", "C:/Program Files/Gitea!/gitea", `'C:/Program Files/Gitea!/gitea'`, }, { @@ -41,7 +41,7 @@ func TestShellEscape(t *testing.T) { "/home/git/Gitea\n\nWHY-WOULD-YOU-DO-THIS\n\nGitea/gitea", "'/home/git/Gitea\n\nWHY-WOULD-YOU-DO-THIS\n\nGitea/gitea'", }, { - "Similarly we should nicely handle mutiple single quotes if we have to single-quote", + "Similarly we should nicely handle multiple single quotes if we have to single-quote", "'!''!'''!''!'!'", `\''!'\'\''!'\'\'\''!'\'\''!'\''!'\'`, }, { diff --git a/modules/validation/helpers.go b/modules/validation/helpers.go index 343261aac5..617ec3578c 100644 --- a/modules/validation/helpers.go +++ b/modules/validation/helpers.go @@ -92,7 +92,7 @@ func IsValidExternalURL(uri string) bool { return false } - // TODO: Later it should be added to allow local network IP addreses + // TODO: Later it should be added to allow local network IP addresses // only if allowed by special setting return true diff --git a/modules/validation/helpers_test.go b/modules/validation/helpers_test.go index cc2a4b720d..f6f897e821 100644 --- a/modules/validation/helpers_test.go +++ b/modules/validation/helpers_test.go @@ -24,12 +24,12 @@ func Test_IsValidURL(t *testing.T) { valid: false, }, { - description: "Loobpack IPv4 URL", + description: "Loopback IPv4 URL", url: "http://127.0.1.1:5678/", valid: true, }, { - description: "Loobpack IPv6 URL", + description: "Loopback IPv6 URL", url: "https://[::1]/", valid: true, }, @@ -61,7 +61,7 @@ func Test_IsValidExternalURL(t *testing.T) { valid: true, }, { - description: "Loobpack IPv4 URL", + description: "Loopback IPv4 URL", url: "http://127.0.1.1:5678/", valid: false, }, diff --git a/modules/validation/refname_test.go b/modules/validation/refname_test.go index 974d956563..2d6458b9b5 100644 --- a/modules/validation/refname_test.go +++ b/modules/validation/refname_test.go @@ -12,7 +12,7 @@ import ( var gitRefNameValidationTestCases = []validationTestCase{ { - description: "Referece contains only characters", + description: "Reference name contains only characters", data: TestForm{ BranchName: "test", }, |