diff options
author | silverwind <me@silverwind.io> | 2023-04-24 08:48:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 02:48:43 -0400 |
commit | a319da0688763df662f5ef71684c8e9101803dbb (patch) | |
tree | 82f8521143902e8fcf328b7ac87e87ba946ff5da /Makefile | |
parent | cc8874864ca44ec013e132ebcb80b40878010d12 (diff) | |
download | gitea-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-- | Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |