summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-04-24 08:48:43 +0200
committerGitHub <noreply@github.com>2023-04-24 02:48:43 -0400
commita319da0688763df662f5ef71684c8e9101803dbb (patch)
tree82f8521143902e8fcf328b7ac87e87ba946ff5da /Makefile
parentcc8874864ca44ec013e132ebcb80b40878010d12 (diff)
downloadgitea-a319da0688763df662f5ef71684c8e9101803dbb.tar.gz
gitea-a319da0688763df662f5ef71684c8e9101803dbb.zip
Replace whitespace inside template parens during make fmt (#24293)
Remove space/tab after `(` and before `)` in templates. Only two violations it seems.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c94f36d6a9..9291c44865 100644
--- a/Makefile
+++ b/Makefile
@@ -278,8 +278,12 @@ clean:
fmt:
GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
$(eval TEMPLATES := $(shell find templates -type f -name '*.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)
+ @# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only
+ @# whitespace before it
+ @$(SED_INPLACE) \
+ -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' \
+ -e 's/([ ]\{1,\}/(/g' -e '/^[ ]\{1,\})/! s/[ ]\{1,\})/)/g' \
+ $(TEMPLATES)
.PHONY: fmt-check
fmt-check: fmt