diff --git a/.editorconfig b/.editorconfig
index 54738e883..b7ff926c3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -12,6 +12,12 @@ insert_final_newline = true
[*.{go,tmpl,html}]
indent_style = tab
+[templates/custom/*.tmpl]
+insert_final_newline = false
+
+[templates/swagger/v1_json.tmpl]
+indent_style = space
+
[Makefile]
indent_style = tab
diff --git a/Makefile b/Makefile
index e8738c928..dcfaf89a8 100644
--- a/Makefile
+++ b/Makefile
@@ -325,6 +325,7 @@ lint: lint-frontend lint-backend
lint-frontend: node_modules
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js
npx stylelint --color --max-warnings=0 web_src/less
+ npx editorconfig-checker templates
.PHONY: lint-backend
lint-backend: golangci-lint revive vet
diff --git a/package-lock.json b/package-lock.json
index 2c1dd4f6b..3777c6b72 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1570,6 +1570,32 @@
"resolved": "https://registry.npmjs.org/add-asset-webpack-plugin/-/add-asset-webpack-plugin-2.0.1.tgz",
"integrity": "sha512-Hx9EKnirCUfdh684y1yhx8QOFolpkIG2VRHHgNm8wFy1Cf7P3RGwS678hoN7Y1XvZRPpVXWa+6QnfL/2i0CMCA=="
},
+ "agent-base": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
+ "dev": true,
+ "requires": {
+ "debug": "4"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ }
+ }
+ },
"aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
@@ -3388,6 +3414,17 @@
"safer-buffer": "^2.1.0"
}
},
+ "editorconfig-checker": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/editorconfig-checker/-/editorconfig-checker-4.0.2.tgz",
+ "integrity": "sha512-tUI7ABIzMB1kfwTUQmX+gaZGCMNuUgGuRHJ+Xu4Tk9T8lV8Vy5w/EaQsSZ7NKrOgLxbekptw6MUgrzHTvhceLw==",
+ "dev": true,
+ "requires": {
+ "https-proxy-agent": "^5.0.0",
+ "node-fetch": "^2.6.0",
+ "tar": "^6.0.0"
+ }
+ },
"electron-to-chromium": {
"version": "1.3.707",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
@@ -4936,6 +4973,33 @@
"sshpk": "^1.7.0"
}
},
+ "https-proxy-agent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
+ "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
+ "dev": true,
+ "requires": {
+ "agent-base": "6",
+ "debug": "4"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ }
+ }
+ },
"human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
@@ -8107,6 +8171,12 @@
"lower-case": "^1.1.1"
}
},
+ "node-fetch": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
+ "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
+ "dev": true
+ },
"node-int64": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
diff --git a/package.json b/package.json
index 20a64856f..430e98c07 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,7 @@
},
"devDependencies": {
"eslint": "7.23.0",
+ "editorconfig-checker": "4.0.2",
"eslint-plugin-html": "6.1.2",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-unicorn": "29.0.0",
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index da1ea42a7..e14c3be76 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -96,8 +96,8 @@
-
-
+
+
diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl
index c252f7d3f..36a5d2c63 100644
--- a/templates/admin/auth/new.tmpl
+++ b/templates/admin/auth/new.tmpl
@@ -119,8 +119,8 @@
{{.i18n.Tr "admin.auths.tip.nextcloud"}}
Yandex
{{.i18n.Tr "admin.auths.tip.yandex"}}
- Mastodon
- {{.i18n.Tr "admin.auths.tip.mastodon"}}
+ Mastodon
+ {{.i18n.Tr "admin.auths.tip.mastodon"}}
diff --git a/templates/admin/auth/source/ldap.tmpl b/templates/admin/auth/source/ldap.tmpl
index dbadd31f1..584538f53 100644
--- a/templates/admin/auth/source/ldap.tmpl
+++ b/templates/admin/auth/source/ldap.tmpl
@@ -68,8 +68,8 @@
-
-
+
+
diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl
index 8a7af53da..e4e7e2d46 100644
--- a/templates/admin/base/search.tmpl
+++ b/templates/admin/base/search.tmpl
@@ -17,7 +17,7 @@
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl
index aff30ab51..dbd1ad692 100644
--- a/templates/admin/repo/list.tmpl
+++ b/templates/admin/repo/list.tmpl
@@ -7,7 +7,7 @@
{{.i18n.Tr "admin.repos.repo_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}})
+
{{template "admin/repo/search" .}}
diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl
index 481d77dfd..b1f172720 100644
--- a/templates/admin/repo/unadopted.tmpl
+++ b/templates/admin/repo/unadopted.tmpl
@@ -5,98 +5,98 @@
{{template "base/alert" .}}
-
-
+
- {{if .search}}
-
- {{if .Dirs}}
-
- {{range $dirI, $dir := .Dirs}}
-
-
-
{{svg "octicon-file-directory"}}
-
{{$dir}}
-
-
-
- {{svg "octicon-x" 16 "close inside"}}
-
-
-
{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}
-
-
-
-
-
- {{svg "octicon-x" 16 "close inside"}}
-
-
-
{{$.i18n.Tr "repo.delete_preexisting_content" $dir}}
-
-
-
-
-
-
- {{end}}
-
- {{template "base/paginate" .}}
- {{else}}
-
- {{.i18n.Tr "admin.repos.unadopted.no_more"}}
-
- {{template "base/paginate" .}}
- {{end}}
-
- {{end}}
-
+ {{if .search}}
+
+ {{if .Dirs}}
+
+ {{range $dirI, $dir := .Dirs}}
+
+
+
{{svg "octicon-file-directory"}}
+
{{$dir}}
+
+
+
+ {{svg "octicon-x" 16 "close inside"}}
+
+
+
{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}
+
+
+
+
+
+ {{svg "octicon-x" 16 "close inside"}}
+
+
+
{{$.i18n.Tr "repo.delete_preexisting_content" $dir}}
+
+
+
+
+
+
+ {{end}}
+
+ {{template "base/paginate" .}}
+ {{else}}
+
+ {{.i18n.Tr "admin.repos.unadopted.no_more"}}
+
+ {{template "base/paginate" .}}
+ {{end}}
+
+ {{end}}
+
{{template "base/footer" .}}
diff --git a/templates/base/alert_details.tmpl b/templates/base/alert_details.tmpl
index 38a2721bf..1d7ec15dc 100644
--- a/templates/base/alert_details.tmpl
+++ b/templates/base/alert_details.tmpl
@@ -1,7 +1,7 @@
{{.Message}}
- {{.Summary}}
-
- {{.Details | Str2html}}
-
+ {{.Summary}}
+
+ {{.Details | Str2html}}
+
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 74bca7239..d8d24c61e 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -55,7 +55,7 @@
name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.RelAvatarLink}}'}],
{{ end }}
{{ range .MentionableTeams }}
- ['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}',
+ ['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}',
name: '{{$.MentionableTeamsOrg}}/{{.Name}}', avatar: '{{$.MentionableTeamsOrgAvatar}}'}],
{{ end }}
]).values()),
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl
index 222bbb8aa..6332413a1 100644
--- a/templates/explore/code.tmpl
+++ b/templates/explore/code.tmpl
@@ -18,7 +18,6 @@
-
{{if .SearchResults}}
diff --git a/templates/explore/organizations.tmpl b/templates/explore/organizations.tmpl
index b039c1ad2..b2fee6c19 100644
--- a/templates/explore/organizations.tmpl
+++ b/templates/explore/organizations.tmpl
@@ -8,24 +8,24 @@
{{range .Users}}
{{avatar .}}
-
-
-
- {{if .Location}}
- {{svg "octicon-location"}} {{.Location}}
- {{end}}
- {{if and .Website}}
- {{svg "octicon-link"}}
-
{{.Website}}
- {{end}}
- {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+
+
+
+ {{if .Location}}
+ {{svg "octicon-location"}} {{.Location}}
+ {{end}}
+ {{if and .Website}}
+ {{svg "octicon-link"}}
+
{{.Website}}
+ {{end}}
+ {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+
-
{{else}}
{{$.i18n.Tr "explore.org_no_results"}}
diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl
index 53c5156dc..5e7bed8b3 100644
--- a/templates/explore/repo_search.tmpl
+++ b/templates/explore/repo_search.tmpl
@@ -1,30 +1,30 @@
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl
index d9d2f3b9a..245cc9f34 100644
--- a/templates/explore/search.tmpl
+++ b/templates/explore/search.tmpl
@@ -18,8 +18,8 @@
diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl
index cdb8e9d37..dff4e8c8b 100644
--- a/templates/explore/users.tmpl
+++ b/templates/explore/users.tmpl
@@ -8,19 +8,19 @@
{{range .Users}}
{{avatar .}}
-
-
-
- {{if .Location}}
- {{svg "octicon-location"}} {{.Location}}
- {{end}}
- {{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}}
- {{svg "octicon-mail"}}
-
{{.Email}}
- {{end}}
- {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+
+
+
+ {{if .Location}}
+ {{svg "octicon-location"}} {{.Location}}
+ {{end}}
+ {{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}}
+ {{svg "octicon-mail"}}
+
{{.Email}}
+ {{end}}
+ {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+
-
{{else}}
{{$.i18n.Tr "explore.user_no_results"}}
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl
index d302a16f2..5b0d2526f 100644
--- a/templates/mail/issue/assigned.tmpl
+++ b/templates/mail/issue/assigned.tmpl
@@ -11,11 +11,11 @@
@{{.Doer.Name}} assigned you to the {{if .IsPull}}pull request{{else}}issue{{end}} #{{.Issue.Index}} in repository {{.Repo}}.