Merge pull request #20837 from gnossen/pylint_considered_annoying

Make pylint less annoying
pull/20853/head
Richard Belleville 5 years ago committed by GitHub
commit 57e463db82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py
  2. 9
      tools/distrib/pylint_code.sh

@ -149,14 +149,15 @@ 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(),

@ -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

Loading…
Cancel
Save