1#!/bin/bash 2# Copyright 2017 The gRPC Authors 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16set -ex 17 18# change to root directory 19cd "$(dirname "$0")/../.." 20 21DIRS=( 22 'src/python/grpcio/grpc' 23 'src/python/grpcio_health_checking/grpc_health' 24 'src/python/grpcio_reflection/grpc_reflection' 25 'src/python/grpcio_testing/grpc_testing' 26) 27 28TEST_DIRS=( 29 'src/python/grpcio_tests/tests' 30) 31 32VIRTUALENV=python_pylint_venv 33python -m virtualenv $VIRTUALENV 34 35PYTHON=$VIRTUALENV/bin/python 36 37$PYTHON -m pip install --upgrade pip==10.0.1 38$PYTHON -m pip install pylint==1.9.2 39 40EXIT=0 41for dir in "${DIRS[@]}"; do 42 $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || EXIT=1 43done 44 45for dir in "${TEST_DIRS[@]}"; do 46 $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || EXIT=1 47done 48 49exit $EXIT 50