diff --git a/Makefile b/Makefile index 44e245d22..f7e91c05a 100644 --- a/Makefile +++ b/Makefile @@ -242,8 +242,10 @@ clean: .PHONY: fmt fmt: - @echo "Running gitea-fmt (with gofumpt)..." @MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}' + $(eval TEMPLATES := $(wildcard templates/**/*.tmpl)) + @# strip whitespace after '{{' and before `}}` unless there is only whitespace before it + @$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES) .PHONY: vet vet: @@ -288,13 +290,19 @@ errcheck: .PHONY: fmt-check fmt-check: - # get all go files and run gitea-fmt (with gofmt) on them + @# get all go files and run gitea-fmt (with gofmt) on them @diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \ if [ -n "$$diff" ]; then \ echo "Please run 'make fmt' and commit the result:"; \ echo "$${diff}"; \ exit 1; \ fi + @diff2=$$(git diff templates); \ + if [ -n "$$diff2" ]; then \ + echo "Please run 'make fmt' and commit the result:"; \ + echo "$${diff2}"; \ + exit 1; \ + fi .PHONY: checks checks: checks-frontend checks-backend diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index ccd1029cd..0d9432b39 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -50,7 +50,7 @@
{{.locale.Tr "admin.monitor.queue.wrapped.desc"}}
{{else if eq .Queue.Type "persistable-channel"}}{{.locale.Tr "admin.monitor.queue.persistable-channel.desc"}}
@@ -58,7 +58,7 @@{{.Function}}
{{.File}}:{{.Line}}