diff --git a/models/db/engine.go b/models/db/engine.go index 7283b1d516..05a119b08d 100755 --- a/models/db/engine.go +++ b/models/db/engine.go @@ -187,8 +187,8 @@ func InitEngine(ctx context.Context) error { if setting.Database.SlowQueryThreshold > 0 { eng.AddHook(&SlowQueryHook{ - Treshold: setting.Database.SlowQueryThreshold, - Logger: log.GetLogger("xorm"), + Threshold: setting.Database.SlowQueryThreshold, + Logger: log.GetLogger("xorm"), }) } @@ -390,8 +390,8 @@ func (TracingHook) AfterProcess(c *contexts.ContextHook) error { } type SlowQueryHook struct { - Treshold time.Duration - Logger log.Logger + Threshold time.Duration + Logger log.Logger } var _ contexts.Hook = &SlowQueryHook{} @@ -401,7 +401,7 @@ func (SlowQueryHook) BeforeProcess(c *contexts.ContextHook) (context.Context, er } func (h *SlowQueryHook) AfterProcess(c *contexts.ContextHook) error { - if c.ExecuteTime >= h.Treshold { + if c.ExecuteTime >= h.Threshold { h.Logger.Log(8, log.WARN, "[Slow SQL Query] %s %v - %v", c.SQL, c.Args, c.ExecuteTime) } return nil diff --git a/models/db/engine_test.go b/models/db/engine_test.go index 036ab88945..98cc90c251 100644 --- a/models/db/engine_test.go +++ b/models/db/engine_test.go @@ -103,8 +103,8 @@ func TestSlowQuery(t *testing.T) { // It's not possible to clean this up with XORM, but it's luckily not harmful // to leave around. engine.AddHook(&db.SlowQueryHook{ - Treshold: time.Second * 10, - Logger: log.GetLogger("slow-query"), + Threshold: time.Second * 10, + Logger: log.GetLogger("slow-query"), }) // NOOP query. @@ -114,8 +114,8 @@ func TestSlowQuery(t *testing.T) { assert.False(t, stopped) engine.AddHook(&db.SlowQueryHook{ - Treshold: 0, // Every query should be logged. - Logger: log.GetLogger("slow-query"), + Threshold: 0, // Every query should be logged. + Logger: log.GetLogger("slow-query"), }) // NOOP query. diff --git a/models/user/federated_user.go b/models/user/federated_user.go index a53e6e4bb8..c1833c7de3 100644 --- a/models/user/federated_user.go +++ b/models/user/federated_user.go @@ -16,7 +16,7 @@ type FederatedUser struct { FederationHostID int64 `xorm:"UNIQUE(federation_user_mapping) NOT NULL"` KeyID sql.NullString `xorm:"key_id UNIQUE"` PublicKey sql.Null[sql.RawBytes] `xorm:"BLOB"` - NormalizedOriginalURL string // This field ist just to keep original information. Pls. do not use for search or as ID! + NormalizedOriginalURL string // This field is just to keep original information. Pls. do not use for search or as ID! } func NewFederatedUser(userID int64, externalID string, federationHostID int64, normalizedOriginalURL string) (FederatedUser, error) { diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index 91c767c589..d015fb7bec 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -192,7 +192,7 @@ func (c *Client) GetBody(uri string) ([]byte, error) { } defer response.Body.Close() if response.ContentLength > setting.Federation.MaxSize { - return nil, fmt.Errorf("Request returned %d bytes (max allowed incomming size: %d bytes)", response.ContentLength, setting.Federation.MaxSize) + return nil, fmt.Errorf("Request returned %d bytes (max allowed incoming size: %d bytes)", response.ContentLength, setting.Federation.MaxSize) } else if response.ContentLength == -1 { log.Warn("Request to %v returned an unknown content length, response may be truncated to %d bytes", uri, setting.Federation.MaxSize) } diff --git a/modules/git/git.go b/modules/git/git.go index 30d41933b2..82d4693bfc 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -286,7 +286,7 @@ func syncGitConfig() (err error) { } // Get the ssh-keygen binary that Git will use. - // This can be overriden in app.ini in [git.config] section, so we must + // This can be overridden in app.ini in [git.config] section, so we must // query this information. sshKeygenPath, err := configGet("gpg.ssh.program") if err != nil { diff --git a/modules/markup/common/linkify.go b/modules/markup/common/linkify.go index 6e8ef0c973..e3c069b01d 100644 --- a/modules/markup/common/linkify.go +++ b/modules/markup/common/linkify.go @@ -17,7 +17,7 @@ import ( "github.com/yuin/goldmark/util" ) -var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}((?:/|[#?])[-a-zA-Z0-9@:%_\+.~#!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`) +var wwwURLRegexp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}((?:/|[#?])[-a-zA-Z0-9@:%_\+.~#!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`) type linkifyParser struct{} @@ -63,7 +63,7 @@ func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Cont m = LinkRegex.FindSubmatchIndex(line) } if m == nil && bytes.HasPrefix(line, domainWWW) { - m = wwwURLRegxp.FindSubmatchIndex(line) + m = wwwURLRegexp.FindSubmatchIndex(line) protocol = []byte("http") } if m != nil { diff --git a/modules/markup/markdown/math/inline_parser.go b/modules/markup/markdown/math/inline_parser.go index 4ffbf1257f..da28d4fd9c 100644 --- a/modules/markup/markdown/math/inline_parser.go +++ b/modules/markup/markdown/math/inline_parser.go @@ -96,12 +96,12 @@ func (parser *inlineParser) Parse(parent ast.Node, block text.Reader, pc parser. if len(line) <= pos { break } - suceedingCharacter := line[pos] + succeedingCharacter := line[pos] // check valid ending character - if !isPunctuation(suceedingCharacter) && - (suceedingCharacter != ' ') && - (suceedingCharacter != '\n') && - !isBracket(suceedingCharacter) { + if !isPunctuation(succeedingCharacter) && + (succeedingCharacter != ' ') && + (succeedingCharacter != '\n') && + !isBracket(succeedingCharacter) { return nil } if line[ender-1] != '\\' { diff --git a/pyproject.toml b/pyproject.toml index 5c4bd26e27..1ddf026963 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,7 @@ ignore="H005,H006,H013,H016,H020,H021,H030,H031" skip = '.git,*.pdf,*.svg,package-lock.json,go.mod,locale,locale_next,license,*.git,objects,*.fr-fr.*,*.de-de.*,*.css,go.sum,*.key,gitignore,pyproject.toml,diff_test.go,go-licenses.json,pyproject.toml,*.lock,venvs,node_modules,plural_rules.go,testdata,disposable_email_domain_data.go' # precise hits for CamelCased words,various other curious cases which require regex to ignore # entire line or some portion of it -# TODO: Resolve Treshold typo in API and remove from here -ignore-regex = '(\b(Treshold|mx claus|commitT|ReadBy|#afile|respOne|commitI|[cC]rossReference|SMove|reVer|CheckIn|NotIn)\b|shouldbe\.|women’s.*womens|"emoji":.*|,bu,|assert\.Equal.*"fo\b|github\.com/unknwon|Copyright 2014 Unknwon|allowed\.noone|[hH]eadErr|atLeast|{"\\U.*)|Iif|FilterIn|ZiSe' +ignore-regex = '(\b(mx claus|commitT|ReadBy|#afile|respOne|commitI|[cC]rossReference|SMove|reVer|CheckIn|NotIn)\b|shouldbe\.|women’s.*womens|"emoji":.*|,bu,|assert\.Equal.*"fo\b|github\.com/unknwon|Copyright 2014 Unknwon|allowed\.noone|[hH]eadErr|atLeast|{"\\U.*)|Iif|FilterIn|ZiSe' # te - TreeEntry variable # commiter - wrong spelling but seems used in API # ALLWAYS - is a config var diff --git a/tests/integration/api_activitypub_person_test.go b/tests/integration/api_activitypub_person_test.go index fdbf3fac46..c89951ecf1 100644 --- a/tests/integration/api_activitypub_person_test.go +++ b/tests/integration/api_activitypub_person_test.go @@ -46,7 +46,7 @@ func TestActivityPubPerson(t *testing.T) { }) t.Run("SignedRequestValidation", func(t *testing.T) { - // Signed requset + // Signed request resp, err := apClient.GetBody(userURL) require.NoError(t, err)