From 647b2649b1600107c5fec3505db691f78b2c1e2a Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 31 Aug 2022 17:58:54 +0200 Subject: Make sure fmt catches all templates (#20979) * Make sure fmt catches all templates Make's `wildcard` is not recursive so it missed many template files, fix that by using `find`. * Update Makefile --- templates/repo/diff/blob_excerpt.tmpl | 8 ++++---- templates/repo/diff/comment_form_datahandler.tmpl | 6 +++--- templates/repo/diff/comments.tmpl | 12 ++++++------ templates/repo/diff/compare.tmpl | 8 ++++---- templates/repo/diff/image_diff.tmpl | 16 ++++++++-------- templates/repo/diff/new_review.tmpl | 4 ++-- templates/repo/diff/section_split.tmpl | 4 ++-- templates/repo/diff/section_unified.tmpl | 4 ++-- templates/repo/diff/whitespace_dropdown.tmpl | 8 ++++---- 9 files changed, 35 insertions(+), 35 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index c821d12d90..402435c467 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -3,12 +3,12 @@ {{if eq .GetType 4}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} {{svg "octicon-fold-down"}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} {{svg "octicon-fold-up"}} @@ -47,12 +47,12 @@ {{if eq .GetType 4}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} {{svg "octicon-fold-down"}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} {{svg "octicon-fold-up"}} diff --git a/templates/repo/diff/comment_form_datahandler.tmpl b/templates/repo/diff/comment_form_datahandler.tmpl index 9656944719..d0e493488d 100644 --- a/templates/repo/diff/comment_form_datahandler.tmpl +++ b/templates/repo/diff/comment_form_datahandler.tmpl @@ -1,7 +1,7 @@ {{if $.comment}} - {{ template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}} + {{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}} {{else if $.root}} - {{ template "repo/diff/comment_form" $}} + {{template "repo/diff/comment_form" $}} {{else}} - {{ template "repo/diff/comment_form" dict "root" $}} + {{template "repo/diff/comment_form" dict "root" $}} {{end}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 9905f09baa..0cc7853378 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -1,8 +1,8 @@ {{range .comments}} -{{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.locale }} +{{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
- {{if .OriginalAuthor }} + {{if .OriginalAuthor}} {{else}} @@ -12,17 +12,17 @@
- {{if .OriginalAuthor }} + {{if .OriginalAuthor}} {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}} - {{ .OriginalAuthor }} + {{.OriginalAuthor}} {{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.root.Repository.OriginalURL}} - ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe }}) + ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe}}) {{end}} {{else}} @@ -46,7 +46,7 @@
{{end}} {{end}} - {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }} + {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}} {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 426ea737bd..5875efaac3 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -7,11 +7,11 @@ {{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} {{.locale.Tr "repo.pulls.compare_changes"}}
{{.locale.Tr "repo.pulls.compare_changes_desc"}}
- {{ else }} + {{else}} {{.locale.Tr "action.compare_commits_general"}} - {{ end }} + {{end}} - {{ $BaseCompareName := $.BaseName -}} + {{$BaseCompareName := $.BaseName -}} {{- $HeadCompareName := $.HeadRepo.OwnerName -}} {{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} @@ -174,7 +174,7 @@
{{if .IsNothingToCompare}} - {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }} + {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl index 71a6da5c5e..4b95c8d85f 100644 --- a/templates/repo/diff/image_diff.tmpl +++ b/templates/repo/diff/image_diff.tmpl @@ -4,17 +4,17 @@
-
+
- {{if .blobBase }} + {{if .blobBase}}

{{.root.locale.Tr "repo.diff.file_before"}}

@@ -29,7 +29,7 @@

{{end}} - {{if .blobHead }} + {{if .blobHead}}

{{.root.locale.Tr "repo.diff.file_after"}}

@@ -47,7 +47,7 @@
{{if and .blobBase .blobHead}} -
+
@@ -61,7 +61,7 @@
-
+
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 857577b152..60ebb61fb9 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -22,9 +22,9 @@
{{end}}
- + - +
diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index 5ea71ae595..6143a47158 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -6,12 +6,12 @@ {{if eq .GetType 4}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} {{svg "octicon-fold-down"}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} {{svg "octicon-fold-up"}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index aaf53b97c5..373747002c 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -5,12 +5,12 @@ {{if eq .GetType 4}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} {{svg "octicon-fold-down"}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} {{svg "octicon-fold-up"}} diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl index d28cb12bf8..9df79dab73 100644 --- a/templates/repo/diff/whitespace_dropdown.tmpl +++ b/templates/repo/diff/whitespace_dropdown.tmpl @@ -3,19 +3,19 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}} -- cgit v1.2.3