summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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