Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Mehrdad Afshari | 2b6b6ca | 2018-06-07 23:41:40 -0700 | [diff] [blame] | 2 | # Copyright 2017 The gRPC Authors |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 3 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 7 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 9 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 15 | |
| 16 | set -ex |
| 17 | |
| 18 | # change to root directory |
Mehrdad Afshari | 5bc11d5 | 2017-06-01 11:23:21 -0700 | [diff] [blame] | 19 | cd "$(dirname "$0")/../.." |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 20 | |
Mehrdad Afshari | 5bc11d5 | 2017-06-01 11:23:21 -0700 | [diff] [blame] | 21 | DIRS=( |
Nathaniel Manista | a7182f7 | 2017-06-24 20:57:00 +0000 | [diff] [blame] | 22 | 'src/python/grpcio/grpc' |
| 23 | 'src/python/grpcio_health_checking/grpc_health' |
| 24 | 'src/python/grpcio_reflection/grpc_reflection' |
Nathaniel Manista | 69b7231 | 2017-07-21 03:18:11 +0000 | [diff] [blame] | 25 | 'src/python/grpcio_testing/grpc_testing' |
Mehrdad Afshari | 5bc11d5 | 2017-06-01 11:23:21 -0700 | [diff] [blame] | 26 | ) |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 27 | |
Mehrdad Afshari | b9424d0 | 2018-04-18 12:30:28 -0700 | [diff] [blame] | 28 | TEST_DIRS=( |
| 29 | 'src/python/grpcio_tests/tests' |
| 30 | ) |
| 31 | |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 32 | VIRTUALENV=python_pylint_venv |
Mehrdad Afshari | d0d8ce8 | 2018-04-18 17:51:32 -0700 | [diff] [blame] | 33 | python -m virtualenv $VIRTUALENV |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 34 | |
Mehrdad Afshari | d0d8ce8 | 2018-04-18 17:51:32 -0700 | [diff] [blame] | 35 | PYTHON=$VIRTUALENV/bin/python |
| 36 | |
| 37 | $PYTHON -m pip install --upgrade pip==10.0.1 |
Mehrdad Afshari | 2b6b6ca | 2018-06-07 23:41:40 -0700 | [diff] [blame] | 38 | $PYTHON -m pip install pylint==1.9.2 |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 39 | |
Mehrdad Afshari | 3b24894 | 2018-06-07 23:59:05 -0700 | [diff] [blame] | 40 | EXIT=0 |
Mehrdad Afshari | 5bc11d5 | 2017-06-01 11:23:21 -0700 | [diff] [blame] | 41 | for dir in "${DIRS[@]}"; do |
Mehrdad Afshari | 3b24894 | 2018-06-07 23:59:05 -0700 | [diff] [blame] | 42 | $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || EXIT=1 |
Mehrdad Afshari | 1a967c3 | 2017-02-13 11:38:17 -0800 | [diff] [blame] | 43 | done |
| 44 | |
Mehrdad Afshari | b9424d0 | 2018-04-18 12:30:28 -0700 | [diff] [blame] | 45 | for dir in "${TEST_DIRS[@]}"; do |
Mehrdad Afshari | 3b24894 | 2018-06-07 23:59:05 -0700 | [diff] [blame] | 46 | $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || EXIT=1 |
Mehrdad Afshari | b9424d0 | 2018-04-18 12:30:28 -0700 | [diff] [blame] | 47 | done |
| 48 | |
Mehrdad Afshari | 3b24894 | 2018-06-07 23:59:05 -0700 | [diff] [blame] | 49 | exit $EXIT |