Skip to content

Commit 1849401

Browse files
committed
restore testifylint supression, change gocritic comment to explanation
1 parent 305cbdb commit 1849401

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

services/repository/files/file_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
)
1111

1212
func TestCleanUploadFileName(t *testing.T) {
13-
assert.Empty(t, CleanGitTreePath(""))
14-
assert.Empty(t, CleanGitTreePath("."))
13+
assert.Equal(t, "", CleanGitTreePath("")) //nolint:testifylint // for readability and alignment
14+
assert.Equal(t, "", CleanGitTreePath(".")) //nolint:testifylint // for readability and alignment
1515
assert.Equal(t, "a/b", CleanGitTreePath("a/b"))
16-
assert.Empty(t, CleanGitTreePath(".git/b"))
17-
assert.Empty(t, CleanGitTreePath("a/.git"))
16+
assert.Equal(t, "", CleanGitTreePath(".git/b")) //nolint:testifylint // for readability and alignment
17+
assert.Equal(t, "", CleanGitTreePath("a/.git")) //nolint:testifylint // for readability and alignment
1818
}

services/user/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func UpdateUser(ctx context.Context, u *user_model.User, opts *UpdateOptions) er
137137
} else if !user_model.IsLastAdminUser(ctx, u) /* not the last admin */ {
138138
u.IsAdmin = opts.IsAdmin.Value().FieldValue // it's safe to change it from false to true (not the last admin)
139139
cols = append(cols, "is_admin")
140-
} else /* IsAdmin=false but this is the last admin user */ { //nolint:gocritic // could flatten the condition, no idea how to flatten comments at the moment
140+
} else /* IsAdmin=false but this is the last admin user */ { //nolint:gocritic // make it easier to read
141141
if !opts.IsAdmin.Value().FromSync {
142142
return user_model.ErrDeleteLastAdminUser{UID: u.ID}
143143
}

0 commit comments

Comments
 (0)