diff options
author | TheFox0x7 <thefox0x7@gmail.com> | 2024-07-30 21:41:10 +0200 |
---|---|---|
committer | Earl Warren <earl-warren@noreply.codeberg.org> | 2024-07-30 21:41:10 +0200 |
commit | 4de909747bdf322bbb37d500b9705d7a3a050b78 (patch) | |
tree | 62dad5d457c227628877d235f0105db9ae4bc200 /models/unit | |
parent | Merge pull request 'Implement external release assets' (#1445) from maltejur/... (diff) | |
download | forgejo-4de909747bdf322bbb37d500b9705d7a3a050b78.tar.xz forgejo-4de909747bdf322bbb37d500b9705d7a3a050b78.zip |
Add testifylint to lint checks (#4535)
go-require lint is ignored for now
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
Diffstat (limited to 'models/unit')
-rw-r--r-- | models/unit/unit_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/unit/unit_test.go b/models/unit/unit_test.go index 7bf6326145..a73967742f 100644 --- a/models/unit/unit_test.go +++ b/models/unit/unit_test.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/modules/setting" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestLoadUnitConfig(t *testing.T) { @@ -27,7 +28,7 @@ func TestLoadUnitConfig(t *testing.T) { setting.Repository.DisabledRepoUnits = []string{"repo.issues"} setting.Repository.DefaultRepoUnits = []string{"repo.code", "repo.releases", "repo.issues", "repo.pulls"} setting.Repository.DefaultForkRepoUnits = []string{"repo.releases"} - assert.NoError(t, LoadUnitConfig()) + require.NoError(t, LoadUnitConfig()) assert.Equal(t, []Type{TypeIssues}, DisabledRepoUnitsGet()) assert.Equal(t, []Type{TypeCode, TypeReleases, TypePullRequests}, DefaultRepoUnits) assert.Equal(t, []Type{TypeReleases}, DefaultForkRepoUnits) @@ -47,7 +48,7 @@ func TestLoadUnitConfig(t *testing.T) { setting.Repository.DisabledRepoUnits = []string{"repo.issues", "invalid.1"} setting.Repository.DefaultRepoUnits = []string{"repo.code", "invalid.2", "repo.releases", "repo.issues", "repo.pulls"} setting.Repository.DefaultForkRepoUnits = []string{"invalid.3", "repo.releases"} - assert.NoError(t, LoadUnitConfig()) + require.NoError(t, LoadUnitConfig()) assert.Equal(t, []Type{TypeIssues}, DisabledRepoUnitsGet()) assert.Equal(t, []Type{TypeCode, TypeReleases, TypePullRequests}, DefaultRepoUnits) assert.Equal(t, []Type{TypeReleases}, DefaultForkRepoUnits) @@ -67,7 +68,7 @@ func TestLoadUnitConfig(t *testing.T) { setting.Repository.DisabledRepoUnits = []string{"repo.issues", "repo.issues"} setting.Repository.DefaultRepoUnits = []string{"repo.code", "repo.releases", "repo.issues", "repo.pulls", "repo.code"} setting.Repository.DefaultForkRepoUnits = []string{"repo.releases", "repo.releases"} - assert.NoError(t, LoadUnitConfig()) + require.NoError(t, LoadUnitConfig()) assert.Equal(t, []Type{TypeIssues}, DisabledRepoUnitsGet()) assert.Equal(t, []Type{TypeCode, TypeReleases, TypePullRequests}, DefaultRepoUnits) assert.Equal(t, []Type{TypeReleases}, DefaultForkRepoUnits) @@ -87,7 +88,7 @@ func TestLoadUnitConfig(t *testing.T) { setting.Repository.DisabledRepoUnits = []string{"repo.issues", "repo.issues"} setting.Repository.DefaultRepoUnits = []string{} setting.Repository.DefaultForkRepoUnits = []string{"repo.releases", "repo.releases"} - assert.NoError(t, LoadUnitConfig()) + require.NoError(t, LoadUnitConfig()) assert.Equal(t, []Type{TypeIssues}, DisabledRepoUnitsGet()) assert.ElementsMatch(t, []Type{TypeCode, TypePullRequests, TypeReleases, TypeWiki, TypePackages, TypeProjects, TypeActions}, DefaultRepoUnits) assert.Equal(t, []Type{TypeReleases}, DefaultForkRepoUnits) |