forked from forgejo/forgejo
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
parent
1d98d205f5
commit
54e9ee37a7
423 changed files with 1585 additions and 1758 deletions
|
@ -38,17 +38,17 @@ func TestRender_Commits(t *testing.T) {
|
|||
assert.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(buffer))
|
||||
}
|
||||
|
||||
var sha = "65f1bf27bc3bf70f64657658635e66094edbcb4d"
|
||||
var repo = TestRepoURL
|
||||
var commit = util.URLJoin(repo, "commit", sha)
|
||||
var tree = util.URLJoin(repo, "tree", sha, "src")
|
||||
sha := "65f1bf27bc3bf70f64657658635e66094edbcb4d"
|
||||
repo := TestRepoURL
|
||||
commit := util.URLJoin(repo, "commit", sha)
|
||||
tree := util.URLJoin(repo, "tree", sha, "src")
|
||||
|
||||
var file = util.URLJoin(repo, "commit", sha, "example.txt")
|
||||
var fileWithExtra = file + ":"
|
||||
var fileWithHash = file + "#L2"
|
||||
var fileWithHasExtra = file + "#L2:"
|
||||
var commitCompare = util.URLJoin(repo, "compare", sha+"..."+sha)
|
||||
var commitCompareWithHash = commitCompare + "#L2"
|
||||
file := util.URLJoin(repo, "commit", sha, "example.txt")
|
||||
fileWithExtra := file + ":"
|
||||
fileWithHash := file + "#L2"
|
||||
fileWithHasExtra := file + "#L2:"
|
||||
commitCompare := util.URLJoin(repo, "compare", sha+"..."+sha)
|
||||
commitCompareWithHash := commitCompare + "#L2"
|
||||
|
||||
test(sha, `<p><a href="`+commit+`" rel="nofollow"><code>65f1bf27bc</code></a></p>`)
|
||||
test(sha[:7], `<p><a href="`+commit[:len(commit)-(40-7)]+`" rel="nofollow"><code>65f1bf2</code></a></p>`)
|
||||
|
@ -102,8 +102,8 @@ func TestRender_CrossReferences(t *testing.T) {
|
|||
func TestMisc_IsSameDomain(t *testing.T) {
|
||||
setting.AppURL = TestAppURL
|
||||
|
||||
var sha = "b6dd6210eaebc915fd5be5579c58cce4da2e2579"
|
||||
var commit = util.URLJoin(TestRepoURL, "commit", sha)
|
||||
sha := "b6dd6210eaebc915fd5be5579c58cce4da2e2579"
|
||||
commit := util.URLJoin(TestRepoURL, "commit", sha)
|
||||
|
||||
assert.True(t, IsSameDomain(commit))
|
||||
assert.False(t, IsSameDomain("http://google.com/ncr"))
|
||||
|
@ -291,7 +291,7 @@ func TestRender_emoji(t *testing.T) {
|
|||
`<p><span class="emoji" aria-label="`+emoji.GemojiData[i].Description+`">`+emoji.GemojiData[i].Emoji+`</span></p>`)
|
||||
}
|
||||
|
||||
//Text that should be turned into or recognized as emoji
|
||||
// Text that should be turned into or recognized as emoji
|
||||
test(
|
||||
":gitea:",
|
||||
`<p><span class="emoji" aria-label="gitea"><img alt=":gitea:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/gitea.png"/></span></p>`)
|
||||
|
@ -472,7 +472,7 @@ func TestRender_RelativeImages(t *testing.T) {
|
|||
func Test_ParseClusterFuzz(t *testing.T) {
|
||||
setting.AppURL = TestAppURL
|
||||
|
||||
var localMetas = map[string]string{
|
||||
localMetas := map[string]string{
|
||||
"user": "go-gitea",
|
||||
"repo": "gitea",
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ func Test_ParseClusterFuzz(t *testing.T) {
|
|||
func TestIssue16020(t *testing.T) {
|
||||
setting.AppURL = TestAppURL
|
||||
|
||||
var localMetas = map[string]string{
|
||||
localMetas := map[string]string{
|
||||
"user": "go-gitea",
|
||||
"repo": "gitea",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue