From 2838ff184deeee6d168971efb6dd19ba64c1ced7 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Mon, 28 Oct 2019 12:20:41 -0700 Subject: [PATCH] Make pylint less annoying --- .../tests/protoc_plugin/_python_plugin_test.py | 12 ++++++------ tools/distrib/pylint_code.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py b/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py index 00e60b43ef4..a5a922853ba 100644 --- a/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py +++ b/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py @@ -149,14 +149,14 @@ def _CreateService(): def StreamingOutputCall(self, request, context): return servicer_methods.StreamingOutputCall(request, context) - def StreamingInputCall(self, request_iter, context): - return servicer_methods.StreamingInputCall(request_iter, context) + def StreamingInputCall(self, request_iterator, context): + return servicer_methods.StreamingInputCall(request_iterator, context) - def FullDuplexCall(self, request_iter, context): - return servicer_methods.FullDuplexCall(request_iter, context) + def FullDuplexCall(self, request_iterator, context): + return servicer_methods.FullDuplexCall(request_iterator, context) - def HalfDuplexCall(self, request_iter, context): - return servicer_methods.HalfDuplexCall(request_iter, context) + def HalfDuplexCall(self, request_iterator, context): + return servicer_methods.HalfDuplexCall(request_iterator, context) server = test_common.test_server() getattr(service_pb2_grpc, ADD_SERVICER_TO_SERVER_IDENTIFIER)(Servicer(), diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh index 75aed1c4814..8a38afdabe5 100755 --- a/tools/distrib/pylint_code.sh +++ b/tools/distrib/pylint_code.sh @@ -15,6 +15,9 @@ set -ex +# NOTE(rbellevi): We ignore generated code. +IGNORE_PATTERNS=--ignore-patterns='.*pb2\.py,.*pb2_grpc\.py' + # change to root directory cd "$(dirname "$0")/../.." @@ -41,17 +44,17 @@ $PYTHON -m pip install --upgrade pylint==2.2.2 EXIT=0 for dir in "${DIRS[@]}"; do - $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || EXIT=1 + $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" ${IGNORE_PATTERNS} || EXIT=1 done for dir in "${TEST_DIRS[@]}"; do - $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || EXIT=1 + $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" ${IGNORE_PATTERNS} || EXIT=1 done find examples/python \ -iname "*.py" \ -not -name "*_pb2.py" \ -not -name "*_pb2_grpc.py" \ - | xargs $PYTHON -m pylint --rcfile=.pylintrc-examples -rn + | xargs $PYTHON -m pylint --rcfile=.pylintrc-examples -rn ${IGNORE_PATTERNS} exit $EXIT