aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/distrib
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mmx@google.com>2018-04-18 12:30:28 -0700
committerGravatar Mehrdad Afshari <mmx@google.com>2018-04-18 13:38:25 -0700
commitb9424d07e234eec09413659f237a861d34a05132 (patch)
tree3cc7b21646a7f2a06e767ac7809ef8b4b24622b4 /tools/distrib
parente42f126f1013711b4e6807ac9eee3a1af92f2dba (diff)
Run pylint on Python test code
The test modules were not under pylint jurisdiction, and actual bugs have been found in tests that would have been prevented had we run static analysis on the test code as we do on the core modules. This is the first step to enable pylint on tests. Due to numerous warnings since the code is not ready and needs refactoring, a new `.pylintrc` specific to tests is added that suppresses a number of valid warnings. The goal is stepwise elimination of each class of warning while refactoring the code such that it will not emit any warnings in future commits, always keeping the sanity checks passing and keeping the disruption minimal.
Diffstat (limited to 'tools/distrib')
-rwxr-xr-xtools/distrib/pylint_code.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh
index bbacd48737..307fe6c0c0 100755
--- a/tools/distrib/pylint_code.sh
+++ b/tools/distrib/pylint_code.sh
@@ -25,6 +25,10 @@ DIRS=(
'src/python/grpcio_testing/grpc_testing'
)
+TEST_DIRS=(
+ 'src/python/grpcio_tests/tests'
+)
+
VIRTUALENV=python_pylint_venv
virtualenv $VIRTUALENV
@@ -36,4 +40,8 @@ for dir in "${DIRS[@]}"; do
$PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $?
done
+for dir in "${TEST_DIRS[@]}"; do
+ $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || exit $?
+done
+
exit 0