Skip to content

Fix some typos #26031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/backport/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The default version will read from `docs/config.yml`. You can override this
using the option `--version`.

The upstream branches will be fetched, using the remote `origin`. This can
be overrided using `--upstream`, and fetching can be avoided using
be overrode using `--upstream`, and fetching can be avoided using
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be overrode using `--upstream`, and fetching can be avoided using
be overridden using `--upstream`, and fetching can be avoided using

`--no-fetch`.

By default the branch created will be called `backport-$PR-$VERSION`. You
Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/administration/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ Defaultly every storage has their default base path like below
| actions_log | actions_log/ |
| actions_artifacts | actions_artifacts/ |

And bucket, basepath or `SERVE_DIRECT` could be special or overrided, if you want to use a different you can:
And bucket, basepath or `SERVE_DIRECT` could be special or overriden, if you want to use a different you can:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And bucket, basepath or `SERVE_DIRECT` could be special or overriden, if you want to use a different you can:
And bucket, basepath or `SERVE_DIRECT` could be special or overridden, if you want to use a different you can:


```ini
[storage.actions_log]
Expand Down Expand Up @@ -1390,7 +1390,7 @@ Please note that using `self` is not recommended for most cases, as it could mak
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
Therefore, please use `self` only if you understand what you are doing.

In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` could be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`.
However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub).
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.
Expand Down
6 changes: 3 additions & 3 deletions models/actions/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err

// InsertRun inserts a run
func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWorkflow) error {
ctx, commiter, err := db.TxContext(ctx)
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

index, err := db.GetNextResourceIndex(ctx, "action_run_index", run.RepoID)
if err != nil {
Expand Down Expand Up @@ -225,7 +225,7 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
return err
}

return commiter.Commit()
return committer.Commit()
}

func GetRunByID(ctx context.Context, id int64) (*ActionRun, error) {
Expand Down
14 changes: 7 additions & 7 deletions models/actions/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ func GetRunningTaskByToken(ctx context.Context, token string) (*ActionTask, erro
}

func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask, bool, error) {
dbCtx, commiter, err := db.TxContext(ctx)
dbCtx, committer, err := db.TxContext(ctx)
if err != nil {
return nil, false, err
}
defer commiter.Close()
defer committer.Close()
ctx = dbCtx.WithContext(ctx)

e := db.GetEngine(ctx)
Expand Down Expand Up @@ -279,7 +279,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
if gots, err := jobparser.Parse(job.WorkflowPayload); err != nil {
return nil, false, fmt.Errorf("parse workflow of job %d: %w", job.ID, err)
} else if len(gots) != 1 {
return nil, false, fmt.Errorf("workflow of job %d: not signle workflow", job.ID)
return nil, false, fmt.Errorf("workflow of job %d: not single workflow", job.ID)
} else {
_, workflowJob = gots[0].Job()
}
Expand Down Expand Up @@ -328,7 +328,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask

task.Job = job

if err := commiter.Commit(); err != nil {
if err := committer.Commit(); err != nil {
return nil, false, err
}

Expand All @@ -353,11 +353,11 @@ func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionT
stepStates[v.Id] = v
}

ctx, commiter, err := db.TxContext(ctx)
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return nil, err
}
defer commiter.Close()
defer committer.Close()

e := db.GetEngine(ctx)

Expand Down Expand Up @@ -418,7 +418,7 @@ func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionT
}
}

if err := commiter.Commit(); err != nil {
if err := committer.Commit(); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion models/auth/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (err ErrOAuthApplicationNotFound) Unwrap() error {
return util.ErrNotExist
}

// GetActiveOAuth2ProviderSources returns all actived LoginOAuth2 sources
// GetActiveOAuth2ProviderSources returns all active LoginOAuth2 sources
func GetActiveOAuth2ProviderSources() ([]*Source, error) {
sources := make([]*Source, 0, 1)
if err := db.GetEngine(db.DefaultContext).Where("is_active = ? and type = ?", true, OAuth2).Find(&sources); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion models/auth/oauth2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestOAuth2Application_ContainsRedirectURI_WithPort(t *testing.T) {
// not loopback
assert.False(t, app.ContainsRedirectURI("http://192.168.0.1:9954/"))
assert.False(t, app.ContainsRedirectURI("http://intranet:3456/"))
// unparseable
// unparsable
assert.False(t, app.ContainsRedirectURI(":"))
}

Expand Down
4 changes: 2 additions & 2 deletions models/db/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type ResourceIndex struct {
}

var (
// ErrResouceOutdated represents an error when request resource outdated
ErrResouceOutdated = errors.New("resource outdated")
// ErrResourceOutdated represents an error when request resource outdated
ErrResourceOutdated = errors.New("resource outdated")
// ErrGetResourceIndexFailed represents an error when resource index retries 3 times
ErrGetResourceIndexFailed = errors.New("get resource index failed")
)
Expand Down
12 changes: 6 additions & 6 deletions models/fixtures/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-
id: 1
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 2
index: 2
head_repo_id: 1
Expand All @@ -15,7 +15,7 @@
-
id: 2
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 3
index: 3
head_repo_id: 1
Expand All @@ -28,7 +28,7 @@
-
id: 3
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 8
index: 1
head_repo_id: 11
Expand All @@ -41,7 +41,7 @@
-
id: 4
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 9
index: 1
head_repo_id: 48
Expand All @@ -54,7 +54,7 @@
-
id: 5 # this PR is outdated (one commit behind branch1 )
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 11
index: 5
head_repo_id: 1
Expand All @@ -67,7 +67,7 @@
-
id: 6
type: 0 # gitea pull request
status: 2 # mergable
status: 2 # mergeable
issue_id: 12
index: 2
head_repo_id: 3
Expand Down
6 changes: 3 additions & 3 deletions models/git/protected_branch_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func FindRepoProtectedBranchRules(ctx context.Context, repoID int64) (ProtectedB
func FindAllMatchedBranches(ctx context.Context, repoID int64, ruleName string) ([]string, error) {
results := make([]string, 0, 10)
for page := 1; ; page++ {
brancheNames, err := FindBranchNames(ctx, FindBranchOptions{
branchNames, err := FindBranchNames(ctx, FindBranchOptions{
ListOptions: db.ListOptions{
PageSize: 100,
Page: page,
Expand All @@ -63,12 +63,12 @@ func FindAllMatchedBranches(ctx context.Context, repoID int64, ruleName string)
}
rule := glob.MustCompile(ruleName)

for _, branch := range brancheNames {
for _, branch := range branchNames {
if rule.Match(branch) {
results = append(results, branch)
}
}
if len(brancheNames) < 100 {
if len(branchNames) < 100 {
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion models/issues/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error {

// Mergeable returns if the pullrequest is mergeable.
func (pr *PullRequest) Mergeable() bool {
// If a pull request isn't mergable if it's:
// If a pull request isn't mergeable if it's:
// - Being conflict checked.
// - Has a conflict.
// - Received a error while being conflict checked.
Expand Down
12 changes: 6 additions & 6 deletions models/issues/tracked_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ func AddTime(user *user_model.User, issue *Issue, amount int64, created time.Tim
Issue: issue,
Repo: issue.Repo,
Doer: user,
// Content before v1.21 did store the formated string instead of seconds,
// so use "|" as delimeter to mark the new format
// Content before v1.21 did store the formatted string instead of seconds,
// so use "|" as delimiter to mark the new format
Content: fmt.Sprintf("|%d", amount),
Type: CommentTypeAddTimeManual,
TimeID: t.ID,
Expand Down Expand Up @@ -257,8 +257,8 @@ func DeleteIssueUserTimes(issue *Issue, user *user_model.User) error {
Issue: issue,
Repo: issue.Repo,
Doer: user,
// Content before v1.21 did store the formated string instead of seconds,
// so use "|" as delimeter to mark the new format
// Content before v1.21 did store the formatted string instead of seconds,
// so use "|" as delimiter to mark the new format
Content: fmt.Sprintf("|%d", removedTime),
Type: CommentTypeDeleteTimeManual,
}); err != nil {
Expand Down Expand Up @@ -288,8 +288,8 @@ func DeleteTime(t *TrackedTime) error {
Issue: t.Issue,
Repo: t.Issue.Repo,
Doer: t.User,
// Content before v1.21 did store the formated string instead of seconds,
// so use "|" as delimeter to mark the new format
// Content before v1.21 did store the formatted string instead of seconds,
// so use "|" as delimiter to mark the new format
Content: fmt.Sprintf("|%d", t.Time),
Type: CommentTypeDeleteTimeManual,
}); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ var migrations = []Migration{
// v103 -> v104
NewMigration("Add WhitelistDeployKeys to protected branch", v1_11.AddWhitelistDeployKeysToBranches),
// v104 -> v105
NewMigration("remove unnecessary columns from label", v1_11.RemoveLabelUneededCols),
NewMigration("remove unnecessary columns from label", v1_11.RemoveLabelUnneededCols),
// v105 -> v106
NewMigration("add includes_all_repositories to teams", v1_11.AddTeamIncludesAllRepositories),
// v106 -> v107
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v1_11/v104.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"xorm.io/xorm"
)

func RemoveLabelUneededCols(x *xorm.Engine) error {
func RemoveLabelUnneededCols(x *xorm.Engine) error {
// Make sure the columns exist before dropping them
type Label struct {
QueryString string
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v1_17/v216.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
package v1_17 //nolint

// This migration added non-ideal indices to the action table which on larger datasets slowed things down
// it has been superceded by v218.go
// it has been superseded by v218.go
4 changes: 2 additions & 2 deletions models/unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func AllUnitKeyNames() []string {
return res
}

// MinUnitAccessMode returns the minial permission of the permission map
// MinUnitAccessMode returns the minimal permission of the permission map
func MinUnitAccessMode(unitsMap map[Type]perm.AccessMode) perm.AccessMode {
res := perm.AccessModeNone
for t, mode := range unitsMap {
Expand All @@ -359,7 +359,7 @@ func MinUnitAccessMode(unitsMap map[Type]perm.AccessMode) perm.AccessMode {
continue
}

// get the minial permission great than AccessModeNone except all are AccessModeNone
// get the minimal permission great than AccessModeNone except all are AccessModeNone
if mode > perm.AccessModeNone && (res == perm.AccessModeNone || mode < res) {
res = mode
}
Expand Down
2 changes: 1 addition & 1 deletion models/user/setting_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const (
SettingsKeyHiddenCommentTypes = "issue.hidden_comment_types"
// SettingsKeyDiffWhitespaceBehavior is the setting key for whitespace behavior of diff
SettingsKeyDiffWhitespaceBehavior = "diff.whitespace_behaviour"
// SettingsKeyShowOutdatedComments is the setting key wether or not to show outdated comments in PRs
// SettingsKeyShowOutdatedComments is the setting key whether or not to show outdated comments in PRs
SettingsKeyShowOutdatedComments = "comment_code.show_outdated"
// UserActivityPubPrivPem is user's private key
UserActivityPubPrivPem = "activitypub.priv_pem"
Expand Down
14 changes: 7 additions & 7 deletions modules/actions/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ const (
)

// canGithubEventMatch check if the input Github event can match any Gitea event.
func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEventType) bool {
func canGithubEventMatch(eventName string, triggeredEvent webhook_module.HookEventType) bool {
switch eventName {
case GithubEventRegistryPackage:
return triggedEvent == webhook_module.HookEventPackage
return triggeredEvent == webhook_module.HookEventPackage

// See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum
case GithubEventGollum:
return triggedEvent == webhook_module.HookEventWiki
return triggeredEvent == webhook_module.HookEventWiki

case GithubEventIssues:
switch triggedEvent {
switch triggeredEvent {
case webhook_module.HookEventIssues,
webhook_module.HookEventIssueAssign,
webhook_module.HookEventIssueLabel,
Expand All @@ -47,7 +47,7 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent
}

case GithubEventPullRequest, GithubEventPullRequestTarget:
switch triggedEvent {
switch triggeredEvent {
case webhook_module.HookEventPullRequest,
webhook_module.HookEventPullRequestSync,
webhook_module.HookEventPullRequestAssign,
Expand All @@ -59,7 +59,7 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent
}

case GithubEventPullRequestReview:
switch triggedEvent {
switch triggeredEvent {
case webhook_module.HookEventPullRequestReviewApproved,
webhook_module.HookEventPullRequestReviewComment,
webhook_module.HookEventPullRequestReviewRejected:
Expand All @@ -70,6 +70,6 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent
}

default:
return eventName == string(triggedEvent)
return eventName == string(triggeredEvent)
}
}
Loading