Skip to content

Commit a4a551b

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: (37 commits) [skip ci] Updated translations via Crowdin Add all `no-query` rules to eslint config (go-gitea#24294) Fix bug when deleting wiki with no code write permission (go-gitea#24274) Move code from module to service (go-gitea#24287) Add comments for Manually Merged feature (go-gitea#24291) Allow using localized absolute date times within phrases with place holders and localize issue due date events (go-gitea#24275) Handle canceled workflow as a warning instead of a fail (go-gitea#24282) Tweak pull request branch delete ui (go-gitea#23951) Restore air delay of 1000ms (go-gitea#24290) Load reviewer for comments when dismissing a review (go-gitea#24281) Set type="password" on all auth_token fields (go-gitea#22175) Only delete secrets belonging to its owner (go-gitea#24284) Fix inconsistent wiki path converting. (go-gitea#24277) Change to vertical navbar layout for secondary navbar for repo/user/admin settings (go-gitea#24246) Refactor delete_modal_actions template and use it for project column related actions (go-gitea#24097) update upgrade script to use new CDN (go-gitea#24280) show workflow config error on file view also (go-gitea#24267) Add missing badges in user profile for /projects and /packages (go-gitea#24232) [skip ci] Updated translations via Crowdin Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (go-gitea#24270) ... # Conflicts: # templates/base/footer_content.tmpl
2 parents a4c41bb + a0cfc1c commit a4a551b

File tree

308 files changed

+2704
-2587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+2704
-2587
lines changed

.air.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ tmp_dir = ".air"
44
[build]
55
cmd = "make backend"
66
bin = "gitea"
7+
delay = 1000
78
include_ext = ["go", "tmpl"]
8-
exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata", "models/fixtures", "models/migrations/fixtures", "modules/migration/file_format_testdata", "modules/avatar/identicon/testdata"]
9+
include_file = ["main.go"]
910
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
11+
exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata", "models/fixtures", "models/migrations/fixtures", "modules/migration/file_format_testdata", "modules/avatar/identicon/testdata"]
1012
exclude_regex = ["_test.go$", "_gen.go$"]

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ steps:
5959
- name: lint-backend-windows
6060
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
6161
commands:
62-
- make golangci-lint-windows vet
62+
- make lint-go-windows lint-go-vet
6363
environment:
6464
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
6565
GOSUMDB: sum.golang.org

.eslintrc.yaml

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ rules:
193193
jquery/no-val: [0]
194194
jquery/no-when: [2]
195195
jquery/no-wrap: [2]
196-
no-jquery/no-event-shorthand: [2]
197196
key-spacing: [2]
198197
keyword-spacing: [2]
199198
line-comment-position: [0]
@@ -272,6 +271,99 @@ rules:
272271
no-invalid-this: [0]
273272
no-irregular-whitespace: [2]
274273
no-iterator: [2]
274+
no-jquery/no-ajax-events: [2]
275+
no-jquery/no-ajax: [0]
276+
no-jquery/no-and-self: [2]
277+
no-jquery/no-animate-toggle: [2]
278+
no-jquery/no-animate: [2]
279+
no-jquery/no-append-html: [0]
280+
no-jquery/no-attr: [0]
281+
no-jquery/no-bind: [2]
282+
no-jquery/no-box-model: [2]
283+
no-jquery/no-browser: [2]
284+
no-jquery/no-camel-case: [2]
285+
no-jquery/no-class-state: [0]
286+
no-jquery/no-class: [0]
287+
no-jquery/no-clone: [2]
288+
no-jquery/no-closest: [0]
289+
no-jquery/no-constructor-attributes: [2]
290+
no-jquery/no-contains: [2]
291+
no-jquery/no-context-prop: [2]
292+
no-jquery/no-css: [0]
293+
no-jquery/no-data: [0]
294+
no-jquery/no-deferred: [2]
295+
no-jquery/no-delegate: [2]
296+
no-jquery/no-each-collection: [0]
297+
no-jquery/no-each-util: [0]
298+
no-jquery/no-each: [0]
299+
no-jquery/no-error-shorthand: [2]
300+
no-jquery/no-error: [2]
301+
no-jquery/no-escape-selector: [2]
302+
no-jquery/no-event-shorthand: [2]
303+
no-jquery/no-extend: [2]
304+
no-jquery/no-fade: [2]
305+
no-jquery/no-filter: [0]
306+
no-jquery/no-find-collection: [0]
307+
no-jquery/no-find-util: [2]
308+
no-jquery/no-find: [0]
309+
no-jquery/no-fx-interval: [2]
310+
no-jquery/no-global-eval: [2]
311+
no-jquery/no-global-selector: [0]
312+
no-jquery/no-grep: [2]
313+
no-jquery/no-has: [2]
314+
no-jquery/no-hold-ready: [2]
315+
no-jquery/no-html: [0]
316+
no-jquery/no-in-array: [2]
317+
no-jquery/no-is-array: [2]
318+
no-jquery/no-is-empty-object: [2]
319+
no-jquery/no-is-function: [2]
320+
no-jquery/no-is-numeric: [2]
321+
no-jquery/no-is-plain-object: [2]
322+
no-jquery/no-is-window: [2]
323+
no-jquery/no-is: [0]
324+
no-jquery/no-jquery-constructor: [0]
325+
no-jquery/no-live: [2]
326+
no-jquery/no-load-shorthand: [2]
327+
no-jquery/no-load: [2]
328+
no-jquery/no-map-collection: [0]
329+
no-jquery/no-map-util: [2]
330+
no-jquery/no-map: [0]
331+
no-jquery/no-merge: [2]
332+
no-jquery/no-node-name: [2]
333+
no-jquery/no-noop: [2]
334+
no-jquery/no-now: [2]
335+
no-jquery/no-on-ready: [2]
336+
no-jquery/no-other-methods: [0]
337+
no-jquery/no-other-utils: [2]
338+
no-jquery/no-param: [2]
339+
no-jquery/no-parent: [0]
340+
no-jquery/no-parents: [0]
341+
no-jquery/no-parse-html-literal: [0]
342+
no-jquery/no-parse-html: [2]
343+
no-jquery/no-parse-json: [2]
344+
no-jquery/no-parse-xml: [2]
345+
no-jquery/no-prop: [0]
346+
no-jquery/no-proxy: [2]
347+
no-jquery/no-ready-shorthand: [2]
348+
no-jquery/no-ready: [2]
349+
no-jquery/no-selector-prop: [2]
350+
no-jquery/no-serialize: [2]
351+
no-jquery/no-size: [2]
352+
no-jquery/no-sizzle: [0]
353+
no-jquery/no-slide: [2]
354+
no-jquery/no-sub: [2]
355+
no-jquery/no-support: [2]
356+
no-jquery/no-text: [0]
357+
no-jquery/no-trigger: [0]
358+
no-jquery/no-trim: [2]
359+
no-jquery/no-type: [2]
360+
no-jquery/no-unique: [2]
361+
no-jquery/no-unload-shorthand: [2]
362+
no-jquery/no-val: [0]
363+
no-jquery/no-visibility: [2]
364+
no-jquery/no-when: [2]
365+
no-jquery/no-wrap: [2]
366+
no-jquery/variable-pattern: [0]
275367
no-label-var: [2]
276368
no-labels: [0] # handled by no-restricted-syntax
277369
no-lone-blocks: [2]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ cpu.out
7171
/tests/e2e/test-artifacts
7272
/tests/e2e/test-snapshots
7373
/tests/*.ini
74+
/tests/**/*.git/**/*.sample
7475
/node_modules
7576
/yarn.lock
7677
/yarn-error.log

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ linters:
2222
- unconvert
2323
- unused
2424
# - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
25-
# - wastedassign # disabled - https://github.com/golangci/golangci-lint/issues/2649
25+
- wastedassign
2626
enable-all: false
2727
disable-all: true
2828
fast: false

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ Patrick Schratz <[email protected]> (@pat-s)
4141
Janis Estelmann <[email protected]> (@KN4CK3R)
4242
Steven Kriegler <[email protected]> (@justusbunsi)
4343
Jimmy Praet <[email protected]> (@jpraet)
44-
Leon Hofmeister <[email protected]> (@delvh)
44+
Leon Hofmeister <[email protected]> (@delvh)
4545
Wim <[email protected]> (@42wim)
4646
Jason Song <[email protected]> (@wolfogre)
4747
Yarden Shoham <[email protected]> (@yardenshoham)
4848
Yu Tian <[email protected]> (@Zettat123)
4949
Eddie Yang <[email protected]> (@yp05327)
5050
Dong Ge <[email protected]> (@sillyguodong)
5151
Xinyi Gong <[email protected]> (@HesterG)
52+
wxiaoguang <[email protected]> (@wxiaoguang)

Makefile

Lines changed: 71 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ COMMA := ,
2525

2626
XGO_VERSION := go-1.20.x
2727

28-
AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
29-
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
30-
ERRCHECK_PACKAGE ?= github.com/kisielk/[email protected]
31-
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
32-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
33-
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
28+
AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
29+
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
30+
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
32+
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3433
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
3534
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3635
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
37-
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.5.0
36+
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
3837
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
3938

4039
DOCKER_IMAGE ?= gitea/gitea
@@ -194,9 +193,20 @@ help:
194193
@echo " - deps-backend install backend dependencies"
195194
@echo " - deps-tools install tool dependencies"
196195
@echo " - lint lint everything"
196+
@echo " - lint-fix lint everything and fix issues"
197197
@echo " - lint-frontend lint frontend files"
198+
@echo " - lint-frontend-fix lint frontend files and fix issues"
198199
@echo " - lint-backend lint backend files"
200+
@echo " - lint-backend-fix lint backend files and fix issues"
201+
@echo " - lint-go lint go files"
202+
@echo " - lint-go-fix lint go files and fix issues"
203+
@echo " - lint-go-vet lint go files with vet"
204+
@echo " - lint-js lint js files"
205+
@echo " - lint-js-fix lint js files and fix issues"
206+
@echo " - lint-css lint css files"
207+
@echo " - lint-css-fix lint css files and fix issues"
199208
@echo " - lint-md lint markdown files"
209+
@echo " - lint-swagger lint swagger files"
200210
@echo " - checks run various consistency checks"
201211
@echo " - checks-frontend check frontend files"
202212
@echo " - checks-backend check backend files"
@@ -214,9 +224,7 @@ help:
214224
@echo " - generate-manpage generate manpage"
215225
@echo " - generate-swagger generate the swagger spec from code comments"
216226
@echo " - swagger-validate check if the swagger spec is valid"
217-
@echo " - golangci-lint run golangci-lint linter"
218227
@echo " - go-licenses regenerate go licenses"
219-
@echo " - vet examines Go source code and reports suspicious constructs"
220228
@echo " - tidy run go mod tidy"
221229
@echo " - test[\#TestSpecificName] run unit test"
222230
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
@@ -286,12 +294,6 @@ fmt-check: fmt
286294
misspell-check:
287295
go run $(MISSPELL_PACKAGE) -error $(GO_DIRS) $(WEB_DIRS)
288296

289-
.PHONY: vet
290-
vet:
291-
@echo "Running go vet..."
292-
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
293-
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
294-
295297
.PHONY: $(TAGS_EVIDENCE)
296298
$(TAGS_EVIDENCE):
297299
@mkdir -p $(MAKE_EVIDENCE_DIR)
@@ -324,11 +326,6 @@ swagger-validate:
324326
$(GO) run $(SWAGGER_PACKAGE) validate './$(SWAGGER_SPEC)'
325327
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
326328

327-
.PHONY: errcheck
328-
errcheck:
329-
@echo "Running errcheck..."
330-
$(GO) run $(ERRCHECK_PACKAGE) $(GO_PACKAGES)
331-
332329
.PHONY: checks
333330
checks: checks-frontend checks-backend
334331

@@ -341,18 +338,69 @@ checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-valida
341338
.PHONY: lint
342339
lint: lint-frontend lint-backend
343340

341+
.PHONY: lint-fix
342+
lint-fix: lint-frontend-fix lint-backend-fix
343+
344344
.PHONY: lint-frontend
345-
lint-frontend: node_modules lint-md
345+
lint-frontend: lint-js lint-css lint-md lint-swagger
346+
347+
.PHONY: lint-frontend-fix
348+
lint-frontend-fix: lint-js-fix lint-css-fix lint-md lint-swagger
349+
350+
.PHONY: lint-backend
351+
lint-backend: lint-go lint-go-vet lint-editorconfig
352+
353+
.PHONY: lint-backend-fix
354+
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
355+
356+
.PHONY: lint-js
357+
lint-js: node_modules
346358
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e
359+
360+
.PHONY: lint-js-fix
361+
lint-js-fix: node_modules
362+
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e --fix
363+
364+
.PHONY: lint-css
365+
lint-css: node_modules
347366
npx stylelint --color --max-warnings=0 web_src/css
367+
368+
.PHONY: lint-css-fix
369+
lint-css-fix: node_modules
370+
npx stylelint --color --max-warnings=0 web_src/css --fix
371+
372+
.PHONY: lint-swagger
373+
lint-swagger: node_modules
348374
npx spectral lint -q -F hint $(SWAGGER_SPEC)
349375

350376
.PHONY: lint-md
351377
lint-md: node_modules
352378
npx markdownlint docs *.md
353379

354-
.PHONY: lint-backend
355-
lint-backend: golangci-lint vet editorconfig-checker
380+
.PHONY: lint-go
381+
lint-go:
382+
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
383+
384+
.PHONY: lint-go-fix
385+
lint-go-fix:
386+
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix
387+
388+
# workaround step for the lint-backend-windows CI task because 'go run' can not
389+
# have distinct GOOS/GOARCH for its build and run steps
390+
.PHONY: lint-go-windows
391+
lint-go-windows:
392+
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
393+
golangci-lint run
394+
395+
.PHONY: lint-go-vet
396+
lint-go-vet:
397+
@echo "Running go vet..."
398+
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
399+
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
400+
401+
.PHONY: lint-editorconfig
402+
lint-editorconfig:
403+
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates
356404

357405
.PHONY: watch
358406
watch:
@@ -843,7 +891,6 @@ deps-backend:
843891
deps-tools:
844892
$(GO) install $(AIR_PACKAGE)
845893
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
846-
$(GO) install $(ERRCHECK_PACKAGE)
847894
$(GO) install $(GOFUMPT_PACKAGE)
848895
$(GO) install $(GOLANGCI_LINT_PACKAGE)
849896
$(GO) install $(GXZ_PAGAGE)
@@ -942,21 +989,6 @@ generate-manpage:
942989
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
943990
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
944991

945-
.PHONY: golangci-lint
946-
golangci-lint:
947-
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
948-
949-
# workaround step for the lint-backend-windows CI task because 'go run' can not
950-
# have distinct GOOS/GOARCH for its build and run steps
951-
.PHONY: golangci-lint-windows
952-
golangci-lint-windows:
953-
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
954-
golangci-lint run
955-
956-
.PHONY: editorconfig-checker
957-
editorconfig-checker:
958-
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates
959-
960992
.PHONY: docker
961993
docker:
962994
docker build --disable-content-trust=false -t $(DOCKER_REF) .

assets/go-licenses.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/migrate_storage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestMigratePackages(t *testing.T) {
6767

6868
entries, err := os.ReadDir(p)
6969
assert.NoError(t, err)
70-
assert.EqualValues(t, 2, len(entries))
70+
assert.Len(t, entries, 2)
7171
assert.EqualValues(t, "01", entries[0].Name())
7272
assert.EqualValues(t, "tmp", entries[1].Name())
7373
}

contrib/upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# This is an update script for gitea installed via the binary distribution
3-
# from dl.gitea.io on linux as systemd service. It performs a backup and updates
3+
# from dl.gitea.com on linux as systemd service. It performs a backup and updates
44
# Gitea in place.
55
# NOTE: This adds the GPG Signing Key of the Gitea maintainers to the keyring.
66
# Depends on: bash, curl, xz, sha256sum. optionally jq, gpg
@@ -69,7 +69,7 @@ require curl xz sha256sum "$sudocmd"
6969
# select version to install
7070
if [[ -z "${giteaversion:-}" ]]; then
7171
require jq
72-
giteaversion=$(curl --connect-timeout 10 -sL https://dl.gitea.io/gitea/version.json | jq -r .latest.version)
72+
giteaversion=$(curl --connect-timeout 10 -sL https://dl.gitea.com/gitea/version.json | jq -r .latest.version)
7373
echo "Latest available version is $giteaversion"
7474
fi
7575

@@ -91,7 +91,7 @@ cd "$giteahome" # needed for gitea dump later
9191

9292
# download new binary
9393
binname="gitea-${giteaversion}-${arch}"
94-
binurl="https://dl.gitea.io/gitea/${giteaversion}/${binname}.xz"
94+
binurl="https://dl.gitea.com/gitea/${giteaversion}/${binname}.xz"
9595
echo "Downloading $binurl..."
9696
curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.sha256,.asc}"
9797

custom/conf/app.example.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,6 @@ ROUTER = console
23402340
;[other]
23412341
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23422342
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2343-
;SHOW_FOOTER_BRANDING = false
23442343
;; Show version information about Gitea and Go in the footer
23452344
;SHOW_FOOTER_VERSION = true
23462345
;; Show template execution time in the footer

0 commit comments

Comments
 (0)