Skip to content

Commit e7192b1

Browse files
committed
add lint rule of all context should have timeouts back
1 parent c33cbef commit e7192b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/vet.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" --
6969
# - Ensure all xds proto imports are renamed to *pb or *grpc.
7070
git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "'
7171

72+
# - Ensure all context usages are done with timeout.
73+
git grep -e 'context.Background()' --or -e 'context.TODO()' -- "*_test.go" | grep -v "benchmark/primitives/context_test.go" | grep -v "credentials/google" | grep -v "internal/transport/" | grep -v "xds/internal/" | grep -v "security/advancedtls" | not grep -v 'context.WithTimeout(' | not grep -v 'context.WithCancel('
74+
75+
7276
misspell -error .
7377

7478
# - gofmt, goimports, go vet, go mod tidy.

0 commit comments

Comments
 (0)