mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-13 04:30:45 +00:00
chore(typo): fix grammar in comments, API docs and error messages (#38370)
This commit is contained in:
@@ -10,10 +10,10 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// sha1Pattern can be used to determine if a string is an valid sha
|
||||
// sha1Pattern can be used to determine if a string is a valid sha
|
||||
var sha1Pattern = regexp.MustCompile(`^[0-9a-f]{4,40}$`)
|
||||
|
||||
// sha256Pattern can be used to determine if a string is an valid sha
|
||||
// sha256Pattern can be used to determine if a string is a valid sha
|
||||
var sha256Pattern = regexp.MustCompile(`^[0-9a-f]{4,64}$`)
|
||||
|
||||
type ObjectFormat interface {
|
||||
|
||||
@@ -167,7 +167,7 @@ func validateOptions(field *api.IssueFormField, idx int) error {
|
||||
|
||||
options, ok := field.Attributes["options"].([]any)
|
||||
if !ok || len(options) == 0 {
|
||||
return position.Errorf("'options' is required and should be a array")
|
||||
return position.Errorf("'options' is required and should be an array")
|
||||
}
|
||||
|
||||
for optIdx, option := range options {
|
||||
@@ -270,7 +270,7 @@ func validateDropdownDefault(position errorPosition, attributes map[string]any)
|
||||
options, ok := attributes["options"].([]any)
|
||||
if !ok {
|
||||
// should not happen
|
||||
return position.Errorf("'options' is required and should be a array")
|
||||
return position.Errorf("'options' is required and should be an array")
|
||||
}
|
||||
if defaultValue < 0 || defaultValue >= len(options) {
|
||||
return position.Errorf("the value of 'default' is out of range")
|
||||
|
||||
@@ -268,7 +268,7 @@ body:
|
||||
attributes:
|
||||
label: "a"
|
||||
`,
|
||||
wantErr: "body[0](dropdown): 'options' is required and should be a array",
|
||||
wantErr: "body[0](dropdown): 'options' is required and should be an array",
|
||||
},
|
||||
{
|
||||
name: "dropdown invalid options",
|
||||
|
||||
@@ -51,7 +51,7 @@ var globalVars = sync.OnceValue(func() *globalVarsType {
|
||||
v := &globalVarsType{}
|
||||
// NOTE: All below regex matching do not perform any extra validation.
|
||||
// Thus a link is produced even if the linked entity does not exist.
|
||||
// While fast, this is also incorrect and lead to false positives.
|
||||
// While fast, this is also incorrect and leads to false positives.
|
||||
// TODO: fix invalid linking issue (update: stale TODO, what issues? maybe no TODO anymore)
|
||||
|
||||
// valid chars in encoded path and parameter: [-+~_%.a-zA-Z0-9/]
|
||||
|
||||
@@ -24,7 +24,7 @@ var (
|
||||
|
||||
// NOTE: All below regex matching do not perform any extra validation.
|
||||
// Thus a link is produced even if the linked entity does not exist.
|
||||
// While fast, this is also incorrect and lead to false positives.
|
||||
// While fast, this is also incorrect and leads to false positives.
|
||||
// TODO: fix invalid linking issue
|
||||
|
||||
// mentionPattern matches all mentions in the form of "@user" or "@org/team"
|
||||
|
||||
@@ -68,7 +68,7 @@ const (
|
||||
type NotifySubjectType string
|
||||
|
||||
const (
|
||||
// NotifySubjectIssue a issue is subject of an notification
|
||||
// NotifySubjectIssue an issue is subject of a notification
|
||||
NotifySubjectIssue NotifySubjectType = "Issue"
|
||||
// NotifySubjectPull a pull is subject of an notification
|
||||
NotifySubjectPull NotifySubjectType = "Pull"
|
||||
|
||||
Reference in New Issue
Block a user