mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 10:48:37 +00:00
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`
This commit is contained in:
@@ -219,7 +219,7 @@ func (protectBranch *ProtectedBranch) GetProtectedFilePatterns() []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)
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ func WithContext(f func(ctx DBContext) error) error {
|
||||
return f(DBContext{x})
|
||||
}
|
||||
|
||||
// WithTx represents executing database operations on a trasaction
|
||||
// WithTx represents executing database operations on a transaction
|
||||
func WithTx(f func(ctx DBContext) error) error {
|
||||
sess := x.NewSession()
|
||||
if err := sess.Begin(); err != nil {
|
||||
|
@@ -1114,7 +1114,7 @@ func IsErrUserDoesNotHaveAccessToRepo(err error) bool {
|
||||
}
|
||||
|
||||
func (err ErrUserDoesNotHaveAccessToRepo) Error() string {
|
||||
return fmt.Sprintf("user doesn't have acces to repo [user_id: %d, repo_name: %s]", err.UserID, err.RepoName)
|
||||
return fmt.Sprintf("user doesn't have access to repo [user_id: %d, repo_name: %s]", err.UserID, err.RepoName)
|
||||
}
|
||||
|
||||
// ErrWontSign explains the first reason why a commit would not be signed
|
||||
@@ -1289,7 +1289,7 @@ func IsErrSHAOrCommitIDNotProvided(err error) bool {
|
||||
}
|
||||
|
||||
func (err ErrSHAOrCommitIDNotProvided) Error() string {
|
||||
return "a SHA or commmit ID must be proved when updating a file"
|
||||
return "a SHA or commit ID must be proved when updating a file"
|
||||
}
|
||||
|
||||
// __ __ ___. .__ __
|
||||
|
@@ -622,7 +622,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
|
||||
var err error
|
||||
// Find Committer account
|
||||
committer, err = GetUserByEmail(c.Committer.Email) // This finds the user by primary email or activated email so commit will not be valid if email is not
|
||||
if err != nil { // Skipping not user for commiter
|
||||
if err != nil { // Skipping not user for committer
|
||||
committer = &User{
|
||||
Name: c.Committer.Name,
|
||||
Email: c.Committer.Email,
|
||||
@@ -698,7 +698,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
|
||||
}
|
||||
|
||||
for _, k := range keys {
|
||||
// Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
|
||||
// Pre-check (& optimization) that emails attached to key can be attached to the committer email and can validate
|
||||
canValidate := false
|
||||
email := ""
|
||||
for _, e := range k.Emails {
|
||||
|
@@ -184,7 +184,7 @@ type Comment struct {
|
||||
RefRepoID int64 `xorm:"index"` // Repo where the referencing
|
||||
RefIssueID int64 `xorm:"index"`
|
||||
RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's)
|
||||
RefAction references.XRefAction `xorm:"SMALLINT"` // What hapens if RefIssueID resolves
|
||||
RefAction references.XRefAction `xorm:"SMALLINT"` // What happens if RefIssueID resolves
|
||||
RefIsPull bool
|
||||
|
||||
RefRepo *Repository `xorm:"-"`
|
||||
@@ -1228,7 +1228,7 @@ func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID
|
||||
return err
|
||||
}
|
||||
|
||||
// CreatePushPullComment create push code to pull base commend
|
||||
// CreatePushPullComment create push code to pull base comment
|
||||
func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error) {
|
||||
if pr.HasMerged || oldCommitID == "" || newCommitID == "" {
|
||||
return nil, nil
|
||||
@@ -1262,7 +1262,7 @@ func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommit
|
||||
return
|
||||
}
|
||||
|
||||
// getCommitsFromRepo get commit IDs from repo in betwern oldCommitID and newCommitID
|
||||
// getCommitsFromRepo get commit IDs from repo in between oldCommitID and newCommitID
|
||||
// isForcePush will be true if oldCommit isn't on the branch
|
||||
// Commit on baseBranch will skip
|
||||
func getCommitIDsFromRepo(repo *Repository, oldCommitID, newCommitID, baseBranch string) (commitIDs []string, isForcePush bool, err error) {
|
||||
|
@@ -128,7 +128,7 @@ func issueNoDependenciesLeft(e Engine, issue *Issue) (bool, error) {
|
||||
return !exists, err
|
||||
}
|
||||
|
||||
// IsDependenciesEnabled returns if dependecies are enabled and returns the default setting if not set.
|
||||
// IsDependenciesEnabled returns if dependencies are enabled and returns the default setting if not set.
|
||||
func (repo *Repository) IsDependenciesEnabled() bool {
|
||||
return repo.isDependenciesEnabled(x)
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ func TestGetLabelsByRepoID(t *testing.T) {
|
||||
testSuccess(1, "default", []int64{1, 2})
|
||||
}
|
||||
|
||||
// Org vrsions
|
||||
// Org versions
|
||||
|
||||
func TestGetLabelInOrgByName(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
|
@@ -343,7 +343,7 @@ func CreateLoginSource(source *LoginSource) error {
|
||||
} else if has {
|
||||
return ErrLoginSourceAlreadyExist{source.Name}
|
||||
}
|
||||
// Synchronization is only aviable with LDAP for now
|
||||
// Synchronization is only available with LDAP for now
|
||||
if !source.IsLDAP() {
|
||||
source.IsSyncEnabled = false
|
||||
}
|
||||
|
@@ -187,7 +187,7 @@ var migrations = []Migration{
|
||||
// v122 -> v123
|
||||
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
|
||||
// v123 -> v124
|
||||
NewMigration("Add original informations for reactions", addReactionOriginals),
|
||||
NewMigration("Add original information for reactions", addReactionOriginals),
|
||||
// v124 -> v125
|
||||
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
|
||||
// v125 -> v126
|
||||
|
@@ -141,8 +141,8 @@ func addBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
|
||||
return perm, err
|
||||
}
|
||||
|
||||
// Prevent strangers from checking out public repo of private orginization
|
||||
// Allow user if they are collaborator of a repo within a private orginization but not a member of the orginization itself
|
||||
// Prevent strangers from checking out public repo of private organization
|
||||
// Allow user if they are collaborator of a repo within a private organization but not a member of the organization itself
|
||||
hasOrgVisible := true
|
||||
// Not SignedUser
|
||||
if user == nil {
|
||||
|
@@ -75,7 +75,7 @@ func createReviewsForCodeComments(x *xorm.Engine) error {
|
||||
RefRepoID int64 `xorm:"index"` // Repo where the referencing
|
||||
RefIssueID int64 `xorm:"index"`
|
||||
RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's)
|
||||
RefAction int `xorm:"SMALLINT"` // What hapens if RefIssueID resolves
|
||||
RefAction int `xorm:"SMALLINT"` // What happens if RefIssueID resolves
|
||||
RefIsPull bool
|
||||
}
|
||||
|
||||
|
@@ -210,7 +210,7 @@ func UpdateOAuth2Application(opts UpdateOAuth2ApplicationOptions) (*OAuth2Applic
|
||||
return nil, err
|
||||
}
|
||||
if app.UID != opts.UserID {
|
||||
return nil, fmt.Errorf("UID missmatch")
|
||||
return nil, fmt.Errorf("UID mismatch")
|
||||
}
|
||||
|
||||
app.Name = opts.Name
|
||||
@@ -376,7 +376,7 @@ func getOAuth2AuthorizationByCode(e Engine, code string) (auth *OAuth2Authorizat
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
// OAuth2Grant represents the permission of an user for a specifc application to access resources
|
||||
// OAuth2Grant represents the permission of an user for a specific application to access resources
|
||||
type OAuth2Grant struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"INDEX unique(user_application)"`
|
||||
@@ -537,7 +537,7 @@ type OAuth2Token struct {
|
||||
jwt.StandardClaims
|
||||
}
|
||||
|
||||
// ParseOAuth2Token parses a singed jwt string
|
||||
// ParseOAuth2Token parses a signed jwt string
|
||||
func ParseOAuth2Token(jwtToken string) (*OAuth2Token, error) {
|
||||
parsedToken, err := jwt.ParseWithClaims(jwtToken, &OAuth2Token{}, func(token *jwt.Token) (interface{}, error) {
|
||||
if token.Method == nil || token.Method.Alg() != oauth2.DefaultSigningKey.SigningMethod().Alg() {
|
||||
|
@@ -79,7 +79,7 @@ func (org *User) GetMembers() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// FindOrgMembersOpts represensts find org members condtions
|
||||
// FindOrgMembersOpts represensts find org members conditions
|
||||
type FindOrgMembersOpts struct {
|
||||
ListOptions
|
||||
OrgID int64
|
||||
|
@@ -1616,7 +1616,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
|
||||
sess.Close()
|
||||
|
||||
// We should always delete the files after the database transaction succeed. If
|
||||
// we delete the file but the database rollback, the repository will be borken.
|
||||
// we delete the file but the database rollback, the repository will be broken.
|
||||
|
||||
// Remove issue attachment files.
|
||||
for i := range attachmentPaths {
|
||||
|
@@ -148,11 +148,11 @@ type SearchRepoOptions struct {
|
||||
AllLimited bool // Include also all public repositories of limited organisations
|
||||
// None -> include public and private
|
||||
// True -> include just private
|
||||
// False -> incude just public
|
||||
// False -> include just public
|
||||
IsPrivate util.OptionalBool
|
||||
// None -> include collaborative AND non-collaborative
|
||||
// True -> include just collaborative
|
||||
// False -> incude just non-collaborative
|
||||
// False -> include just non-collaborative
|
||||
Collaborate util.OptionalBool
|
||||
// None -> include forks AND non-forks
|
||||
// True -> include just forks
|
||||
|
@@ -176,7 +176,7 @@ func getUserRepoPermission(e Engine, repo *Repository, user *User) (perm Permiss
|
||||
return
|
||||
}
|
||||
|
||||
// Prevent strangers from checking out public repo of private orginization/users
|
||||
// Prevent strangers from checking out public repo of private organization/users
|
||||
// Allow user if they are collaborator of a repo within a private user or a private organization but not a member of the organization itself
|
||||
if !hasOrgOrUserVisible(e, repo.Owner, user) && !isCollaborator {
|
||||
perm.AccessMode = AccessModeNone
|
||||
@@ -351,7 +351,7 @@ func hasAccessUnit(e Engine, user *User, repo *Repository, unitType UnitType, te
|
||||
return testMode <= mode, err
|
||||
}
|
||||
|
||||
// HasAccessUnit returns ture if user has testMode to the unit of the repository
|
||||
// HasAccessUnit returns true if user has testMode to the unit of the repository
|
||||
func HasAccessUnit(user *User, repo *Repository, unitType UnitType, testMode AccessMode) (bool, error) {
|
||||
return hasAccessUnit(x, user, repo, unitType, testMode)
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ func GetPushMirrorByID(ID int64) (*PushMirror, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetPushMirrorsByRepoID returns push-mirror informations of a repository.
|
||||
// GetPushMirrorsByRepoID returns push-mirror information of a repository.
|
||||
func GetPushMirrorsByRepoID(repoID int64) ([]*PushMirror, error) {
|
||||
mirrors := make([]*PushMirror, 0, 10)
|
||||
return mirrors, x.Where("repo_id=?", repoID).Find(&mirrors)
|
||||
|
@@ -466,7 +466,7 @@ func GetReviewersByIssueID(issueID int64) ([]*Review, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get latest review of each reviwer, sorted in order they were made
|
||||
// Get latest review of each reviewer, sorted in order they were made
|
||||
if err := sess.SQL("SELECT * FROM review WHERE id IN (SELECT max(id) as id FROM review WHERE issue_id = ? AND reviewer_team_id = 0 AND type in (?, ?, ?) AND dismissed = ? AND original_author_id = 0 GROUP BY issue_id, reviewer_id) ORDER BY review.updated_unix ASC",
|
||||
issueID, ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest, false).
|
||||
Find(&reviews); err != nil {
|
||||
@@ -491,7 +491,7 @@ func GetReviewersByIssueID(issueID int64) ([]*Review, error) {
|
||||
func GetReviewersFromOriginalAuthorsByIssueID(issueID int64) ([]*Review, error) {
|
||||
reviews := make([]*Review, 0, 10)
|
||||
|
||||
// Get latest review of each reviwer, sorted in order they were made
|
||||
// Get latest review of each reviewer, sorted in order they were made
|
||||
if err := x.SQL("SELECT * FROM review WHERE id IN (SELECT max(id) as id FROM review WHERE issue_id = ? AND reviewer_team_id = 0 AND type in (?, ?, ?) AND original_author_id <> 0 GROUP BY issue_id, original_author_id) ORDER BY review.updated_unix ASC",
|
||||
issueID, ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest).
|
||||
Find(&reviews); err != nil {
|
||||
|
@@ -195,7 +195,7 @@ func FindTopics(opts *FindTopicOptions) (topics []*Topic, err error) {
|
||||
return topics, sess.Desc("topic.repo_count").Find(&topics)
|
||||
}
|
||||
|
||||
// GetRepoTopicByName retrives topic from name for a repo if it exist
|
||||
// GetRepoTopicByName retrieves topic from name for a repo if it exist
|
||||
func GetRepoTopicByName(repoID int64, topicName string) (*Topic, error) {
|
||||
return getRepoTopicByName(x, repoID, topicName)
|
||||
}
|
||||
|
@@ -1631,7 +1631,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
|
||||
|
||||
// If Admin - they see all users!
|
||||
if !opts.Actor.IsAdmin {
|
||||
// Force visiblity for privacy
|
||||
// Force visibility for privacy
|
||||
var accessCond builder.Cond
|
||||
if !opts.Actor.IsRestricted {
|
||||
accessCond = builder.Or(
|
||||
@@ -1647,7 +1647,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
|
||||
}
|
||||
|
||||
} else {
|
||||
// Force visiblity for privacy
|
||||
// Force visibility for privacy
|
||||
// Not logged in - only public users
|
||||
cond = cond.And(builder.In("visibility", structs.VisibleTypePublic))
|
||||
}
|
||||
|
@@ -269,7 +269,7 @@ func MakeEmailPrimary(email *EmailAddress) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// 3. update new primay email
|
||||
// 3. update new primary email
|
||||
email.IsPrimary = true
|
||||
if _, err = sess.ID(email.ID).Cols("is_primary").Update(email); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user