Skip to content

Commit 021904e

Browse files
ethantkoeniglunny
authored andcommitted
Fix typos in models/ and modules/ (#1248)
1 parent ec0ae5d commit 021904e

26 files changed

+63
-63
lines changed

models/branches.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func GetProtectedBranchBy(repoID int64, BranchName string) (*ProtectedBranch, er
5757
return rel, nil
5858
}
5959

60-
// GetProtectedBranches get all protected btanches
60+
// GetProtectedBranches get all protected branches
6161
func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error) {
6262
protectedBranches := make([]*ProtectedBranch, 0)
6363
return protectedBranches, x.Find(&protectedBranches, &ProtectedBranch{RepoID: repo.ID})

models/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
733733
return nil
734734
}
735735

736-
// ChangeAssignee changes the Asssignee field of this issue.
736+
// ChangeAssignee changes the Assignee field of this issue.
737737
func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
738738
var oldAssigneeID = issue.AssigneeID
739739
issue.AssigneeID = assigneeID

models/issue_list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ func (issues IssueList) loadPosters(e Engine) error {
5959
return nil
6060
}
6161

62-
postgerIDs := issues.getPosterIDs()
63-
posterMaps := make(map[int64]*User, len(postgerIDs))
62+
posterIDs := issues.getPosterIDs()
63+
posterMaps := make(map[int64]*User, len(posterIDs))
6464
err := e.
65-
In("id", postgerIDs).
65+
In("id", posterIDs).
6666
Find(&posterMaps)
6767
if err != nil {
6868
return err

models/migrations/v14.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type UserV14 struct {
2828
DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
2929
}
3030

31-
// TableName will be invoked by XORM to customrize the table name
31+
// TableName will be invoked by XORM to customize the table name
3232
func (*UserV14) TableName() string {
3333
return "user"
3434
}

models/org_team_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ func TestTeam_HasRepository(t *testing.T) {
117117
func TestTeam_AddRepository(t *testing.T) {
118118
assert.NoError(t, PrepareTestDatabase())
119119

120-
testSucess := func(teamID, repoID int64) {
120+
testSuccess := func(teamID, repoID int64) {
121121
team := AssertExistsAndLoadBean(t, &Team{ID: teamID}).(*Team)
122122
repo := AssertExistsAndLoadBean(t, &Repository{ID: repoID}).(*Repository)
123123
assert.NoError(t, team.AddRepository(repo))
124124
AssertExistsAndLoadBean(t, &TeamRepo{TeamID: teamID, RepoID: repoID})
125125
CheckConsistencyFor(t, &Team{ID: teamID}, &Repository{ID: repoID})
126126
}
127-
testSucess(2, 3)
128-
testSucess(2, 5)
127+
testSuccess(2, 3)
128+
testSuccess(2, 5)
129129

130130
team := AssertExistsAndLoadBean(t, &Team{ID: 1}).(*Team)
131131
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)

models/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (r *Release) loadAttributes(e Engine) error {
7373
return nil
7474
}
7575

76-
// LoadAttributes load repo and publisher attributes for a realease
76+
// LoadAttributes load repo and publisher attributes for a release
7777
func (r *Release) LoadAttributes() error {
7878
return r.loadAttributes(x)
7979
}

models/user.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ func (u *User) GetOrgRepositoryIDs() ([]int64, error) {
541541
GroupBy("repository.id").Find(&ids)
542542
}
543543

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

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

618-
// GetUserSalt returns a ramdom user salt token.
618+
// GetUserSalt returns a random user salt token.
619619
func GetUserSalt() (string, error) {
620620
return base.GetRandomString(10)
621621
}

models/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,11 @@ func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) err
475475
// check if repo belongs to org and append additional webhooks
476476
if repo.MustOwner().IsOrganization() {
477477
// get hooks for org
478-
orgws, err := GetActiveWebhooksByOrgID(repo.OwnerID)
478+
orgHooks, err := GetActiveWebhooksByOrgID(repo.OwnerID)
479479
if err != nil {
480480
return fmt.Errorf("GetActiveWebhooksByOrgID: %v", err)
481481
}
482-
ws = append(ws, orgws...)
482+
ws = append(ws, orgHooks...)
483483
}
484484

485485
if len(ws) == 0 {

modules/auth/org.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type CreateOrgForm struct {
2121
OrgName string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"`
2222
}
2323

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

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

58-
// Validate valideates the fields
58+
// Validate validates the fields
5959
func (f *CreateTeamForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
6060
return validate(errs, ctx.Data, f, ctx.Locale)
6161
}

modules/auth/repo_form.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type CreateRepoForm struct {
3333
Readme string
3434
}
3535

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

53-
// Validate valideates the fields
53+
// Validate validates the fields
5454
func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
5555
return validate(errs, ctx.Data, f, ctx.Locale)
5656
}
@@ -105,7 +105,7 @@ type RepoSettingForm struct {
105105
EnablePulls bool
106106
}
107107

108-
// Validate valideates the fields
108+
// Validate validates the fields
109109
func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
110110
return validate(errs, ctx.Data, f, ctx.Locale)
111111
}
@@ -149,7 +149,7 @@ type NewWebhookForm struct {
149149
WebhookForm
150150
}
151151

152-
// Validate valideates the fields
152+
// Validate validates the fields
153153
func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
154154
return validate(errs, ctx.Data, f, ctx.Locale)
155155
}
@@ -164,7 +164,7 @@ type NewSlackHookForm struct {
164164
WebhookForm
165165
}
166166

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

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

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

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

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

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

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

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

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

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

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

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

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

393-
// Validate valideates the fields
393+
// Validate validates the fields
394394
func (f *DeleteRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
395395
return validate(errs, ctx.Data, f, ctx.Locale)
396396
}

modules/auth/user_form.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type InstallForm struct {
5353
AdminEmail string `binding:"OmitEmpty;MinSize(3);MaxSize(254);Include(@)" locale:"install.admin_email"`
5454
}
5555

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

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

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

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

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

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

182-
// Validate valideates the fields
182+
// Validate validates the fields
183183
func (f *TwoFactorAuthForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
184184
return validate(errs, ctx.Data, f, ctx.Locale)
185185
}

modules/context/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
4343
})
4444
}
4545

46-
// SetLinkHeader sets pagination link header by given totol number and page size.
46+
// SetLinkHeader sets pagination link header by given total number and page size.
4747
func (ctx *APIContext) SetLinkHeader(total, pageSize int) {
4848
page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0)
4949
links := make([]string, 0, 4)

modules/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func Contexter() macaron.Handler {
164164

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

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

170170
if ctx.User != nil {

modules/context/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PullRequest struct {
2727
HeadInfo string // [<user>:]<branch>
2828
}
2929

30-
// Repository contains informations to operate a repository
30+
// Repository contains information to operate a repository
3131
type Repository struct {
3232
AccessMode models.AccessMode
3333
IsWatching bool
@@ -330,7 +330,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
330330
}
331331
}
332332

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

0 commit comments

Comments
 (0)