Fix various typos (#18219)

Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby,te,unknwon`

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
luzpaz 2022-01-10 04:32:37 -05:00 committed by GitHub
parent 242dddfcb7
commit 8c647bf0f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 40 additions and 40 deletions

View file

@ -108,7 +108,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Fix unwanted team review request deletion (#17257) (#17264) * Fix unwanted team review request deletion (#17257) (#17264)
* Fix broken Activities link in team dashboard (#17255) (#17258) * Fix broken Activities link in team dashboard (#17255) (#17258)
* API pull's head/base have correct permission(#17214) (#17245) * API pull's head/base have correct permission(#17214) (#17245)
* Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227) * Fix strange behavior of DownloadPullDiffOrPatch in incorrect index (#17223) (#17227)
* Upgrade xorm to v1.2.5 (#17177) (#17188) * Upgrade xorm to v1.2.5 (#17177) (#17188)
* Fix missing repo link in issue/pull assigned emails (#17183) (#17184) * Fix missing repo link in issue/pull assigned emails (#17183) (#17184)
* Fix bug of get context user (#17169) (#17172) * Fix bug of get context user (#17169) (#17172)

View file

@ -83,7 +83,7 @@ el.addEventListener('click', (e) => {
el.addEventListener('async', async (e) => { // not recommended but acceptable el.addEventListener('async', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable e.preventDefault(); // acceptable
await asyncFoo(); // skip out event dispath await asyncFoo(); // skip out event dispatch
e.preventDefault(); // WRONG e.preventDefault(); // WRONG
}); });
``` ```
@ -106,7 +106,7 @@ $('#el').on('click', (e) => {
$('#el').on('click', async (e) => { // not recommended but acceptable $('#el').on('click', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable e.preventDefault(); // acceptable
return false; // WRONG, jQuery expects the returned value is a boolean, not a Promise return false; // WRONG, jQuery expects the returned value is a boolean, not a Promise
await asyncFoo(); // skip out event dispath await asyncFoo(); // skip out event dispatch
return false; // WRONG return false; // WRONG
}); });
``` ```

View file

@ -34,7 +34,7 @@ import (
// |____|__ \___ > ____| |____| (____ /__| /____ >\___ >__| // |____|__ \___ > ____| |____| (____ /__| /____ >\___ >__|
// \/ \/\/ \/ \/ \/ // \/ \/\/ \/ \/ \/
// //
// This file contains functiosn for parsing ssh-keys // This file contains functions for parsing ssh-keys
// //
// TODO: Consider if these functions belong in models - no other models function call them or are called by them // TODO: Consider if these functions belong in models - no other models function call them or are called by them
// They may belong in a service or a module // They may belong in a service or a module

View file

@ -183,7 +183,7 @@ func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_
// CreateOrUpdateIssueNotifications creates an issue notification // CreateOrUpdateIssueNotifications creates an issue notification
// for each watcher, or updates it if already exists // for each watcher, or updates it if already exists
// receiverID > 0 just send to reciver, else send to all watcher // receiverID > 0 just send to receiver, else send to all watcher
func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error { func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error {
ctx, committer, err := db.TxContext() ctx, committer, err := db.TxContext()
if err != nil { if err != nil {

View file

@ -534,7 +534,7 @@ func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_
if isAdmin, err := isUserRepoAdmin(db.GetEngine(ctx), repo, doer); err != nil { if isAdmin, err := isUserRepoAdmin(db.GetEngine(ctx), repo, doer); err != nil {
return fmt.Errorf("isUserRepoAdmin: %v", err) return fmt.Errorf("isUserRepoAdmin: %v", err)
} else if !isAdmin { } else if !isAdmin {
// Make creator repo admin if it wan't assigned automatically // Make creator repo admin if it wasn't assigned automatically
if err = addCollaborator(ctx, repo, doer); err != nil { if err = addCollaborator(ctx, repo, doer); err != nil {
return fmt.Errorf("AddCollaborator: %v", err) return fmt.Errorf("AddCollaborator: %v", err)
} }

View file

@ -535,7 +535,7 @@ func getReviewByIssueIDAndUserID(e db.Engine, issueID, userID int64) (*Review, e
return review, nil return review, nil
} }
// GetTeamReviewerByIssueIDAndTeamID get the latest review requst of reviewer team for a pull request // GetTeamReviewerByIssueIDAndTeamID get the latest review request of reviewer team for a pull request
func GetTeamReviewerByIssueIDAndTeamID(issueID, teamID int64) (review *Review, err error) { func GetTeamReviewerByIssueIDAndTeamID(issueID, teamID int64) (review *Review, err error) {
return getTeamReviewerByIssueIDAndTeamID(db.GetEngine(db.DefaultContext), issueID, teamID) return getTeamReviewerByIssueIDAndTeamID(db.GetEngine(db.DefaultContext), issueID, teamID)
} }

View file

@ -84,7 +84,7 @@ Origin: An image is splitted into 9 areas
Area 1/3/9/7 use a 90-degree rotating pattern. Area 1/3/9/7 use a 90-degree rotating pattern.
Area 1/3/9/7 use another 90-degree rotating pattern. Area 1/3/9/7 use another 90-degree rotating pattern.
Area 5 uses a random patter. Area 5 uses a random pattern.
The Patched Fix: make the image left-right mirrored to get rid of something like "swastika" The Patched Fix: make the image left-right mirrored to get rid of something like "swastika"
*/ */

View file

@ -223,7 +223,7 @@ c;d;#`,
// case 13 - tab delimited with commas in values // case 13 - tab delimited with commas in values
{ {
csv: `name email note csv: `name email note
John Doe john@doe.com This,note,had,a,lot,of,commas,to,test,delimters`, John Doe john@doe.com This,note,had,a,lot,of,commas,to,test,delimiters`,
filename: "", filename: "",
expectedDelimiter: '\t', expectedDelimiter: '\t',
}, },
@ -240,7 +240,7 @@ func TestRemoveQuotedString(t *testing.T) {
text string text string
expectedText string expectedText string
}{ }{
// case 0 - quoted text with escpaed quotes in 1st column // case 0 - quoted text with escaped quotes in 1st column
{ {
text: `col1,col2,col3 text: `col1,col2,col3
"quoted ""text"" with "quoted ""text"" with
@ -249,7 +249,7 @@ in first column",b,c`,
expectedText: `col1,col2,col3 expectedText: `col1,col2,col3
,b,c`, ,b,c`,
}, },
// case 1 - quoted text with escpaed quotes in 2nd column // case 1 - quoted text with escaped quotes in 2nd column
{ {
text: `col1,col2,col3 text: `col1,col2,col3
a,"quoted ""text"" with a,"quoted ""text"" with
@ -258,7 +258,7 @@ in second column",c`,
expectedText: `col1,col2,col3 expectedText: `col1,col2,col3
a,,c`, a,,c`,
}, },
// case 2 - quoted text with escpaed quotes in last column // case 2 - quoted text with escaped quotes in last column
{ {
text: `col1,col2,col3 text: `col1,col2,col3
a,b,"quoted ""text"" with a,b,"quoted ""text"" with
@ -351,7 +351,7 @@ c;d`,
// case 8 - tab delimited with commas in value // case 8 - tab delimited with commas in value
{ {
csv: `name email note csv: `name email note
John Doe john@doe.com This,note,had,a,lot,of,commas,to,test,delimters`, John Doe john@doe.com This,note,had,a,lot,of,commas,to,test,delimiters`,
expectedDelimiter: '\t', expectedDelimiter: '\t',
}, },
// case 9 - tab delimited with new lines in values, commas in values // case 9 - tab delimited with new lines in values, commas in values
@ -431,7 +431,7 @@ skxg,t,vay,d,wug,d,xg,sexc rt g,ag,mjq,fjnyji,iwa,m,ml,b,ua,b,qjxeoc be,s,sh,n,j
csv: "col1@col2@col3\na@b@" + strings.Repeat("c", 6000) + "\nd,e," + strings.Repeat("f", 4000), csv: "col1@col2@col3\na@b@" + strings.Repeat("c", 6000) + "\nd,e," + strings.Repeat("f", 4000),
expectedDelimiter: '@', expectedDelimiter: '@',
}, },
// case 16 - has all delimters so should return comma // case 16 - has all delimiters so should return comma
{ {
csv: `col1,col2;col3@col4|col5 col6 csv: `col1,col2;col3@col4|col5 col6
a b|c@d;e,f`, a b|c@d;e,f`,

View file

@ -297,7 +297,7 @@ func fixBrokenRepoUnits16961(logger log.Logger, autofix bool) error {
) )
if err != nil { if err != nil {
logger.Critical("Unable to iterate acrosss repounits to fix the broken units: Error %v", err) logger.Critical("Unable to iterate across repounits to fix the broken units: Error %v", err)
return err return err
} }

View file

@ -16,7 +16,7 @@ const BranchPrefix = "refs/heads/"
// AGit Flow // AGit Flow
// PullRequestPrefix sepcial ref to create a pull request: refs/for/<targe-branch>/<topic-branch> // PullRequestPrefix special ref to create a pull request: refs/for/<targe-branch>/<topic-branch>
// or refs/for/<targe-branch> -o topic='<topic-branch>' // or refs/for/<targe-branch> -o topic='<topic-branch>'
const PullRequestPrefix = "refs/for/" const PullRequestPrefix = "refs/for/"

View file

@ -65,7 +65,7 @@ func (n NullDownloader) GetReviews(pullRequestContext IssueContext) ([]*Review,
return nil, &ErrNotSupported{Entity: "Reviews"} return nil, &ErrNotSupported{Entity: "Reviews"}
} }
// FormatCloneURL add authentification into remote URLs // FormatCloneURL add authentication into remote URLs
func (n NullDownloader) FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error) { func (n NullDownloader) FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error) {
if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 { if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 {
u, err := url.Parse(remoteAddr) u, err := url.Parse(remoteAddr)

View file

@ -79,7 +79,7 @@ func (pm *Manager) AddContext(parent context.Context, description string) (ctx c
} }
// AddContextTimeout creates a new context and add it as a process. Once the process is finished, finished must be called // AddContextTimeout creates a new context and add it as a process. Once the process is finished, finished must be called
// to remove the process from the process table. It should not be called until the process is finsihed but must always be called. // to remove the process from the process table. It should not be called until the process is finished but must always be called.
// //
// cancel should be used to cancel the returned context, however it will not remove the process from the process table. // cancel should be used to cancel the returned context, however it will not remove the process from the process table.
// finished will cancel the returned context and remove it from the process table. // finished will cancel the returned context and remove it from the process table.

View file

@ -21,7 +21,7 @@ import (
"code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
) )
// GlobalModTime provide a gloabl mod time for embedded asset files // GlobalModTime provide a global mod time for embedded asset files
func GlobalModTime(filename string) time.Time { func GlobalModTime(filename string) time.Time {
return timeutil.GetExecutableModTime() return timeutil.GetExecutableModTime()
} }

View file

@ -17,7 +17,7 @@ type Organization struct {
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"` RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
} }
// OrganizationPermissions list differents users permissions on an organization // OrganizationPermissions list different users permissions on an organization
type OrganizationPermissions struct { type OrganizationPermissions struct {
IsOwner bool `json:"is_owner"` IsOwner bool `json:"is_owner"`
IsAdmin bool `json:"is_admin"` IsAdmin bool `json:"is_admin"`

View file

@ -110,7 +110,7 @@ type CreateRepoOption struct {
Private bool `json:"private"` Private bool `json:"private"`
// Label-Set to use // Label-Set to use
IssueLabels string `json:"issue_labels"` IssueLabels string `json:"issue_labels"`
// Whether the repository should be auto-intialized? // Whether the repository should be auto-initialized?
AutoInit bool `json:"auto_init"` AutoInit bool `json:"auto_init"`
// Whether the repository is template // Whether the repository is template
Template bool `json:"template"` Template bool `json:"template"`

View file

@ -28,7 +28,7 @@ var (
bodyTemplates = template.New("") bodyTemplates = template.New("")
) )
// GlobalModTime provide a gloabl mod time for embedded asset files // GlobalModTime provide a global mod time for embedded asset files
func GlobalModTime(filename string) time.Time { func GlobalModTime(filename string) time.Time {
return timeutil.GetExecutableModTime() return timeutil.GetExecutableModTime()
} }

View file

@ -68,7 +68,7 @@ func UpdateRemoteVersion(version string) (err error) {
return appstate.AppState.Set(&CheckerState{LatestVersion: version}) return appstate.AppState.Set(&CheckerState{LatestVersion: version})
} }
// GetRemoteVersion returns the current remote version (or currently installed verson if fail to fetch from DB) // GetRemoteVersion returns the current remote version (or currently installed version if fail to fetch from DB)
func GetRemoteVersion() string { func GetRemoteVersion() string {
item := new(CheckerState) item := new(CheckerState)
if err := appstate.AppState.Get(item); err != nil { if err := appstate.AppState.Get(item); err != nil {

View file

@ -6,4 +6,4 @@ Noweb is available free for any use in any field of endeavor. You may redistribu
You may sell noweb if you wish. For example, you may sell a CD-ROM including noweb. You may sell noweb if you wish. For example, you may sell a CD-ROM including noweb.
You may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permisson for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you. You may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permission for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you.

View file

@ -405,7 +405,7 @@ func createOrUpdateFile(ctx *context.APIContext, opts *files_service.UpdateRepoF
return files_service.CreateOrUpdateRepoFile(ctx.Repo.Repository, ctx.User, opts) return files_service.CreateOrUpdateRepoFile(ctx.Repo.Repository, ctx.User, opts)
} }
// DeleteFile Delete a fle in a repository // DeleteFile Delete a file in a repository
func DeleteFile(ctx *context.APIContext) { func DeleteFile(ctx *context.APIContext) {
// swagger:operation DELETE /repos/{owner}/{repo}/contents/{filepath} repository repoDeleteFile // swagger:operation DELETE /repos/{owner}/{repo}/contents/{filepath} repository repoDeleteFile
// --- // ---

View file

@ -404,7 +404,7 @@ func preReceivePullRequest(ctx *preReceiveContext, oldCommitID, newCommitID, ref
if ctx.opts.IsWiki { if ctx.opts.IsWiki {
ctx.JSON(http.StatusForbidden, map[string]interface{}{ ctx.JSON(http.StatusForbidden, map[string]interface{}{
"err": "Pull requests are not suppported on the wiki.", "err": "Pull requests are not supported on the wiki.",
}) })
return return
} }

View file

@ -1024,7 +1024,7 @@ func NewIssuePost(ctx *context.Context) {
} }
} }
// roleDescriptor returns the Role Decriptor for a comment in/with the given repo, poster and issue // roleDescriptor returns the Role Descriptor for a comment in/with the given repo, poster and issue
func roleDescriptor(repo *repo_model.Repository, poster *user_model.User, issue *models.Issue) (models.RoleDescriptor, error) { func roleDescriptor(repo *repo_model.Repository, poster *user_model.User, issue *models.Issue) (models.RoleDescriptor, error) {
perm, err := models.GetUserRepoPermission(repo, poster) perm, err := models.GetUserRepoPermission(repo, poster)
if err != nil { if err != nil {

View file

@ -268,7 +268,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
return results return results
} }
// UserNameChanged hanle user name change for agit flow pull // UserNameChanged handle user name change for agit flow pull
func UserNameChanged(user *user_model.User, newName string) error { func UserNameChanged(user *user_model.User, newName string) error {
pulls, err := models.GetAllUnmergedAgitPullRequestByPoster(user.ID) pulls, err := models.GetAllUnmergedAgitPullRequestByPoster(user.ID)
if err != nil { if err != nil {

View file

@ -880,7 +880,7 @@ parsingLoop:
// Handle ambiguous filenames // Handle ambiguous filenames
if curFile.IsAmbiguous { if curFile.IsAmbiguous {
// The shortest string that can end up here is: // The shortest string that can end up here is:
// "--- a\t\n" without the qoutes. // "--- a\t\n" without the quotes.
// This line has a len() of 7 but doesn't contain a oldName. // This line has a len() of 7 but doesn't contain a oldName.
// So the amount that the line need is at least 8 or more. // So the amount that the line need is at least 8 or more.
// The code will otherwise panic for a out-of-bounds. // The code will otherwise panic for a out-of-bounds.

View file

@ -64,7 +64,7 @@ type codebaseUser struct {
Email string `json:"email"` Email string `json:"email"`
} }
// CodebaseDownloader implements a Downloader interface to get repository informations // CodebaseDownloader implements a Downloader interface to get repository information
// from Codebase // from Codebase
type CodebaseDownloader struct { type CodebaseDownloader struct {
base.NullDownloader base.NullDownloader
@ -111,7 +111,7 @@ func NewCodebaseDownloader(ctx context.Context, projectURL *url.URL, project, re
return downloader return downloader
} }
// FormatCloneURL add authentification into remote URLs // FormatCloneURL add authentication into remote URLs
func (d *CodebaseDownloader) FormatCloneURL(opts base.MigrateOptions, remoteAddr string) (string, error) { func (d *CodebaseDownloader) FormatCloneURL(opts base.MigrateOptions, remoteAddr string) (string, error) {
return opts.CloneAddr, nil return opts.CloneAddr, nil
} }

View file

@ -254,7 +254,7 @@ func (g *GogsDownloader) GetTopics() ([]string, error) {
return []string{}, nil return []string{}, nil
} }
// FormatCloneURL add authentification into remote URLs // FormatCloneURL add authentication into remote URLs
func (g *GogsDownloader) FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error) { func (g *GogsDownloader) FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error) {
if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 { if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 {
u, err := url.Parse(remoteAddr) u, err := url.Parse(remoteAddr)

View file

@ -69,7 +69,7 @@ type onedevUser struct {
Email string `json:"email"` Email string `json:"email"`
} }
// OneDevDownloader implements a Downloader interface to get repository informations // OneDevDownloader implements a Downloader interface to get repository information
// from OneDev // from OneDev
type OneDevDownloader struct { type OneDevDownloader struct {
base.NullDownloader base.NullDownloader

View file

@ -437,7 +437,7 @@ func rawMerge(pr *models.PullRequest, doer *user_model.User, mergeStyle repo_mod
var pushCmd *git.Command var pushCmd *git.Command
if mergeStyle == repo_model.MergeStyleRebaseUpdate { if mergeStyle == repo_model.MergeStyleRebaseUpdate {
// force push the rebase result to head brach // force push the rebase result to head branch
pushCmd = git.NewCommand("push", "-f", "head_repo", stagingBranch+":"+git.BranchPrefix+pr.HeadBranch) pushCmd = git.NewCommand("push", "-f", "head_repo", stagingBranch+":"+git.BranchPrefix+pr.HeadBranch)
} else { } else {
pushCmd = git.NewCommand("push", "origin", baseBranch+":"+git.BranchPrefix+pr.BaseBranch) pushCmd = git.NewCommand("push", "origin", baseBranch+":"+git.BranchPrefix+pr.BaseBranch)

View file

@ -252,7 +252,7 @@ func Init() error {
} }
log.Trace("ArchiverData Process: %#v", archiveReq) log.Trace("ArchiverData Process: %#v", archiveReq)
if _, err := doArchive(archiveReq); err != nil { if _, err := doArchive(archiveReq); err != nil {
log.Error("Archive %v faild: %v", datum, err) log.Error("Archive %v failed: %v", datum, err)
} }
} }
} }

View file

@ -190,7 +190,7 @@ func TestRepository_EditWikiPage(t *testing.T) {
wikiPath := NameToFilename(newWikiName) wikiPath := NameToFilename(newWikiName)
entry, err := masterTree.GetTreeEntryByPath(wikiPath) entry, err := masterTree.GetTreeEntryByPath(wikiPath)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, wikiPath, entry.Name(), "%s not editted correctly", newWikiName) assert.Equal(t, wikiPath, entry.Name(), "%s not edited correctly", newWikiName)
if newWikiName != "Home" { if newWikiName != "Home" {
_, err := masterTree.GetTreeEntryByPath("Home.md") _, err := masterTree.GetTreeEntryByPath("Home.md")
@ -243,7 +243,7 @@ func TestPrepareWikiFileName(t *testing.T) {
wikiPath: "home-of-and-%26-or-wiki-page%21.md", wikiPath: "home-of-and-%26-or-wiki-page%21.md",
wantErr: false, wantErr: false,
}, { }, {
name: "fount unescaped cases", name: "found unescaped cases",
arg: "Unescaped File", arg: "Unescaped File",
existence: true, existence: true,
wikiPath: "Unescaped File.md", wikiPath: "Unescaped File.md",

View file

@ -46,7 +46,7 @@
]).values()), ]).values()),
{{end}} {{end}}
mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}}, mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},
{{/* this global i18n object should only contain gereral texts. for specalized texts, it should be provied inside the related modules by: (1) API response (2) HTML data-attribute (3) PageData */}} {{/* this global i18n object should only contain general texts. for specialized texts, it should be provided inside the related modules by: (1) API response (2) HTML data-attribute (3) PageData */}}
i18n: { i18n: {
copy_success: '{{.i18n.Tr "copy_success"}}', copy_success: '{{.i18n.Tr "copy_success"}}',
copy_error: '{{.i18n.Tr "copy_error"}}', copy_error: '{{.i18n.Tr "copy_error"}}',

View file

@ -13893,7 +13893,7 @@
], ],
"properties": { "properties": {
"auto_init": { "auto_init": {
"description": "Whether the repository should be auto-intialized?", "description": "Whether the repository should be auto-initialized?",
"type": "boolean", "type": "boolean",
"x-go-name": "AutoInit" "x-go-name": "AutoInit"
}, },
@ -16400,7 +16400,7 @@
"x-go-package": "code.gitea.io/gitea/modules/structs" "x-go-package": "code.gitea.io/gitea/modules/structs"
}, },
"OrganizationPermissions": { "OrganizationPermissions": {
"description": "OrganizationPermissions list differents users permissions on an organization", "description": "OrganizationPermissions list different users permissions on an organization",
"type": "object", "type": "object",
"properties": { "properties": {
"can_create_repository": { "can_create_repository": {