-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lint: fix some testifylint warnings #4932
Conversation
b353164
to
4e87d62
Compare
4e87d62
to
fae33ad
Compare
fae33ad
to
0e1757f
Compare
This one looks legit: https://github.com/moby/buildkit/actions/runs/9289931268/job/25613491736?pr=4932#step:8:2933
|
0e1757f
to
c43b9ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks fine. Had a few questions before I approve.
@@ -288,8 +289,8 @@ func TestCacheMountLockedRefs(t *testing.T) { | |||
gotRef4 := make(chan struct{}) | |||
go func() { | |||
ref4, err := g2.getRefCacheDir(ctx, nil, "foo", pb.CacheSharingOpt_LOCKED) | |||
require.NoError(t, err) | |||
require.Equal(t, ref.ID(), ref4.ID()) | |||
assert.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this sometimes changed from assert.NoError
to require.NoError
and other times it's the opposite? Is this because this is in a goroutine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the rule is that require is not allowed in goroutines, same as https://pkg.go.dev/testing#B.FailNow
@@ -23,6 +23,7 @@ linters: | |||
- nolintlint | |||
- revive | |||
- staticcheck | |||
# - testifylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out here? Is it just because it doesn't fix everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is only the first batch
This does not cover all warning yet but split into chunks to ease review. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
c43b9ad
to
03c7a6d
Compare
depends on #4931 (only last commit new)This does not cover all warnings yet but split into chunks to ease review. There are quite a lot of updates needed so we can do them in multiple PRs so that there isn't a big review or bad rebase needed.