diff --git a/models/auth/oauth2.go b/models/auth/oauth2.go index 0bc2b51711188..d5a5e2af8e8a8 100644 --- a/models/auth/oauth2.go +++ b/models/auth/oauth2.go @@ -217,7 +217,7 @@ func (app *OAuth2Application) GetGrantByUserID(ctx context.Context, userID int64 return grant, nil } -// CreateGrant generates a grant for an user +// CreateGrant generates a grant for a user func (app *OAuth2Application) CreateGrant(ctx context.Context, userID int64, scope string) (*OAuth2Grant, error) { grant := &OAuth2Grant{ ApplicationID: app.ID, @@ -461,7 +461,7 @@ func GetOAuth2AuthorizationByCode(ctx context.Context, code string) (auth *OAuth ////////////////////////////////////////////////////// -// OAuth2Grant represents the permission of an user for a specific application to access resources +// OAuth2Grant represents the permission of a user for a specific application to access resources type OAuth2Grant struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"INDEX unique(user_application)"` diff --git a/models/issues/issue_watch.go b/models/issues/issue_watch.go index 560be17eb6275..f384e086e5679 100644 --- a/models/issues/issue_watch.go +++ b/models/issues/issue_watch.go @@ -67,7 +67,7 @@ func GetIssueWatch(ctx context.Context, userID, issueID int64) (iw *IssueWatch, return iw, exists, err } -// CheckIssueWatch check if an user is watching an issue +// CheckIssueWatch check if a user is watching an issue // it takes participants and repo watch into account func CheckIssueWatch(ctx context.Context, user *user_model.User, issue *Issue) (bool, error) { iw, exist, err := GetIssueWatch(ctx, user.ID, issue.ID) diff --git a/models/issues/review.go b/models/issues/review.go index af2600876ed58..9f6fed779062e 100644 --- a/models/issues/review.go +++ b/models/issues/review.go @@ -67,7 +67,7 @@ func (err ErrNotValidReviewRequest) Unwrap() error { return util.ErrInvalidArgument } -// ErrReviewRequestOnClosedPR represents an error when an user tries to request a re-review on a closed or merged PR. +// ErrReviewRequestOnClosedPR represents an error when a user tries to request a re-review on a closed or merged PR. type ErrReviewRequestOnClosedPR struct{} // IsErrReviewRequestOnClosedPR checks if an error is an ErrReviewRequestOnClosedPR. diff --git a/models/repo/star.go b/models/repo/star.go index bc865f8373f7f..e1672623c826d 100644 --- a/models/repo/star.go +++ b/models/repo/star.go @@ -11,7 +11,7 @@ import ( "code.gitea.io/gitea/modules/timeutil" ) -// Star represents a starred repo by an user. +// Star represents a starred repo by a user. type Star struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"UNIQUE(s)"` diff --git a/modules/structs/notifications.go b/modules/structs/notifications.go index d7aa0783dc26b..b94e02aee3546 100644 --- a/modules/structs/notifications.go +++ b/modules/structs/notifications.go @@ -68,12 +68,12 @@ const ( type NotifySubjectType string const ( - // NotifySubjectIssue an issue is subject of an notification + // NotifySubjectIssue a issue is subject of an notification NotifySubjectIssue NotifySubjectType = "Issue" - // NotifySubjectPull an pull is subject of an notification + // NotifySubjectPull a pull is subject of an notification NotifySubjectPull NotifySubjectType = "Pull" - // NotifySubjectCommit an commit is subject of an notification + // NotifySubjectCommit a commit is subject of an notification NotifySubjectCommit NotifySubjectType = "Commit" - // NotifySubjectRepository an repository is subject of an notification + // NotifySubjectRepository a repository is subject of an notification NotifySubjectRepository NotifySubjectType = "Repository" ) diff --git a/routers/api/v1/repo/pull_review.go b/routers/api/v1/repo/pull_review.go index 1e3a05212d29a..82b78296b1215 100644 --- a/routers/api/v1/repo/pull_review.go +++ b/routers/api/v1/repo/pull_review.go @@ -392,7 +392,7 @@ func DeletePullReview(ctx *context.APIContext) { func CreatePullReview(ctx *context.APIContext) { // swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/reviews repository repoCreatePullReview // --- - // summary: Create a review to an pull request + // summary: Create a review to a pull request // produces: // - application/json // parameters: @@ -509,11 +509,11 @@ func CreatePullReview(ctx *context.APIContext) { ctx.JSON(http.StatusOK, apiReview) } -// SubmitPullReview submit a pending review to an pull request +// SubmitPullReview submit a pending review to a pull request func SubmitPullReview(ctx *context.APIContext) { // swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id} repository repoSubmitPullReview // --- - // summary: Submit a pending review to an pull request + // summary: Submit a pending review to a pull request // produces: // - application/json // parameters: @@ -693,7 +693,7 @@ func prepareSingleReview(ctx *context.APIContext) (*issues_model.Review, *issues return review, pr, false } -// CreateReviewRequests create review requests to an pull request +// CreateReviewRequests create review requests to a pull request func CreateReviewRequests(ctx *context.APIContext) { // swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/requested_reviewers repository repoCreatePullReviewRequests // --- @@ -734,7 +734,7 @@ func CreateReviewRequests(ctx *context.APIContext) { apiReviewRequest(ctx, *opts, true) } -// DeleteReviewRequests delete review requests to an pull request +// DeleteReviewRequests delete review requests to a pull request func DeleteReviewRequests(ctx *context.APIContext) { // swagger:operation DELETE /repos/{owner}/{repo}/pulls/{index}/requested_reviewers repository repoDeletePullReviewRequests // --- diff --git a/routers/api/v1/user/avatar.go b/routers/api/v1/user/avatar.go index 9c7bd57bc06ca..8f39319112f99 100644 --- a/routers/api/v1/user/avatar.go +++ b/routers/api/v1/user/avatar.go @@ -13,7 +13,7 @@ import ( user_service "code.gitea.io/gitea/services/user" ) -// UpdateAvatar updates the Avatar of an User +// UpdateAvatar updates the Avatar of a User func UpdateAvatar(ctx *context.APIContext) { // swagger:operation POST /user/avatar user userUpdateAvatar // --- @@ -45,7 +45,7 @@ func UpdateAvatar(ctx *context.APIContext) { ctx.Status(http.StatusNoContent) } -// DeleteAvatar deletes the Avatar of an User +// DeleteAvatar deletes the Avatar of a User func DeleteAvatar(ctx *context.APIContext) { // swagger:operation DELETE /user/avatar user userDeleteAvatar // --- diff --git a/routers/api/v1/user/runners.go b/routers/api/v1/user/runners.go index e06b022f35640..6db1d48069fd1 100644 --- a/routers/api/v1/user/runners.go +++ b/routers/api/v1/user/runners.go @@ -14,7 +14,7 @@ import ( func CreateRegistrationToken(ctx *context.APIContext) { // swagger:operation POST /user/actions/runners/registration-token user userCreateRunnerRegistrationToken // --- - // summary: Get an user's actions runner registration token + // summary: Get a user's actions runner registration token // produces: // - application/json // parameters: diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go index bbada746b7e68..8dc19b63a8f4d 100644 --- a/routers/api/v1/utils/hook.go +++ b/routers/api/v1/utils/hook.go @@ -48,7 +48,7 @@ func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) { ctx.JSON(http.StatusOK, apiHooks) } -// GetOwnerHook gets an user or organization webhook. Errors are written to ctx. +// GetOwnerHook gets a user or organization webhook. Errors are written to ctx. func GetOwnerHook(ctx *context.APIContext, ownerID, hookID int64) (*webhook.Webhook, error) { w, err := webhook.GetWebhookByOwnerID(ctx, ownerID, hookID) if err != nil { @@ -114,7 +114,7 @@ func AddSystemHook(ctx *context.APIContext, form *api.CreateHookOption) { } } -// AddOwnerHook adds a hook to an user or organization +// AddOwnerHook adds a hook to a user or organization func AddOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.CreateHookOption) { hook, ok := addHook(ctx, form, owner.ID, 0) if !ok { @@ -294,7 +294,7 @@ func EditSystemHook(ctx *context.APIContext, form *api.EditHookOption, hookID in ctx.JSON(http.StatusOK, h) } -// EditOwnerHook updates a webhook of an user or organization +// EditOwnerHook updates a webhook of a user or organization func EditOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.EditHookOption, hookID int64) { hook, err := GetOwnerHook(ctx, owner.ID, hookID) if err != nil { diff --git a/services/pull/review.go b/services/pull/review.go index 261cf234b3662..cf9c7bf6f14f6 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -35,7 +35,7 @@ func isErrBlameNotFoundOrNotEnoughLines(err error) bool { return notFound || notEnoughLines } -// ErrDismissRequestOnClosedPR represents an error when an user tries to dismiss a review associated to a closed or merged PR. +// ErrDismissRequestOnClosedPR represents an error when a user tries to dismiss a review associated to a closed or merged PR. type ErrDismissRequestOnClosedPR struct{} // IsErrDismissRequestOnClosedPR checks if an error is an ErrDismissRequestOnClosedPR. @@ -52,7 +52,7 @@ func (err ErrDismissRequestOnClosedPR) Unwrap() error { return util.ErrPermissionDenied } -// ErrSubmitReviewOnClosedPR represents an error when an user tries to submit an approve or reject review associated to a closed or merged PR. +// ErrSubmitReviewOnClosedPR represents an error when a user tries to submit an approve or reject review associated to a closed or merged PR. var ErrSubmitReviewOnClosedPR = errors.New("can't submit review for a closed or merged PR") // LineBlame returns the latest commit at the given line diff --git a/services/user/delete.go b/services/user/delete.go index 6047694b0c6a9..e5c2908ada79b 100644 --- a/services/user/delete.go +++ b/services/user/delete.go @@ -27,7 +27,7 @@ import ( "xorm.io/builder" ) -// deleteUser deletes models associated to an user. +// deleteUser deletes models associated to a user. func deleteUser(ctx context.Context, u *user_model.User, purge bool) (err error) { e := db.GetEngine(ctx) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 48a40eae08237..29075a8021f5e 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -14805,7 +14805,7 @@ "tags": [ "repository" ], - "summary": "Create a review to an pull request", + "summary": "Create a review to a pull request", "operationId": "repoCreatePullReview", "parameters": [ { @@ -14910,7 +14910,7 @@ "tags": [ "repository" ], - "summary": "Submit a pending review to an pull request", + "summary": "Submit a pending review to a pull request", "operationId": "repoSubmitPullReview", "parameters": [ { @@ -18763,7 +18763,7 @@ "tags": [ "user" ], - "summary": "Get an user's actions runner registration token", + "summary": "Get a user's actions runner registration token", "operationId": "userCreateRunnerRegistrationToken", "responses": { "200": { @@ -27268,7 +27268,7 @@ "x-go-name": "Title" }, "type": { - "description": "Type indicates the type of the notification subject\nIssue NotifySubjectIssue NotifySubjectIssue an issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull an pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository an repository is subject of an notification", + "description": "Type indicates the type of the notification subject\nIssue NotifySubjectIssue NotifySubjectIssue a issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull a pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit a commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository a repository is subject of an notification", "type": "string", "enum": [ "Issue", @@ -27276,7 +27276,7 @@ "Commit", "Repository" ], - "x-go-enum-desc": "Issue NotifySubjectIssue NotifySubjectIssue an issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull an pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository an repository is subject of an notification", + "x-go-enum-desc": "Issue NotifySubjectIssue NotifySubjectIssue a issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull a pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit a commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository a repository is subject of an notification", "x-go-name": "Type" }, "url": {