linting: fix typos, add toml validation (#7007)

- adds the `toml` plugin to the `eslint` linting → expect to have `options/setting/config.toml` by #6862
- fixes `make lint-codespell` commands
- related concerning `codespell`: #3270
- info: codespell check is and was not activated in the workflows (could maybe, runs only few seconds on my system)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7007
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
This commit is contained in:
Robert Wolff 2025-02-21 08:23:03 +00:00 committed by Earl Warren
parent e8ebb5d6e3
commit dc5bc1fe5b
26 changed files with 94 additions and 38 deletions

View file

@ -173,7 +173,7 @@ GO_DIRS := build cmd models modules routers services tests
WEB_DIRS := web_src/js web_src/css
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml *.toml)
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml)
GO_SOURCES := $(wildcard *.go)
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
@ -431,16 +431,16 @@ lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale li
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix
.PHONY: lint-codespell
lint-codespell:
codespell
lint-codespell: deps-py
@poetry run codespell
.PHONY: lint-codespell-fix
lint-codespell-fix:
codespell -w
lint-codespell-fix: deps-py
@poetry run codespell -w
.PHONY: lint-codespell-fix-i
lint-codespell-fix-i:
codespell -w -i 3 -C 2
lint-codespell-fix-i: deps-py
@poetry run codespell -w -i 3 -C 2
.PHONY: lint-js
lint-js: node_modules

View file

@ -14,6 +14,7 @@ import wc from 'eslint-plugin-wc';
import globals from 'globals';
import vue from 'eslint-plugin-vue';
import vueScopedCss from 'eslint-plugin-vue-scoped-css';
import toml from 'eslint-plugin-toml';
import tseslint from 'typescript-eslint';
export default tseslint.config(
@ -35,6 +36,7 @@ export default tseslint.config(
sonarjs,
unicorn,
playwright,
toml,
'vitest-globals': vitestGlobals,
vue,
'vue-scoped-css': vueScopedCss,
@ -1166,5 +1168,5 @@ export default tseslint.config(
'vue-scoped-css/enforce-style-type': [0],
},
},
...toml.configs['flat/recommended'],
);

View file

@ -140,7 +140,7 @@ func (r *Release) LoadArchiveDownloadCount(ctx context.Context) error {
return err
}
// GetTotalDownloadCount returns the summary of all dowload count of files attached to the release
// GetTotalDownloadCount returns the summary of all download count of files attached to the release
func (r *Release) GetTotalDownloadCount(ctx context.Context) (int64, error) {
var archiveCount int64
if !r.HideArchiveLinks {
@ -194,7 +194,7 @@ func (r *Release) SummaryCardURL() string {
return fmt.Sprintf("%s/releases/summary-card/%s", r.Repo.HTMLURL(), util.PathEscapeSegments(r.TagName))
}
// DisplayName retruns the name of the release
// DisplayName returns the name of the release
func (r *Release) DisplayName() string {
if r.IsTag && r.Title == "" {
return r.TagName

View file

@ -69,7 +69,7 @@ func init() {
}
// GetUserRedirect returns the redirect for a given username, this is a
// case-insenstive operation.
// case-insensitive operation.
func GetUserRedirect(ctx context.Context, userName string) (*Redirect, error) {
userName = strings.ToLower(userName)
redirect := &Redirect{LowerName: userName}

View file

@ -665,7 +665,7 @@ func TestEmailTo(t *testing.T) {
{"Hi Its <Mee>", "ee@mail.box", `"Hi Its Mee" <ee@mail.box>`},
{"Sinéad.O'Connor", "sinead.oconnor@gmail.com", "=?utf-8?b?U2luw6lhZC5PJ0Nvbm5vcg==?= <sinead.oconnor@gmail.com>"},
{"Æsir", "aesir@gmx.de", "=?utf-8?q?=C3=86sir?= <aesir@gmx.de>"},
{"new😀user", "new.user@alo.com", "=?utf-8?q?new=F0=9F=98=80user?= <new.user@alo.com>"}, // codespell-ignore
{"new😀user", "new.user@alo.com", "=?utf-8?q?new=F0=9F=98=80user?= <new.user@alo.com>"}, // codespell:ignore
{`"quoted"`, "quoted@test.com", `"quoted" <quoted@test.com>`},
{`gusted`, "gusted@test.com", `"gusted" <gusted@test.com>`},
{`Joe Q. Public`, "john.q.public@example.com", `"Joe Q. Public" <john.q.public@example.com>`},

View file

@ -125,7 +125,7 @@ func GrepSearch(ctx context.Context, repo *Repository, search string, opts GrepO
// (eg, global pattern = "src/**" and path = "node_modules/")
// FIXME: this is a bit too restrictive, and fails to consider cases where the
// gloabally set include pattern refers to a file than a directory
// globally set include pattern refers to a file than a directory
// (eg, global pattern = "**.go" and path = "modules/git")
exprMatched := false
for _, expr := range setting.Indexer.IncludePatterns {

View file

@ -124,7 +124,7 @@ c=2
{
name: "test.gradle.kts",
code: "@file:Suppress(\"UnstableApiUsage\")",
want: lines("<span class=\"nd\">@file</span><span class=\"p\">:</span><span class=\"n\">Suppress</span><span class=\"p\">(</span><span class=\"s2\">&#34;</span><span class=\"s2\">UnstableApiUsage</span><span class=\"s2\">&#34;</span><span class=\"p\">)</span>"),
want: lines("<span class=\"nd\">@file</span><span class=\"p\">:</span><span class=\"n\">Suppress</span><span class=\"p\">(</span><span class=\"s2\">&#34;</span><span class=\"s2\">UnstableApiUsage</span><span class=\"s2\">&#34;</span><span class=\"p\">)</span>"), // codespell:ignore
lexerName: "Kotlin",
},
}

View file

@ -31,19 +31,19 @@ func (t *PathHierarchyTokenizer) Tokenize(input []byte) analysis.TokenStream {
rv := make(analysis.TokenStream, 0, 8)
count, off := 1, 0
// iterate till all directory seperators
// iterate till all directory separators
for i := bytes.IndexRune(input[off:], '/'); i != -1; i = bytes.IndexRune(input[off:], '/') {
// the index is relative to input[offest...]
// add this index to the accumlated offset to get the index of the current seperator in input[0...]
// the index is relative to input[offset...]
// add this index to the accumulated offset to get the index of the current separator in input[0...]
off += i
rv = append(rv, &analysis.Token{
Term: input[:off], // take the slice, input[0...index of seperator]
Term: input[:off], // take the slice, input[0...index of separator]
Start: 0,
End: off,
Position: count,
Type: analysis.AlphaNumeric,
})
// increment the offset after considering the seperator
// increment the offset after considering the separator
off++
count++
}

View file

@ -13,8 +13,8 @@ import (
// NumericEqualityQuery generates a numeric equality query for the given value and field
func NumericEqualityQuery(value int64, field string) *query.NumericRangeQuery {
f := float64(value)
tru := true // codespell-ignore
q := bleve.NewNumericRangeInclusiveQuery(&f, &f, &tru, &tru) // codespell-ignore
tru := true // codespell:ignore
q := bleve.NewNumericRangeInclusiveQuery(&f, &f, &tru, &tru) // codespell:ignore
q.SetField(field)
return q
}

View file

@ -471,7 +471,7 @@ func TestColorPreview(t *testing.T) {
// no backticks
"rgb(166, 32, 64)",
// typo
"`hsI(0, 100%, 50%)`", // codespell-ignore
"`hsI(0, 100%, 50%)`", // codespell:ignore
// looks like a color but not really
"`hsl(40, 60, 80)`",
}

View file

@ -171,7 +171,7 @@ type_tooltip = Search type
fuzzy = Fuzzy
fuzzy_tooltip = Include results that also match the search term closely
union = Union
union_tooltip = Include results that match any of the whitespace seperated keywords
union_tooltip = Include results that match any of the whitespace separated keywords
exact = Exact
exact_tooltip = Include only results that match the exact search term
regexp = RegExp

53
package-lock.json generated
View file

@ -4,6 +4,7 @@
"requires": true,
"packages": {
"": {
"name": "forgejo",
"dependencies": {
"@citation-js/core": "0.7.14",
"@citation-js/plugin-bibtex": "0.7.16",
@ -80,6 +81,7 @@
"eslint-plugin-playwright": "2.1.0",
"eslint-plugin-regexp": "2.7.0",
"eslint-plugin-sonarjs": "3.0.1",
"eslint-plugin-toml": "0.12.0",
"eslint-plugin-unicorn": "56.0.1",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "9.32.0",
@ -8379,6 +8381,28 @@
"node": ">=10"
}
},
"node_modules/eslint-plugin-toml": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-toml/-/eslint-plugin-toml-0.12.0.tgz",
"integrity": "sha512-+/wVObA9DVhwZB1nG83D2OAQRrcQZXy+drqUnFJKymqnmbnbfg/UPmEMCKrJNcEboUGxUjYrJlgy+/Y930mURQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"eslint-compat-utils": "^0.6.0",
"lodash": "^4.17.19",
"toml-eslint-parser": "^0.10.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/ota-meshi"
},
"peerDependencies": {
"eslint": ">=6.0.0"
}
},
"node_modules/eslint-plugin-unicorn": {
"version": "56.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-56.0.1.tgz",
@ -15283,6 +15307,35 @@
"integrity": "sha512-HeMHCO9yLPvP9k0apGSdPUWrUbLnxUKNFzgUoZp1PHCLploIX/4DSQ7V8H25ef+h4iO9n0he7ImfcndnN6nDrQ==",
"license": "MIT"
},
"node_modules/toml-eslint-parser": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/toml-eslint-parser/-/toml-eslint-parser-0.10.0.tgz",
"integrity": "sha512-khrZo4buq4qVmsGzS5yQjKe/WsFvV8fGfOjDQN0q4iy9FjRfPWRgTFrU8u1R2iu/SfWLhY9WnCi4Jhdrcbtg+g==",
"dev": true,
"license": "MIT",
"dependencies": {
"eslint-visitor-keys": "^3.0.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/ota-meshi"
}
},
"node_modules/toml-eslint-parser/node_modules/eslint-visitor-keys": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",

View file

@ -1,4 +1,5 @@
{
"name": "forgejo",
"type": "module",
"engines": {
"node": ">= 18.0.0"
@ -80,6 +81,7 @@
"eslint-plugin-regexp": "2.7.0",
"eslint-plugin-sonarjs": "3.0.1",
"eslint-plugin-unicorn": "56.0.1",
"eslint-plugin-toml": "0.12.0",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "9.32.0",
"eslint-plugin-vue-scoped-css": "2.9.0",

View file

@ -14,12 +14,11 @@ profile="golang"
ignore="H005,H006,H013,H016,H020,H021,H030,H031"
[tool.codespell]
skip = '.git,*.pdf,*.svg,package-lock.json,go.mod,locale,license,*.git,objects,*.fr-fr.*,*.de-de.*,*.css,go.sum,*.key,gitignore,pyproject.toml,diff_test.go,go-licenses.json,pyproject.toml,*.lock,venvs'
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\.|womens.*womens|"emoji":.*|,bu,|assert\.Equal.*"fo\b|github\.com/unknwon|Copyright 2014 Unknwon|allowed\.noone|[hH]eadErr|atLeast|{"\\U.*)|Iif|FilterIn|.*codespell-ignore.*'
#|.*(Maskenpflicht|Geimpft),.*)'
ignore-regex = '(\b(Treshold|mx claus|commitT|ReadBy|#afile|respOne|commitI|[cC]rossReference|SMove|reVer|CheckIn|NotIn)\b|shouldbe\.|womens.*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

View file

@ -430,7 +430,7 @@
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5651): <!--number 5651 --><!--line 0 --><!--description bGluayB0byBzZWN1cml0eSBwb2xpY3kgaW4gc2VjdXJpdHkudHh0-->link to security policy in security.txt<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5646): <!--number 5646 --><!--line 0 --><!--description Y2hvcmUocmVsZWFzZS1ub3Rlcyk6IG5vIG5lZWQgdG8gc3BlY2lmeSB0aGV5IGFyZSBkcmFmdA==-->chore(release-notes): no need to specify they are draft<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5644): <!--number 5644 --><!--line 0 --><!--description Y29uZjogSW1wcm92ZSBkZWxldGVfb2xkX2FjdGlvbnMgZGVzY3JpcHRpb24=-->conf: Improve delete_old_actions description<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5641): <!--number 5641 --><!--line 0 --><!--description bWFrZSBzeW5jcm9uaXplIHRhZ3MgdG8gZGF0YWJhc2UgaGFuZGxlIGFubm90ZWQgdGFncw==-->make synchronize tags to database handle annoted tags<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5641): <!--number 5641 --><!--line 0 --><!--description bWFrZSBzeW5jcm9uaXplIHRhZ3MgdG8gZGF0YWJhc2UgaGFuZGxlIGFubm90ZWQgdGFncw==-->make synchronize tags to database handle annotated tags<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5640): <!--number 5640 --><!--line 0 --><!--description UmV2ZXJ0ICJhZGQgZ2FwIGJldHdlZW4gYnJhbmNoIGRyb3Bkb3duIGFuZCBQUiBidXR0b24i-->Revert "add gap between branch dropdown and PR button"<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5638): <!--number 5638 --><!--line 0 --><!--description QmV0dGVyIG1lc3NhZ2VzIGZvciBjYXNlcyBvZiBwcml2YXRlIHByb2ZpbGVz-->Better messages for cases of private profiles<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/5637): <!--number 5637 --><!--line 0 --><!--description ZmVhdChjaSk6IGFsbG93IG1hbnVhbCB0cmlnZ2VyaW5nIG9mIHRoZSB0ZXN0IHN1aXRl-->feat(ci): allow manual triggering of the test suite<!--description-->

View file

@ -19,7 +19,7 @@ See also the [dedicated blog post](https://forgejo.org/2025-02-release-v10-0-1/)
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6817) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6832)): <!--number 6832 --><!--line 0 --><!--description Zml4OiBhdm9pZCB5LWF4aXMgY2xpcHBpbmcgZm9yIGJyYW5jaCBuYW1l-->fix: avoid y-axis clipping for branch name<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6646) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6810)): <!--number 6810 --><!--line 0 --><!--description Y2k6IGZpeCBnbyB2ZXJzaW9uIGNoZWNr-->ci: fix go version check<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6808) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6809)): <!--number 6809 --><!--line 0 --><!--description Y2hvcmUoaTE4bik6IGxpbnQgZXJyb3Jz-->chore(i18n): lint errors<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6782) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6783)): <!--number 6783 --><!--line 0 --><!--description Zml4OiBtYWtlIGF1dGhvciBzZWFyY2ggY2FzZSBpbnNlbnN0aXZl-->fix: make author search case insenstive<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6782) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6783)): <!--number 6783 --><!--line 0 --><!--description Zml4OiBtYWtlIGF1dGhvciBzZWFyY2ggY2FzZSBpbnNlbnN0aXZl-->fix: make author search case insensitive<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6620) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6770)): <!--number 6770 --><!--line 0 --><!--description Zml4KHVpKTogYWRkIHRyaWFuZ2xlIGRvd24gb2N0aWNvbiB0byBjb2RlIHNlYXJjaCBvcHRpb25zIGRyb3Bkb3du-->fix(ui): add triangle down octicon to code search options dropdown<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6708) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6749)): <!--number 6749 --><!--line 0 --><!--description U2V0IGV4cGxvcmUgcGFnZXMgdG8gY29uZmlndXJhYmxlIGRlZmF1bHQgc29ydA==-->Set explore pages to configurable default sort<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/6734) ([backported](https://codeberg.org/forgejo/forgejo/pulls/6748)): <!--number 6748 --><!--line 0 --><!--description RGlzYWJsZSBhdXRvZm9jdXMgb24gdGhlIGRhc2hib2FyZCByZXBvc2l0b3J5IHNlYXJjaCBib3g=-->Disable autofocus on the dashboard repository search box<!--description-->

View file

@ -14,7 +14,7 @@ This is a security release. See the documentation for more information on the [u
- Bug fixes
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4896) ([backported](https://codeberg.org/forgejo/forgejo/pulls/4901)): <!--number 4901 --><!--line 0 --><!--description ZGlzYWxsb3cgamF2YXNjcmlwdDogVVJJIGluIHRoZSByZXBvc2l0b3J5IGRlc2NyaXB0aW9u-->disallow javascript: URI in the repository description<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4852) ([backported](https://codeberg.org/forgejo/forgejo/pulls/4865)): <!--number 4865 --><!--line 0 --><!--description RW5zdXJlIGFsbCBmaWx0ZXJzIGFyZSBwZXJzaXN0ZW50IGluIGlzc3VlIGZpbHRlcnM=-->Ensure all filters are persistent in issue filters<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4828) ([backported](https://codeberg.org/forgejo/forgejo/pulls/4840)): <!--number 4840 --><!--line 0 --><!--description QWxsb3cgNCBjaGFyYWNodGVyIFNIQSBpbiBgL3NyYy9jb21taXRg-->Allow 4 charachter SHA in `/src/commit`<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4828) ([backported](https://codeberg.org/forgejo/forgejo/pulls/4840)): <!--number 4840 --><!--line 0 --><!--description QWxsb3cgNCBjaGFyYWNodGVyIFNIQSBpbiBgL3NyYy9jb21taXRg-->Allow 4 character SHA in `/src/commit`<!--description-->
- Localization
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4668) ([backported](https://codeberg.org/forgejo/forgejo/pulls/4881)): <!--number 4881 --><!--line 0 --><!--description aTE4bjogYmFja3BvcnQgb2YgIzQ2NjggYW5kICM0NzgzIHRvIHY4-->i18n: backport of #4668 and #4783 to v8<!--description-->
<!--end release-notes-assistant-->

View file

@ -295,7 +295,7 @@ func GetRepoPermissions(ctx *context.APIContext) {
// Only allow the request in any of the following situations:
// - The user is the instance admin.
// - The user is the repository admin.
// - The user is querying the permissiosn of themselves.
// - The user is querying the permissions of themselves.
if !ctx.IsUserSiteAdmin() && ctx.Doer.ID != collaborator.ID && !ctx.IsUserRepoAdmin() {
ctx.Error(http.StatusForbidden, "User", "Only admins can query all permissions, repo admins can query all repo permissions, collaborators can query only their own")
return

View file

@ -199,7 +199,7 @@ func NewCommit(row, column int, line []byte) (*Commit, error) {
if len(data) < 5 {
return nil, fmt.Errorf("malformed data section on line %d with commit: %s", row, string(line))
}
// Format is a slight modifcation from RFC1123Z
// Format is a slight modification from RFC1123Z
t, err := time.Parse("Mon, _2 Jan 2006 15:04:05 -0700", string(data[2]))
if err != nil {
return nil, fmt.Errorf("could not parse date of commit: %w", err)

View file

@ -33,7 +33,7 @@
{{if eq $val.Type "boolean"}}
<div class="ui checkbox">
<label><strong>{{if $val.Description}}{{$val.Description}}{{else}}{{$key}}{{end}}</strong></label>
{{/* These two inputs need to stay in exactly this order (checkbox first, hidden second) or boolean fields wont work correctly! */}}
{{/* These two inputs need to stay in exactly this order (checkbox first, hidden second) or boolean fields won't work correctly! */}}
<input type="checkbox" name="inputs[{{$key}}]" value="on" {{if eq $val.Default "true"}}checked{{end}}>
<input type="hidden" name="inputs[{{$key}}]" value="off" autocomplete="off">
</div>

View file

@ -123,7 +123,7 @@ func TestAPIForkListPrivateRepo(t *testing.T) {
}).AddTokenAuth(token)
MakeRequest(t, req, http.StatusAccepted)
t.Run("Anomynous", func(t *testing.T) {
t.Run("Anonymous", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo1/forks")

View file

@ -134,7 +134,7 @@ func TestFeed(t *testing.T) {
})
t.Run("View permission", func(t *testing.T) {
t.Run("Anomynous", func(t *testing.T) {
t.Run("Anonymous", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/org3/repo3/rss/branch/master")
MakeRequest(t, req, http.StatusNotFound)

View file

@ -249,7 +249,7 @@ func TestForkListPrivateRepo(t *testing.T) {
testRepoFork(t, session, "user2", "repo1", org23.Name, "repo1")
t.Run("Anomynous", func(t *testing.T) {
t.Run("Anonymous", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/user2/repo1/forks")

View file

@ -194,7 +194,7 @@ func TestRepoGenerateTemplating(t *testing.T) {
})
defer f()
// The repo.TemplateID field is not initalized. Luckly the ID field holds the expected value
// The repo.TemplateID field is not initialized. Luckily, the ID field holds the expected value
templateID := strconv.FormatInt(template.ID, 10)
testRepoGenerate(

View file

@ -344,7 +344,7 @@ $.api = $.fn.api = function(parameters) {
cancelled: function() {
return (module.cancelled || false);
},
succesful: function() { // codespell-ignore
succesful: function() { // codespell:ignore
module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
return module.was.successful();
},

View file

@ -262,7 +262,7 @@ const sfc = {
try {
this.loading = true;
// Since no async operations occured since fetching myLoadingLogCursors, we can be sure that we have the most
// Since no async operations occurred since fetching myLoadingLogCursors, we can be sure that we have the most
// recent needed log cursors, so we can reset needLoadingWithLogCursors -- it could be stale if exceptions
// occurred in previous load attempts.
this.needLoadingWithLogCursors = null;