Enable tenv and testifylint rules (#32852)

Enables tenv and testifylint linters
closes: https://github.com/go-gitea/gitea/issues/32842
This commit is contained in:
TheFox0x7 2024-12-15 11:41:29 +01:00 committed by GitHub
parent df9a78cd04
commit 33e8e82c4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
113 changed files with 272 additions and 282 deletions

View file

@ -6,7 +6,6 @@ package base
import (
"crypto/sha1"
"fmt"
"os"
"testing"
"time"
@ -157,7 +156,7 @@ func TestStringsToInt64s(t *testing.T) {
testSuccess([]string{"1", "4", "16", "64", "256"}, []int64{1, 4, 16, 64, 256})
ints, err := StringsToInt64s([]string{"-1", "a"})
assert.Len(t, ints, 0)
assert.Empty(t, ints)
assert.Error(t, err)
}
@ -172,9 +171,9 @@ func TestInt64sToStrings(t *testing.T) {
// TODO: Test EntryIcon
func TestSetupGiteaRoot(t *testing.T) {
_ = os.Setenv("GITEA_ROOT", "test")
t.Setenv("GITEA_ROOT", "test")
assert.Equal(t, "test", SetupGiteaRoot())
_ = os.Setenv("GITEA_ROOT", "")
t.Setenv("GITEA_ROOT", "")
assert.NotEqual(t, "test", SetupGiteaRoot())
}