|
43 | 43 | (grep -L "DO NOT EDIT" $(git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)" -- '*.go') || true) | fail_on_output
|
44 | 44 |
|
45 | 45 | # - Make sure all tests in grpc and grpc/test use leakcheck via Teardown.
|
46 |
| -not grep 'func Test[^(]' *_test.go |
47 |
| -not grep 'func Test[^(]' test/*.go |
| 46 | +not grep 'func Test[^(]' -- *_test.go |
| 47 | +not grep 'func Test[^(]' -- test/*.go |
48 | 48 |
|
49 | 49 | # - Check for typos in test function names
|
50 |
| -git grep --quiet 'func (s) ' -- "*_test.go" | not grep -v 'func (s) Test' |
51 |
| -git grep --quiet 'func [A-Z]' -- "*_test.go" | not grep -v 'func Test\|Benchmark\|Example' |
| 50 | +git grep 'func (s) ' -- "*_test.go" | not grep -v 'func (s) Test' |
| 51 | +git grep 'func [A-Z]' -- "*_test.go" | not grep -v 'func Test\|Benchmark\|Example' |
52 | 52 |
|
53 | 53 | # - Do not use time.After except in tests. It has the potential to leak the
|
54 | 54 | # timer since there is no way to stop it early.
|
55 |
| -git grep --quiet -l 'time.After(' -- "*.go" | not grep -v '_test.go\|test_utils\|testutils' |
| 55 | +git grep -l 'time.After(' -- "*.go" | not grep -v '_test.go\|test_utils\|testutils' |
56 | 56 |
|
57 | 57 | # - Do not use "interface{}"; use "any" instead.
|
58 |
| -git grep --quiet -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc\|grpc_testing_not_regenerate' |
| 58 | +git grep -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc\|grpc_testing_not_regenerate' |
59 | 59 |
|
60 | 60 | # - Do not call grpclog directly. Use grpclog.Component instead.
|
61 |
| -git grep --quiet -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpclog.F' --or -e 'grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' |
| 61 | +git grep -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpclog.F' --or -e 'grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' |
62 | 62 |
|
63 | 63 | # - Ensure that the deprecated protobuf dependency is not used.
|
64 |
| -not git grep --quiet "\"github.com/golang/protobuf/*" -- "*.go" ':(exclude)reflection/test/grpc_testing_not_regenerate/*' |
| 64 | +not git grep "\"github.com/golang/protobuf/*" -- "*.go" ':(exclude)reflection/test/grpc_testing_not_regenerate/*' |
65 | 65 |
|
66 | 66 | # - Ensure all usages of grpc_testing package are renamed when importing.
|
67 |
| -not git grep --quiet "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" -- "*.go" |
| 67 | +not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" -- "*.go" |
68 | 68 |
|
69 | 69 | # - Ensure all xds proto imports are renamed to *pb or *grpc.
|
70 |
| -git grep --quiet '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "' |
| 70 | +git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "' |
71 | 71 |
|
72 | 72 | misspell -error .
|
73 | 73 |
|
|
0 commit comments