Skip to content

Commit 9b2536b

Browse files
authored
Update misspell to 0.5.1 and add misspellings.csv (#30573)
Misspell 0.5.0 supports passing a csv file to extend the list of misspellings, so I added some common ones from the codebase. There is at least one typo in a API response so we need to decided whether to revert that and then likely remove the dict entry.
1 parent dcc3c17 commit 9b2536b

File tree

34 files changed

+103
-82
lines changed

34 files changed

+103
-82
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-che
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
33-
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.4.1
33+
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.5.1
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@db51e79a0e37c572d8b59ae0c58bf2bbbbe53285
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
@@ -397,11 +397,11 @@ lint-md: node_modules
397397

398398
.PHONY: lint-spell
399399
lint-spell:
400-
@go run $(MISSPELL_PACKAGE) -error $(SPELLCHECK_FILES)
400+
@go run $(MISSPELL_PACKAGE) -dict tools/misspellings.csv -error $(SPELLCHECK_FILES)
401401

402402
.PHONY: lint-spell-fix
403403
lint-spell-fix:
404-
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
404+
@go run $(MISSPELL_PACKAGE) -dict tools/misspellings.csv -w $(SPELLCHECK_FILES)
405405

406406
.PHONY: lint-go
407407
lint-go:

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ Defaultly every storage has their default base path like below
13221322
| actions_log | actions_log/ |
13231323
| actions_artifacts | actions_artifacts/ |
13241324

1325-
And bucket, basepath or `SERVE_DIRECT` could be special or overrided, if you want to use a different you can:
1325+
And bucket, basepath or `SERVE_DIRECT` could be special or overridden, if you want to use a different you can:
13261326

13271327
```ini
13281328
[storage.actions_log]

models/actions/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID strin
262262

263263
// InsertRun inserts a run
264264
func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWorkflow) error {
265-
ctx, commiter, err := db.TxContext(ctx)
265+
ctx, committer, err := db.TxContext(ctx)
266266
if err != nil {
267267
return err
268268
}
269-
defer commiter.Close()
269+
defer committer.Close()
270270

271271
index, err := db.GetNextResourceIndex(ctx, "action_run_index", run.RepoID)
272272
if err != nil {
@@ -331,7 +331,7 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
331331
}
332332
}
333333

334-
return commiter.Commit()
334+
return committer.Commit()
335335
}
336336

337337
func GetRunByID(ctx context.Context, id int64) (*ActionRun, error) {

models/actions/task.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ func GetRunningTaskByToken(ctx context.Context, token string) (*ActionTask, erro
216216
}
217217

218218
func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask, bool, error) {
219-
ctx, commiter, err := db.TxContext(ctx)
219+
ctx, committer, err := db.TxContext(ctx)
220220
if err != nil {
221221
return nil, false, err
222222
}
223-
defer commiter.Close()
223+
defer committer.Close()
224224

225225
e := db.GetEngine(ctx)
226226

@@ -322,7 +322,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
322322

323323
task.Job = job
324324

325-
if err := commiter.Commit(); err != nil {
325+
if err := committer.Commit(); err != nil {
326326
return nil, false, err
327327
}
328328

@@ -347,11 +347,11 @@ func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionT
347347
stepStates[v.Id] = v
348348
}
349349

350-
ctx, commiter, err := db.TxContext(ctx)
350+
ctx, committer, err := db.TxContext(ctx)
351351
if err != nil {
352352
return nil, err
353353
}
354-
defer commiter.Close()
354+
defer committer.Close()
355355

356356
e := db.GetEngine(ctx)
357357

@@ -412,7 +412,7 @@ func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionT
412412
}
413413
}
414414

415-
if err := commiter.Commit(); err != nil {
415+
if err := committer.Commit(); err != nil {
416416
return nil, err
417417
}
418418

models/actions/tasks_version.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
// ActionTasksVersion
1515
// If both ownerID and repoID is zero, its scope is global.
16-
// If ownerID is not zero and repoID is zero, its scope is org (there is no user-level runner currrently).
16+
// If ownerID is not zero and repoID is zero, its scope is org (there is no user-level runner currently).
1717
// If ownerID is zero and repoID is not zero, its scope is repo.
1818
type ActionTasksVersion struct {
1919
ID int64 `xorm:"pk autoincr"`
@@ -73,11 +73,11 @@ func increaseTasksVersionByScope(ctx context.Context, ownerID, repoID int64) err
7373
}
7474

7575
func IncreaseTaskVersion(ctx context.Context, ownerID, repoID int64) error {
76-
ctx, commiter, err := db.TxContext(ctx)
76+
ctx, committer, err := db.TxContext(ctx)
7777
if err != nil {
7878
return err
7979
}
80-
defer commiter.Close()
80+
defer committer.Close()
8181

8282
// 1. increase global
8383
if err := increaseTasksVersionByScope(ctx, 0, 0); err != nil {
@@ -101,5 +101,5 @@ func IncreaseTaskVersion(ctx context.Context, ownerID, repoID int64) error {
101101
}
102102
}
103103

104-
return commiter.Commit()
104+
return committer.Commit()
105105
}

models/fixtures/pull_request.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-
22
id: 1
33
type: 0 # gitea pull request
4-
status: 2 # mergable
4+
status: 2 # mergeable
55
issue_id: 2
66
index: 2
77
head_repo_id: 1
@@ -16,7 +16,7 @@
1616
-
1717
id: 2
1818
type: 0 # gitea pull request
19-
status: 2 # mergable
19+
status: 2 # mergeable
2020
issue_id: 3
2121
index: 3
2222
head_repo_id: 1
@@ -29,7 +29,7 @@
2929
-
3030
id: 3
3131
type: 0 # gitea pull request
32-
status: 2 # mergable
32+
status: 2 # mergeable
3333
issue_id: 8
3434
index: 1
3535
head_repo_id: 11
@@ -42,7 +42,7 @@
4242
-
4343
id: 4
4444
type: 0 # gitea pull request
45-
status: 2 # mergable
45+
status: 2 # mergeable
4646
issue_id: 9
4747
index: 1
4848
head_repo_id: 48
@@ -55,7 +55,7 @@
5555
-
5656
id: 5 # this PR is outdated (one commit behind branch1 )
5757
type: 0 # gitea pull request
58-
status: 2 # mergable
58+
status: 2 # mergeable
5959
issue_id: 11
6060
index: 5
6161
head_repo_id: 1
@@ -68,7 +68,7 @@
6868
-
6969
id: 6
7070
type: 0 # gitea pull request
71-
status: 2 # mergable
71+
status: 2 # mergeable
7272
issue_id: 12
7373
index: 2
7474
head_repo_id: 3
@@ -81,7 +81,7 @@
8181
-
8282
id: 7
8383
type: 0 # gitea pull request
84-
status: 2 # mergable
84+
status: 2 # mergeable
8585
issue_id: 19
8686
index: 1
8787
head_repo_id: 58
@@ -94,7 +94,7 @@
9494
-
9595
id: 8
9696
type: 0 # gitea pull request
97-
status: 2 # mergable
97+
status: 2 # mergeable
9898
issue_id: 20
9999
index: 1
100100
head_repo_id: 23
@@ -103,7 +103,7 @@
103103
-
104104
id: 9
105105
type: 0 # gitea pull request
106-
status: 2 # mergable
106+
status: 2 # mergeable
107107
issue_id: 21
108108
index: 1
109109
head_repo_id: 60
@@ -112,7 +112,7 @@
112112
-
113113
id: 10
114114
type: 0 # gitea pull request
115-
status: 2 # mergable
115+
status: 2 # mergeable
116116
issue_id: 22
117117
index: 1
118118
head_repo_id: 61

models/issues/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error {
807807

808808
// Mergeable returns if the pullrequest is mergeable.
809809
func (pr *PullRequest) Mergeable(ctx context.Context) bool {
810-
// If a pull request isn't mergable if it's:
810+
// If a pull request isn't mergeable if it's:
811811
// - Being conflict checked.
812812
// - Has a conflict.
813813
// - Received a error while being conflict checked.

models/issues/tracked_time.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ func AddTime(ctx context.Context, user *user_model.User, issue *Issue, amount in
187187
Issue: issue,
188188
Repo: issue.Repo,
189189
Doer: user,
190-
// Content before v1.21 did store the formated string instead of seconds,
191-
// so use "|" as delimeter to mark the new format
190+
// Content before v1.21 did store the formatted string instead of seconds,
191+
// so use "|" as delimiter to mark the new format
192192
Content: fmt.Sprintf("|%d", amount),
193193
Type: CommentTypeAddTimeManual,
194194
TimeID: t.ID,
@@ -267,8 +267,8 @@ func DeleteIssueUserTimes(ctx context.Context, issue *Issue, user *user_model.Us
267267
Issue: issue,
268268
Repo: issue.Repo,
269269
Doer: user,
270-
// Content before v1.21 did store the formated string instead of seconds,
271-
// so use "|" as delimeter to mark the new format
270+
// Content before v1.21 did store the formatted string instead of seconds,
271+
// so use "|" as delimiter to mark the new format
272272
Content: fmt.Sprintf("|%d", removedTime),
273273
Type: CommentTypeDeleteTimeManual,
274274
}); err != nil {
@@ -298,8 +298,8 @@ func DeleteTime(ctx context.Context, t *TrackedTime) error {
298298
Issue: t.Issue,
299299
Repo: t.Issue.Repo,
300300
Doer: t.User,
301-
// Content before v1.21 did store the formated string instead of seconds,
302-
// so use "|" as delimeter to mark the new format
301+
// Content before v1.21 did store the formatted string instead of seconds,
302+
// so use "|" as delimiter to mark the new format
303303
Content: fmt.Sprintf("|%d", t.Time),
304304
Type: CommentTypeDeleteTimeManual,
305305
}); err != nil {

models/migrations/v1_17/v216.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
package v1_17 //nolint
55

66
// This migration added non-ideal indices to the action table which on larger datasets slowed things down
7-
// it has been superceded by v218.go
7+
// it has been superseded by v218.go

modules/git/ref.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (ref RefName) RefGroup() string {
184184
}
185185

186186
// RefType returns the simple ref type of the reference, e.g. branch, tag
187-
// It's differrent from RefGroup, which is using the name of the directory under .git/refs
187+
// It's different from RefGroup, which is using the name of the directory under .git/refs
188188
// Here we using branch but not heads, using tag but not tags
189189
func (ref RefName) RefType() string {
190190
var refType string

0 commit comments

Comments
 (0)