Skip to content

Commit 32b578e

Browse files
committed
fix ruleguard linter
1 parent d5f209b commit 32b578e

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

scripts/rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func useStandardTimeoutsAndDelaysInTests(m dsl.Matcher) {
9191
m.Import("github.com/coder/coder/testutil")
9292

9393
m.Match(`context.WithTimeout($ctx, $duration)`).
94-
Where(m.File().Imports("testing") && !m["duration"].Text.Matches("^testutil\\.")).
94+
Where(m.File().Imports("testing") && !m.File().PkgPath.Matches("testutil$") && !m["duration"].Text.Matches("^testutil\\.")).
9595
At(m["duration"]).
9696
Report("Do not use magic numbers in test timeouts and delays. Use the standard testutil.Wait* or testutil.Interval* constants instead.")
9797

testutil/eventually.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func Eventually(ctx context.Context, t testing.TB, condition func() bool, tick t
3939
// EventuallyShort is a convenience function that runs Eventually with
4040
// IntervalFast and times out after WaitShort.
4141
func EventuallyShort(t testing.TB, condition func() bool) bool {
42-
//nolint: gocritic
4342
ctx, cancel := context.WithTimeout(context.Background(), WaitShort)
4443
defer cancel()
4544
return Eventually(ctx, t, condition, IntervalFast)
@@ -48,7 +47,6 @@ func EventuallyShort(t testing.TB, condition func() bool) bool {
4847
// EventuallyMedium is a convenience function that runs Eventually with
4948
// IntervalMedium and times out after WaitMedium.
5049
func EventuallyMedium(t testing.TB, condition func() bool) bool {
51-
//nolint: gocritic
5250
ctx, cancel := context.WithTimeout(context.Background(), WaitMedium)
5351
defer cancel()
5452
return Eventually(ctx, t, condition, IntervalMedium)
@@ -57,7 +55,6 @@ func EventuallyMedium(t testing.TB, condition func() bool) bool {
5755
// EventuallyLong is a convenience function that runs Eventually with
5856
// IntervalSlow and times out after WaitLong.
5957
func EventuallyLong(t testing.TB, condition func() bool) bool {
60-
//nolint: gocritic
6158
ctx, cancel := context.WithTimeout(context.Background(), WaitLong)
6259
defer cancel()
6360
return Eventually(ctx, t, condition, IntervalSlow)

0 commit comments

Comments
 (0)