Skip to content

Commit

Permalink
Fix typos in models/ and modules/ (go-gitea#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethantkoenig authored and lunny committed Mar 15, 2017
1 parent ec0ae5d commit 021904e
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion models/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func GetProtectedBranchBy(repoID int64, BranchName string) (*ProtectedBranch, er
return rel, nil
}

// GetProtectedBranches get all protected btanches
// GetProtectedBranches get all protected branches
func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error) {
protectedBranches := make([]*ProtectedBranch, 0)
return protectedBranches, x.Find(&protectedBranches, &ProtectedBranch{RepoID: repo.ID})
Expand Down
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
return nil
}

// ChangeAssignee changes the Asssignee field of this issue.
// ChangeAssignee changes the Assignee field of this issue.
func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
var oldAssigneeID = issue.AssigneeID
issue.AssigneeID = assigneeID
Expand Down
6 changes: 3 additions & 3 deletions models/issue_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ func (issues IssueList) loadPosters(e Engine) error {
return nil
}

postgerIDs := issues.getPosterIDs()
posterMaps := make(map[int64]*User, len(postgerIDs))
posterIDs := issues.getPosterIDs()
posterMaps := make(map[int64]*User, len(posterIDs))
err := e.
In("id", postgerIDs).
In("id", posterIDs).
Find(&posterMaps)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v14.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type UserV14 struct {
DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
}

// TableName will be invoked by XORM to customrize the table name
// TableName will be invoked by XORM to customize the table name
func (*UserV14) TableName() string {
return "user"
}
Expand Down
6 changes: 3 additions & 3 deletions models/org_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ func TestTeam_HasRepository(t *testing.T) {
func TestTeam_AddRepository(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())

testSucess := func(teamID, repoID int64) {
testSuccess := func(teamID, repoID int64) {
team := AssertExistsAndLoadBean(t, &Team{ID: teamID}).(*Team)
repo := AssertExistsAndLoadBean(t, &Repository{ID: repoID}).(*Repository)
assert.NoError(t, team.AddRepository(repo))
AssertExistsAndLoadBean(t, &TeamRepo{TeamID: teamID, RepoID: repoID})
CheckConsistencyFor(t, &Team{ID: teamID}, &Repository{ID: repoID})
}
testSucess(2, 3)
testSucess(2, 5)
testSuccess(2, 3)
testSuccess(2, 5)

team := AssertExistsAndLoadBean(t, &Team{ID: 1}).(*Team)
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
Expand Down
2 changes: 1 addition & 1 deletion models/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r *Release) loadAttributes(e Engine) error {
return nil
}

// LoadAttributes load repo and publisher attributes for a realease
// LoadAttributes load repo and publisher attributes for a release
func (r *Release) LoadAttributes() error {
return r.loadAttributes(x)
}
Expand Down
6 changes: 3 additions & 3 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (u *User) GetOrgRepositoryIDs() ([]int64, error) {
GroupBy("repository.id").Find(&ids)
}

// GetAccessRepoIDs returns all repsitories IDs where user's or user is a team member orgnizations
// GetAccessRepoIDs returns all repositories IDs where user's or user is a team member organizations
func (u *User) GetAccessRepoIDs() ([]int64, error) {
ids, err := u.GetRepositoryIDs()
if err != nil {
Expand Down Expand Up @@ -596,7 +596,7 @@ func (u *User) ShortName(length int) string {
return base.EllipsisString(u.Name, length)
}

// IsMailable checks if a user is elegible
// IsMailable checks if a user is eligible
// to receive emails.
func (u *User) IsMailable() bool {
return u.IsActive
Expand All @@ -615,7 +615,7 @@ func IsUserExist(uid int64, name string) (bool, error) {
Get(&User{LowerName: strings.ToLower(name)})
}

// GetUserSalt returns a ramdom user salt token.
// GetUserSalt returns a random user salt token.
func GetUserSalt() (string, error) {
return base.GetRandomString(10)
}
Expand Down
4 changes: 2 additions & 2 deletions models/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) err
// check if repo belongs to org and append additional webhooks
if repo.MustOwner().IsOrganization() {
// get hooks for org
orgws, err := GetActiveWebhooksByOrgID(repo.OwnerID)
orgHooks, err := GetActiveWebhooksByOrgID(repo.OwnerID)
if err != nil {
return fmt.Errorf("GetActiveWebhooksByOrgID: %v", err)
}
ws = append(ws, orgws...)
ws = append(ws, orgHooks...)
}

if len(ws) == 0 {
Expand Down
6 changes: 3 additions & 3 deletions modules/auth/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CreateOrgForm struct {
OrgName string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -36,7 +36,7 @@ type UpdateOrgSettingForm struct {
MaxRepoCreation int
}

// Validate valideates the fields
// Validate validates the fields
func (f *UpdateOrgSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -55,7 +55,7 @@ type CreateTeamForm struct {
Permission string
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateTeamForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
36 changes: 18 additions & 18 deletions modules/auth/repo_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type CreateRepoForm struct {
Readme string
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -50,7 +50,7 @@ type MigrateRepoForm struct {
Description string `json:"description" binding:"MaxSize(255)"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand Down Expand Up @@ -105,7 +105,7 @@ type RepoSettingForm struct {
EnablePulls bool
}

// Validate valideates the fields
// Validate validates the fields
func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand Down Expand Up @@ -149,7 +149,7 @@ type NewWebhookForm struct {
WebhookForm
}

// Validate valideates the fields
// Validate validates the fields
func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -164,7 +164,7 @@ type NewSlackHookForm struct {
WebhookForm
}

// Validate valideates the fields
// Validate validates the fields
func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -186,7 +186,7 @@ type CreateIssueForm struct {
Files []string
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateIssueForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -198,7 +198,7 @@ type CreateCommentForm struct {
Files []string
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateCommentForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -217,7 +217,7 @@ type CreateMilestoneForm struct {
Deadline string
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateMilestoneForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -236,7 +236,7 @@ type CreateLabelForm struct {
Color string `binding:"Required;Size(7)" locale:"repo.issues.label_color"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *CreateLabelForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -246,7 +246,7 @@ type InitializeLabelsForm struct {
TemplateName string `binding:"Required"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *InitializeLabelsForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -269,7 +269,7 @@ type NewReleaseForm struct {
Files []string
}

// Validate valideates the fields
// Validate validates the fields
func (f *NewReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -283,7 +283,7 @@ type EditReleaseForm struct {
Files []string
}

// Validate valideates the fields
// Validate validates the fields
func (f *EditReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -303,7 +303,7 @@ type NewWikiForm struct {
Message string
}

// Validate valideates the fields
// Validate validates the fields
// FIXME: use code generation to generate this method.
func (f *NewWikiForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
Expand All @@ -327,7 +327,7 @@ type EditRepoFileForm struct {
LastCommit string
}

// Validate valideates the fields
// Validate validates the fields
func (f *EditRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -337,7 +337,7 @@ type EditPreviewDiffForm struct {
Content string
}

// Validate valideates the fields
// Validate validates the fields
func (f *EditPreviewDiffForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -360,7 +360,7 @@ type UploadRepoFileForm struct {
Files []string
}

// Validate valideates the fields
// Validate validates the fields
func (f *UploadRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -370,7 +370,7 @@ type RemoveUploadFileForm struct {
File string `binding:"Required;MaxSize(50)"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *RemoveUploadFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -390,7 +390,7 @@ type DeleteRepoFileForm struct {
NewBranchName string `binding:"AlphaDashDot;MaxSize(100)"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *DeleteRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
14 changes: 7 additions & 7 deletions modules/auth/user_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type InstallForm struct {
AdminEmail string `binding:"OmitEmpty;MinSize(3);MaxSize(254);Include(@)" locale:"install.admin_email"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand Down Expand Up @@ -107,7 +107,7 @@ type UpdateProfileForm struct {
Location string `binding:"MaxSize(50)"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -126,7 +126,7 @@ type AvatarForm struct {
Federavatar bool
}

// Validate valideates the fields
// Validate validates the fields
func (f *AvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -136,7 +136,7 @@ type AddEmailForm struct {
Email string `binding:"Required;Email;MaxSize(254)"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *AddEmailForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -148,7 +148,7 @@ type ChangePasswordForm struct {
Retype string `form:"retype"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *ChangePasswordForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -159,7 +159,7 @@ type AddSSHKeyForm struct {
Content string `binding:"Required"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *AddSSHKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand All @@ -179,7 +179,7 @@ type TwoFactorAuthForm struct {
Passcode string `binding:"Required"`
}

// Validate valideates the fields
// Validate validates the fields
func (f *TwoFactorAuthForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/context/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
})
}

// SetLinkHeader sets pagination link header by given totol number and page size.
// SetLinkHeader sets pagination link header by given total number and page size.
func (ctx *APIContext) SetLinkHeader(total, pageSize int) {
page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0)
links := make([]string, 0, 4)
Expand Down
2 changes: 1 addition & 1 deletion modules/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func Contexter() macaron.Handler {

ctx.Data["PageStartTime"] = time.Now()

// Get user from session if logined.
// Get user from session if logged in.
ctx.User, ctx.IsBasicAuth = auth.SignedInUser(ctx.Context, ctx.Session)

if ctx.User != nil {
Expand Down
4 changes: 2 additions & 2 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type PullRequest struct {
HeadInfo string // [<user>:]<branch>
}

// Repository contains informations to operate a repository
// Repository contains information to operate a repository
type Repository struct {
AccessMode models.AccessMode
IsWatching bool
Expand Down Expand Up @@ -330,7 +330,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
}
}

// People who have push access or have fored repository can propose a new pull request.
// People who have push access or have forked repository can propose a new pull request.
if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
// Pull request is allowed if this is a fork repository
// and base repository accepts pull requests.
Expand Down
Loading

0 comments on commit 021904e

Please sign in to comment.