From 8c3984a95ec5c364e9a731f5c65f6bbc043a5882 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 27 Oct 2025 17:07:43 +0100 Subject: [PATCH 1/4] Move `codeformat` folder to tools --- Makefile | 2 +- tools/code-batch-process.go | 2 +- {build => tools}/codeformat/formatimports.go | 0 {build => tools}/codeformat/formatimports_test.go | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename {build => tools}/codeformat/formatimports.go (100%) rename {build => tools}/codeformat/formatimports_test.go (100%) diff --git a/Makefile b/Makefile index e81dab7f6cbf8..5d3236aa2219b 100644 --- a/Makefile +++ b/Makefile @@ -163,7 +163,7 @@ TEST_TAGS ?= $(TAGS_SPLIT) sqlite sqlite_unlock_notify TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR) -GO_DIRS := build cmd models modules routers services tests +GO_DIRS := build cmd models modules routers services tests tools WEB_DIRS := web_src/js web_src/css ESLINT_FILES := web_src/js tools *.ts tests/e2e diff --git a/tools/code-batch-process.go b/tools/code-batch-process.go index 2c7ccdf8a6c10..5030d8bbc3d24 100644 --- a/tools/code-batch-process.go +++ b/tools/code-batch-process.go @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "code.gitea.io/gitea/build/codeformat" + "code.gitea.io/gitea/tools/codeformat" ) // Windows has a limitation for command line arguments, the size can not exceed 32KB. diff --git a/build/codeformat/formatimports.go b/tools/codeformat/formatimports.go similarity index 100% rename from build/codeformat/formatimports.go rename to tools/codeformat/formatimports.go diff --git a/build/codeformat/formatimports_test.go b/tools/codeformat/formatimports_test.go similarity index 100% rename from build/codeformat/formatimports_test.go rename to tools/codeformat/formatimports_test.go From 9f7a8594762e3e865f2eb78388bde5fd23ed90a9 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 27 Oct 2025 17:17:21 +0100 Subject: [PATCH 2/4] fix SPELLCHECK_FILES --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5d3236aa2219b..e87157da4d624 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,7 @@ WEB_DIRS := web_src/js web_src/css ESLINT_FILES := web_src/js tools *.ts tests/e2e STYLELINT_FILES := web_src/css web_src/js/components/*.vue -SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*)) +SPELLCHECK_FILES := $(filter-out tools, $(GO_DIRS)) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*)) EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini GO_SOURCES := $(wildcard *.go) From 391cc60bcc8c160c6f96ab36741b2bbd3476553b Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 27 Oct 2025 17:18:57 +0100 Subject: [PATCH 3/4] move misspellings.csv to root and lint tools directory as a whole --- Makefile | 6 +++--- tools/misspellings.csv => misspellings.csv | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename tools/misspellings.csv => misspellings.csv (100%) diff --git a/Makefile b/Makefile index e87157da4d624..5477b7e6bc299 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,7 @@ WEB_DIRS := web_src/js web_src/css ESLINT_FILES := web_src/js tools *.ts tests/e2e STYLELINT_FILES := web_src/css web_src/js/components/*.vue -SPELLCHECK_FILES := $(filter-out tools, $(GO_DIRS)) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*)) +SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini GO_SOURCES := $(wildcard *.go) @@ -376,11 +376,11 @@ lint-md: node_modules ## lint markdown files .PHONY: lint-spell lint-spell: ## lint spelling - @go run $(MISSPELL_PACKAGE) -dict tools/misspellings.csv -error $(SPELLCHECK_FILES) + @go run $(MISSPELL_PACKAGE) -dict misspellings.csv -error $(SPELLCHECK_FILES) .PHONY: lint-spell-fix lint-spell-fix: ## lint spelling and fix issues - @go run $(MISSPELL_PACKAGE) -dict tools/misspellings.csv -w $(SPELLCHECK_FILES) + @go run $(MISSPELL_PACKAGE) -dict misspellings.csv -w $(SPELLCHECK_FILES) .PHONY: lint-go lint-go: ## lint go files diff --git a/tools/misspellings.csv b/misspellings.csv similarity index 100% rename from tools/misspellings.csv rename to misspellings.csv From 7e4bcb970c125e7e3754e91e0b16ad28fef16ac0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 27 Oct 2025 17:45:01 +0100 Subject: [PATCH 4/4] move to assets --- Makefile | 4 ++-- misspellings.csv => assets/misspellings.csv | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename misspellings.csv => assets/misspellings.csv (100%) diff --git a/Makefile b/Makefile index 5477b7e6bc299..7531e56d83406 100644 --- a/Makefile +++ b/Makefile @@ -376,11 +376,11 @@ lint-md: node_modules ## lint markdown files .PHONY: lint-spell lint-spell: ## lint spelling - @go run $(MISSPELL_PACKAGE) -dict misspellings.csv -error $(SPELLCHECK_FILES) + @go run $(MISSPELL_PACKAGE) -dict assets/misspellings.csv -error $(SPELLCHECK_FILES) .PHONY: lint-spell-fix lint-spell-fix: ## lint spelling and fix issues - @go run $(MISSPELL_PACKAGE) -dict misspellings.csv -w $(SPELLCHECK_FILES) + @go run $(MISSPELL_PACKAGE) -dict assets/misspellings.csv -w $(SPELLCHECK_FILES) .PHONY: lint-go lint-go: ## lint go files diff --git a/misspellings.csv b/assets/misspellings.csv similarity index 100% rename from misspellings.csv rename to assets/misspellings.csv